Results 1 to 5 of 5

Thread: Send command with MScomm

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    84

    Send command with MScomm

    Good morning all,

    Last week I gave my computer to a technician to repair a motherboard issue. They re stalled windows 7 on my computer, but now my 'Visual basics 6.0' software can't find anything. I am trying to remember how use MSComm1.
    Code:
    Private Sub Form_Load()
    
    ComPort.Settings = "9600,N,8,1"
    ComPort.Handshaking = comNone
    ComPort.CommPort = 1
    ComPort.InputLen = 0
    ComPort.InputMode = comInputModeText
    ComPort.RThreshold = 1
    ComPort.RThreshold = 1
    ComPort.SThreshold = 0
    ComPort.InBufferCount = 0
    ComPort.OutBufferCount = 0
    ComPort.InBufferSize = 0
    ComPort.OutBufferSize = 0
    
    End Sub
    
    
    
    Private Sub Send_Click(Index As Integer)
    Dim DataStr As String
    DataStr = SentOut.Text
      If ComPort.PortOpen = False Then
         ComPort.PortOpen = True
        End If
        
    Select Case Index
    
           Case 0
           
      If ComPort.CommEvent Then
         DataStr = ComPort.Input
         Recieved.Text = Recieved.Text & DataStr
         
        End If
       
          Case 1
          
      MsgBox "Error Recieve Not Allowed"
      
        End Select
        
    End Sub

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Send command with MScomm

    I do not see any code there that outputs anything.
    You do have a receive attempt under a button click which is not a good place for it.

    To send using mscomm you have to use the output method
    To receive you should have the code in the on_Comm event.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    84

    Re: Send command with MScomm

    Thank you,

    I found a copy of my EXE file, but I can no longer open it in Visual Basics. Is there a way to view my original EXE code again?

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,905

    Re: Send command with MScomm

    An executable can not be opened with VB.
    You do need the project including all the files (.vbp, .frm, .cls, .bas)

  5. #5
    Lively Member
    Join Date
    Mar 2018
    Location
    Bandung
    Posts
    111

    Re: Send command with MScomm

    Helo Dav,
    I think same like this https://www.bukalapak.com/p/elektron...=normal_seller

    Thanks,
    Badjuri.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width