Using Labels in Programs
All RIO programs must begin with a label and end with an End (EN) statement. Labels start with the number
(#) sign followed by a maximum of seven characters. The first character must be a letter; after that, numbers
are permitted. Spaces are not allowed.
The maximum number of labels that can be defined in the RIO-47xx0 is 62. The RIO-47xx2 increases this to
a total of 126 labels.
Valid labels:
#BASICIO
#SQUARE
#X1
#input1
Invalid labels:
#1Square
#123
#PROGRAMMING
(
longer than 7 characters)
Special Labels
The RIO also has some special labels, which are used to define input interrupt subroutines and command
error subroutines
.
The following is a list of the automatic subroutines supported by the RIO. Sample
programs for these subroutines can be found in the section
Automatic Subroutines for Monitoring Conditions.
#AUTO
Automatic Program Execution on power up
#ININTn
Label for Input Interrupt subroutine
#CMDERR
Label for incorrect command subroutine
#TCPERR
Ethernet communication error
#AUTO is a special label for automatic program execution. A program which has been saved into the
controller non-volatile memory using the BP (Burn Program) command can be automatically executed upon
power up or reset by beginning the program with the label #AUTO.
Commenting Programs
Using an Apostrophe to Comment
The RIO provides an apostrophe (‘) for commenting programs. This character allows the user to include up
to 39 characters on a single line after the apostrophe and can be used to include comments from the
programmer as in the following example:
#OUTPUT
‘ PROGRAM LABEL
SB1; CB2
‘Set Bit 1 and Clear Bit 2
EN; ‘END OF PROGRAM
Note:
The NO command also works to comment programs. The inclusion of the apostrophe or NO
commands will require process time by the RIO board.
Using REM Statements with the Galil Terminal Software
When using Galil software to communicate with the RIO, REM, as in remark, statements may also be
included. ‘REM’ statements begin with the word ‘REM’ and may be followed by any comments that are on
50 Chapter 5 Programming
RIO-47xxx
Содержание RIO-47**0
Страница 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...