
Brought to you by PCS Electronics, www.pcs-electronics.com
52
Appendix G: Communication protocol explanation
If you are one of the many interested in developing your own RDSMAX application, look no further. The entire
protocol will be explained here in detail. Also check the provided sample VB application. If you’re still stuck, do
drop us an email and we will be more than happy to help you out.
Baud rate and COM port
Communication with RDSMAX 4000+ uses RS232 protocol. There are 4 supported speeds, 2400, 14400, 19200 and
38400. 2400 was provided for extremely long cable runs, 14400 was used for compatibility with RDSMAX 30, 19200
and 38400 were added for cases where fast update time is an advantage.
A simple VB code would look like this:
MSComm1.CommPort = COMSelected
'This can be COM1, COM2 etc
Select Case COMSpeed
Case 1
MSComm1.Settings = "2400,N,8,1"
Case 2
MSComm1.Settings = "14400,N,8,1"
Case 3
MSComm1.Settings = "19200,N,8,1"
Case 4
MSComm1.Settings = "38400,N,8,1"
End Select
MSComm1.InputLen = 0
MSComm1.PortOpen = True
General Command Format
This is the format of a typical command sent to the RDSMAX encoder:
<StartByte>
Command
<EndCommandByte>
Value
<EndByte>
<StartByte>:
Signals start of new incoming command/parameter
The hey/binary value of this byte is 0x00 (0b00000000).
VB basic example: MSComm1.Output = Chr$(0) 'Start (0)
Command:
Command/parameter that you wish to send to the encoder
Simply send the command/parameter in ASCII form.
VB basic example: MSComm1.Output = "TA"
<EndCommandByte>:
Signals end of the new incoming command, tells encoder to expect incoming
command/parameter value
The hey/binary value of this byte is 0x01 (0b00000001).
VB basic example: MSComm1.Output = Chr$(1) ‘End Command start of value(1)
Value:
Command/parameter value that you wish to send to the encoder
The method varies a bit from parameter to parameter, but usually you can simply send the command/parameter
value in ASCII form. Check each parameter individually for correct setting.
VB basic example: MSComm1.Output = "1" 'sets TA to ON
<EndByte>:
Signals the end of complete incoming command including command/parameter value, it tells encoder
to process the received data
Appendix
G