Chapter 5 Programming
Overview
The RIO provides a versatile programming language that allows users to customize the RIO board for their
particular application. Programs can be downloaded into the RIO memory, freeing up the host computer for
other tasks. However, the host computer can send commands to the RIO at any time, even while a program
is being executed.
In addition to commands that handle I/O, the RIO provides commands that allow it to make decisions. These
commands include conditional jumps, event triggers, and subroutines. For example, the command
JP#LOOP, n<10 causes a jump to the label #LOOP if the variable n is less than 10.
For greater programming flexibility, the RIO provides user-defined variables, arrays, and arithmetic
functions. The following sections in this chapter discuss all aspects of creating applications programs. The
RIO-47xx0 program memory size is 200 lines x 40 characters. The RIO 47xx2 increases the memory size to
a total of 400 lines x 40 characters.
Editing Programs
Use Galil software to enter programs in the Editor window. After downloading a program, use the XQ
command to execute the program. The RIO also has an internal editor that may be used to create and edit
programs in the RIOs memory. The internal editor is a rudimentary editor and is only recommended when
operating with Galil’s DOS utilities or through a simple RS-232 communication interface such as Windows
Hyperterminal. See the ED command in the Command Reference for more info.
Program Format
A RIO program consists of instructions combined to solve a programmable logic application. Action
instructions, such as setting and clearing I/O bits, are combined with Program Flow instructions to form the
complete program. Program Flow instructions evaluate real-time conditions, such as elapsed time or input
interrupts, and alter program flow accordingly.
A delimiter must separate each RIO instruction. Valid delimiters are the semicolon (;) or carriage return.
The semicolon is used to separate multiple instructions on a single program line where the maximum number
of characters on a line is 40 (including semicolons and spaces). A line continuation character ( ` ) (below the
~ on a standard keyboard) allows a command to be continued on the next line in the case that 40characters is
not enough for a single command (see example at the end of this section).
RIO-47xxx
Chapter 5 Programming
●
49
Содержание 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...