EasyManua.ls Logo

Campbell CR850 - Converting 16-Bit to 32-Bit Longs; Modbus over IP; Modbus Tidbytes

Campbell CR850
566 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section 8. Operation
354
8.6.2.5 Modbus over IP
Modbus over IP functionality is an option with the CR800. Contact Campbell
Scientific for details.
8.6.2.6 Modbus tidBytes
Q:
CanModbusbeusedoveranRS232link,7databits,evenparity,one
stopbit?
A:
Yes.PrecedeModBusMaster()/ModBusSlave()withSerialOpen()and
setthenumericformatoftheCOMportwithanyoftheavailable
formats,includingtheoptionof7databits,evenparity.SerialOpen()
andMo
dBusMaster()canbeusedonceandplacedbeforeScan().
ConcatenatingtwoModbuslong16bitvariablestooneModbuslong32
bitnumber.
8.6.2.7 Converting 16-bit to 32-bit Longs
ConcatenationoftwoModbuslong16bitvariablestooneModbuslong
32bitnumberisshowninthefollowingexample.
CRBasicExample66. ConcatenatingModbusLongVariables
'Requires CR800 OS v.3, CR1000 OS v.12, or CR3000 OS v.5 or higher
'CR800 uses Big-endien word order.
'Declarations
Public Combo As Long 'Variable to hold the combined 32-bit
Public Register(2) As Long 'Array holds two 16-bit ModBus long
'variables
'Register(1) = Least Significant Word
'Register(2) = Most Significant Word
Public Result 'Holds the result of the ModBus master
'query
'Aliases used for clarification
Alias Register(1) = Register_LSW 'Least significant word.
Alias Register(2) = Register_MSW 'Most significant word.
BeginProg
'If you use the numbers below (un-comment them first)
'Combo is read as 131073 decimal
'Register_LSW=&h0001 'Least significant word.
'Register_MSW=&h0002 ' Most significant word.

Table of Contents

Related product manuals