Input of Data (Numeric and String)
Input of Data
The command, IN, is used to prompt the user to input numeric or string data. Using the IN command, the
user may specify a message prompt by placing a message in quotations. When the RIO executes an IN
command, it will wait for the input of data. The input data is assigned to the specified variable or array
element.
Note:
The IN command is only valid when communicating through RS232. This command will not work
through the Ethernet.
An Example for Inputting Numeric Data
#A
IN "Enter output number", OUT
EN
In this example, the message “Enter output number” is displayed on the computer screen. The RIO board
waits for the operator to enter a value. The operator enters the numeric value that is then assigned to the
variable, OUT.
Inputting String Variables
String variables with up to six characters may input using the specifier, {Sn} where n represents the number
of string characters to be input. If n is not specified, six characters will be accepted. For example, IN "Enter
X,Y or Z", V{S} specifies a string variable of up to six characters to be input.
Output of Data (Numeric and String)
Numerical and string data can be output from the RIO board using several methods. The message command,
MG, can output string and numerical data. Also, the RIO can be commanded to return the values of variables
and arrays, as well as other information using the interrogation commands, such as V1=? and TZ.
Sending Messages
Messages may be sent using the message command, MG. This command sends specified text and numerical
or string data from variables or arrays to the screen.
Text strings are specified in quotes and variable or array data is designated by the name of the variable or
array. For example:
MG "The Final Value is", RESULT
In addition to variables, functions and commands, responses can be used in the message command. For
example:
MG "The input is", @IN[1]
Formatting Messages
String variables can be formatted using the specifier, {Sn} where n is the number of characters, 1 thru 6. For
example:
MG STR {S3}
RIO-47xxx
Chapter 5 Programming
●
69
Содержание 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...