XQ _ED2 (or _ED3),_ED1,1
Where the “,1” at the end of the command line indicates a restart; therefore, the existing program stack will
not be removed when the above format executes.
The following example shows an error correction routine that uses the operands.
Example - Command Error w/Multitasking
Instruction Interpretation
#A
Begin thread 0 (continuous loop)
JP#A
EN
End
of
thread
0
#B
Begin
thread
1
N=17
Create
new
variable
SB N
Set the 17th bit, an invalid value
TY
Issue
invalid
command
EN
End
of
thread
1
#CMDERR
Begin command error subroutine
IF _TC=6
If error is out of range (SB 8)
N=1
Set N to a valid number
XQ _ED2,_ED1,1
Retry SB N command
ENDIF
IF _TC=1
If error is invalid command (TY)
XQ _ED3,_ED1,1
Skip invalid command
ENDIF
EN
End
of
command
error
routine
Example – Ethernet Communication Error
This simple program executes in the RIO and indicates (via the serial port) when a communication handle
fails. By monitoring the serial port, the user can re-establish communication if needed.
Instruction
Interpretation
#LOOP Simple
program
loop
JP#LOOP
EN
#TCPERR
Ethernet communication error auto routine
Send message to serial port indicating which handle did not receive
proper acknowledgment.
MG {P1}_IA4
RE
Return to main program
Note: The #TCPERR routine only detects the loss of TCP/IP Ethernet handles, not UDP.
Mathematical and Functional Expressions
Mathematical Operators
For manipulation of data, the RIO provides the use of the following mathematical operators:
RIO-47xxx
Chapter 5 Programming
●
61
Содержание RIO-47120
Страница 2: ......
Страница 93: ...RIO Dimensions RIO 471xx Units in centimeters RIO 47xxx Appendix 87...
Страница 94: ...RIO 472xx Units in millimeters 88 Appendix RIO 47xxx...
Страница 107: ...Internal 56 64 Zero Stack 53 RIO 47xxx Index 101...