Section 8. Operation
8.6.2.4 Modbus over IP
Modbus over IP functionality is an option with the CR1000. Contact Campbell
Scientific for details.
8.6.2.5 Modbus Q and A
Q: Can Modbus be used over an RS-232 link, 7 data bits, even parity, one stop
bit?
A: Yes. Precede
ModBusMaster()
/
ModBusSlave()
with
SerialOpen()
and set
the numeric format of the COM port with any of the available formats, including
the option of 7 data bits, even parity.
SerialOpen()
and
ModBusMaster()
can be
used once and placed before
Scan()
.
Concatenating two Modbus long 16-bit variables to one Modbus long 32 bit
number.
8.6.2.6 Converting Modbus 16-Bit to 32-Bit Longs
Concatenation of two Modbus long 16-bit variables to one Modbus long 32
bit number is shown in the following example.
CRBasic Example 67.
Concatenating Modbus Long Variables
'This program example demonstrates concatenation (splicing) of Long data type variables
'for Modbus operations. Program is compatible with the following or later operating systems:
' CR800 OS v.3
' CR1000 OS v.12
' CR3000 OS v.5
'
'NOTE: The CR1000 uses big-endian 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.
416
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......