Hi I am wondering if I could get some insight into a problem that I am having at the moment. Although I am not having trouble receiving 1 type of data, I am at a loss as to receive 2 types and putting the result of the 2 types of data in the appropriate label captions. In other words I am just having the issue with multiple readings--I am able to do it with one. For example I want to receive direction and put the result in a label. And at the same time, put a voltage result in another label. I am also using an RS232 to RS485 converter with auto tx/rx switchover. Below is what I have so far and would appreciate any assistance. Thank you in advance.
Option Explicit
Dim dir1 as string
Dim dir2 as string
Dim V as string
Dim V2 as string
Private Sub Form_load()
mscomm1.rthreshold = 1
mscomm1.inputlen = 2
mscomm1.comport = 2
mscomm1.settings = "9600,n,8,1"
mscomm1.portopen = true
end sub
Private Sub Mscomm1_OnComm()
If Mscomm1.commevent = comevreceive THEN
Dir1 = Mscomm1.input
Dir2 = Mscomm1.input
labelDir.caption = dir1 & dir2 'puts result of direction in label
ELSE
V = mscomm1.input
V2 = mscomm1.input
labelvolts.caption = V & V2 'puts result of Voltage in label
ENDIF
end sub
Option Explicit
Dim dir1 as string
Dim dir2 as string
Dim V as string
Dim V2 as string
Private Sub Form_load()
mscomm1.rthreshold = 1
mscomm1.inputlen = 2
mscomm1.comport = 2
mscomm1.settings = "9600,n,8,1"
mscomm1.portopen = true
end sub
Private Sub Mscomm1_OnComm()
If Mscomm1.commevent = comevreceive THEN
Dir1 = Mscomm1.input
Dir2 = Mscomm1.input
labelDir.caption = dir1 & dir2 'puts result of direction in label
ELSE
V = mscomm1.input
V2 = mscomm1.input
labelvolts.caption = V & V2 'puts result of Voltage in label
ENDIF
end sub