User manual

Toolbox 32 User Manual 1.47d www.cse-semaphore.com/mykingfisher
Page
134
Example - RTU Diagnostics / Trouble Shooting
Sometimes it may be difficult to know why an RTU is behaving strangely. By logging the value of the RTU
status register (#YSTAT) or another diagnostic register (eg. #YDIAG, #YFLAGS), the history of the RTU can
be reviewed from the event logs.
RTU Diagnostics
NewRTUStatus LogRTUStatus
#YSTAT Type 1
├──[CHANGE]───────────────────────────────────────────────────────(Event Log)─┤
#YSTAT
Figure: RTU Diagnostics by logging the RTU status register on any change.
Example - Indirect Addressing
This example shows how to add 10 consecutive local registers by using indirect addressing. Indirect
addressing can reduce the amount of ladder logic required for repetitious tasks.
The following registers are used:
#R1 = pointer register (initial value is used to address the first of 10 consecutive registers to add)
#R2 = loop counter
#R3 = total
#R101 to #R110 = registers to add
Add 10 local registers (#R101-#R110) using indirect addressing
Initialise registers
Pointer
#R1
├────────────────────────────────────────────────────────────────┬───(Copy)────┤
101
Loop Counter
#R2
├───(Copy)────┤
0
Total
#R3
└───(Copy)────┤
0
Add registers
LoopStart: Loop Counter Total
#R2 #R3 ┐│
├──────────────────[<]───────────────────────────────────────────┬┤= #R3 ├┤
10 │└+ #R[R1] ┘│
Pointer
#R1
├────(Inc)────┤
Loop Counter
#R2
├────(Inc)────┤
LoopStart
└──( JUMP )───┤
LoopStart
Figure: Adding 10 registers using indirect addressing