About Modbus Programming; Endianness - Campbell CR300 Series Product Manual

Compact datalogger
Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

Every message from the client will begin with the server address, followed by the function code,
function parameters, and a checksum. The server will respond with a message beginning with its
address, followed by the function code, data, and a checksum. The amount of data in the packet
will vary, depending on the command sent to the server. Server devices only process one
command at a time. So, the client needs to wait for a response, or timeout before sending the
next command.
A broadcast address is specified to allow simultaneous communications with all servers. Because
response time of server devices is not specified by the standard, and device manufacturers also
rarely specify a maximum response time, broadcast features are rarely used. When implementing
a system, timeouts in the client will need to be adjusted to account for the observed response
time of the servers.
Campbell Scientific data loggers can be programmed to be a Modbus client or Modbus server -
or even both at the same time! This proves particularly helpful when your data logger is a part of
two wider area networks. In one it uses Modbus to query data (as a client) from localized sensors
or other data sources, and then in the other, it serves that data up (as a server) to another
Modbus client.

19.2.6 About Modbus programming

Modbus capability of the data logger must be enabled through configuration or programming.
See the CRBasic Editor help for detailed information on program structure, syntax, and each
instruction available to the data logger.
CRBasic Modbus instructions include:
 
ModbusClient()
l
 
ModbusServer()
l
 
MoveBytes()
l
See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.com/crbasic/cr300/

19.2.6.1 Endianness

Endianness refers to the sequential order in which bytes are arranged into larger numerical
values when stored in memory. Words may be represented in big-endian or little-endian format,
depending on whether bits or bytes or other components are ordered from the big end (most
significant bit) or the little end (least significant bit).
.
19. Communications protocols     114

Advertisement

Table of Contents
loading

Table of Contents