Specifications
Commands - 84
OPTO
Process Function
SYNTAX: a = OPTO (channel)
PURPOSE: To return the status of an input on an on board opto isolator rack.
REMARKS: Inputs and outputs are active low when interfacing with opto-isolator racks. Thus, writing a “1” to
an opto output module will turn it off. This confusion is eliminated with the OPTO function. It
automatically inverts the logic so that a “1” represents on and a “0” represents off.
The OPTO 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 3 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” was returned. This would mean that there was not input signal at an opto module in this
location.
ERROR: <Data negative> – channel
<Illegal argument> - if channel > 23