Section 8. Operation
Concatenating Modbus Long Variables
'This program example demonstrates concatenation (splicing) of Long data type variables
'for Modbus operations.
'
'NOTE: The CR800 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.
Scan(1,Sec,0,0)
'In the case of the CR800 being the ModBus master then the
'ModbusMaster instruction would be used (instead of fixing
'the variables as shown between the BeginProg and SCAN instructions).
ModbusMaster(Result,COMRS232,-115200,5,3,Register(),-1,2,3,100)
'MoveBytes(DestVariable,DestOffset,SourceVariable,SourceOffSet,
'NumberOfBytes)
MoveBytes(Combo,2, Register_LSW,2,2)
MoveBytes(Combo,0, Register_MSW,2,2)
NextScan
8.11 Keyboard/Display — Details
Related Topics:
• Keyboard/Display — Overview (p. 80)
• Keyboard/Display — Details
(p. 443)
• Keyboard/Display — List
(p. 569)
• Custom Menus — Overview
(p. 82)
Note See Displaying Data: Custom Menus — Details (p. 207).
A keyboard is available for use with the CR800. See Keyboard/Display — List (p.
569)
for information on available keyboard displays. The CR850 has an integrated
keyboard display. This section illustrates the use of the keyboard display using
default menus. Some keys have special functions as outlined below.