V
Problem in communicating with Fare Display Unit using MSCOMM and VB6.
Language used: VB6
Details: I am writing a software to send text strings to a 2 line Fare Display Unit (Via Comm controls). The supplier of the fare display has given me the following instructions:
Port Settings: Baud Rate: 4800,n 8,1
Command Syntax:
1) Start of transmission command
2) Send Character "a" for first line followed by 13 characters (Message Text)
3) Send character "b" for second line followed by 13 characters (Message Text)
4) End of transmission command
Problem: The only thing I am good at is to sound intelligent. I have tried all the above given instructions. Given below is a sample code of what I have tried:
Private Sub Command1_Click()
MSComm1.PortOpen = True
MSComm1.Output = "a" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.Output = "b" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.PortOpen = False
End Sub
Regarding the hardware wiring part. The Fare display has only two wires coming out, one for the ground and the other which is connected to presumably the RX pin of the display unit. I have soldered the ground wire to pin 5 of my Comm connector (female db9) and the RX wire to the pin 3 (TX) of the connector. The rest of the pins on the comm connector are left empty. So basically this is a one way communication that is happening here. Therefore I have set the mscomm control's DTR and RTS to false and the handshaking to none.
Language used: VB6
Details: I am writing a software to send text strings to a 2 line Fare Display Unit (Via Comm controls). The supplier of the fare display has given me the following instructions:
Port Settings: Baud Rate: 4800,n 8,1
Command Syntax:
1) Start of transmission command
2) Send Character "a" for first line followed by 13 characters (Message Text)
3) Send character "b" for second line followed by 13 characters (Message Text)
4) End of transmission command
Problem: The only thing I am good at is to sound intelligent. I have tried all the above given instructions. Given below is a sample code of what I have tried:
Private Sub Command1_Click()
MSComm1.PortOpen = True
MSComm1.Output = "a" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.Output = "b" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.PortOpen = False
End Sub
Regarding the hardware wiring part. The Fare display has only two wires coming out, one for the ground and the other which is connected to presumably the RX pin of the display unit. I have soldered the ground wire to pin 5 of my Comm connector (female db9) and the RX wire to the pin 3 (TX) of the connector. The rest of the pins on the comm connector are left empty. So basically this is a one way communication that is happening here. Therefore I have set the mscomm control's DTR and RTS to false and the handshaking to none.
