Section 8. Operation
8.10.3.2.2 CRBasic Instructions (Modbus)
Complete descriptions and options of commands are available in CRBasic Editor
Help.
ModbusMaster()
Sets up a CR800 as a Modbus master to send or retrieve data from a Modbus
slave.
Syntax
ModbusMaster(ResultCode, ComPort, BaudRate, ModbusAddr,
Function, Variable, Start, Length, Tries, TimeOut)
ModbusSlave()
Sets up a CR800 as a Modbus slave device.
Syntax
ModbusSlave(ComPort, BaudRate, ModbusAddr, DataVariable,
BooleanVariable)
MoveBytes()
Moves binary bytes of data into a different memory location when translating big-
endian to little-endian data. See the appendix Endianness
(p. 559).
Syntax
MoveBytes(Dest, DestOffset, Source, SourceOffset, NumBytes)
ReadOnly()
Set a variable to read only.
Syntax
ReadOnly()
8.10.3.2.3 Addressing (ModbusAddr)
Modbus devices have a unique address in each network. Addresses range from 1
to 247. Address 0 is reserved for universal broadcasts. When using a network
of dataloggers in a Modbus over Pakbus configuration, use the same number for
both the Modbus address and the PakBus address.
If a slave is to echo back requests to the master, enter the address of the slave as a
negative number in ModbusMaster().