Section 8. Operation
443
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
EndProg
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.
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.
Summary of Contents for CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......