Data Sheet

Copyright © Roboteq Inc. 2018. All Rights Reserved. 10
'0' '1'
Node address 0x01
'0' '4'
Function code (Read Input Registers) 0x04
'2' '0' 'C' '1'
Register address for reading VAR1 0x20C1
'0' '0' '0' '2'
Length of registers to be read (must be 2) 0x0002
'1' '8'
LRC
<CRLF>
End of message, carriage return and line feed 0x0D0A
The response for this message will be as following:
:01040400001234DE<CRLF>
Name
Description
':'
Start of message - 0x3A
'0' '1'
Node address 0x01
'0' '4'
Function code (Read Input Registers) 0x04
'0' '4'
Read data length (4 bytes) 0x04
'0' '0' '0' '0' '1' '2' '3' '4'
Value read from VAR1 0x00001234
'D' 'E'
LRC
<CRLF>
End of message, carriage return and line feed 0x0D0A
2.3 Register Address Calculation
Register address is calculated based on CANOpen ID of the command/query. You can use the following
steps to get the register address.
- From Roboteq Manual find your command/query.
- Get the CANOpenID value.
- Left shift the CANOpenID with 5 bits.
- OR the result with the command/query index.
- AND the result with 0xFFFF.
- The resulting value will be the register address.
For example, the read user integer variable CANOpen ID is 0x2106 and suppose we are required to read
the first variable:
- CANOpenID = 0x2106
- Left shift with 5 0x2106 << 5 = 0x420C0
- OR with index 0x420C0 | 0x01 = 0x420C1
- AND the result with 0xFFFF 0x420C1 & 0xFFFF = 0x20C1
- Use 0x20C1 as the address.