
Commands - 91
OPTO
Process Function
SYNTAX: a = OPTO (channel)
PURPOSE: To return the status of an input on an on board opto isolator rack.
REMARK S: Inputs and outputs are active low when interfacing with op to-isolator r acks. Thus, writing a “1” to
an opto output module will turn it off. This confusion is eliminated with the OPTO function. OPTO
automatically inverts the logic so that a “1” represents ON and a “0” represents OFF.
The OPT O function is similar to the BIT function in that individual I/O bits or channels can be read.
It differs in that it is used specifically with opto-isolator racks and it executes much faster.
The channel parameter ranges from 0 to 23 (0-3 on the RPC-30) or 100 to 123 and the channel
number corresponds to the position numbers on the opto module racks.
EXAMPLE: 20 PRINT OPTO(0)
RUN
0
In this example the bit 0 of the port at address 0 was set high. Since the OPTO function inverts the
result, a “0” w as retur ned. This would mean th at there w as not input signal at an opto module in
this location.
ERROR: < Data negative> – channel
< Illegal argument> - if channel > 23
Commenti su questo manuale