IO - IO Stat

The IO command allows testing of one of the input (read-only or read-write) bits, or changing the status of one of the output (write-only or read-write) bits.

Command Format

MLString "IO p1,p2"

Examples

MLString "IO 3,1"

MLString "IO 2"

Input

p1 = 0 through 67 (Numeric; required)

p2 = 0 or 1 (Numeric; optional)

p1 is a number which corresponds to the input or output bit whose status is being viewed or changed. p1 must be a digit from 0 through 67. Some bits are read only, some are write only, and others are both read and write. Consult Giddings & Lewis for details.

If p2 is specified, p1 identifies an output (write-only or read-write) bit. p2 may not be specified with a read-only bit. p2 indicates the state to which the output bit identified by p1 is to be changed. p2 must be either a zero (0) or a one (1).

The output bits are like switches which may be opened or closed. For the Control board, when p2 is zero (0), the switch is closed, and when p2 is one (1), the switch is open. On the Auxiliary Digital Input Output board and the Temperature Compensation board, the switch is opened when p2 is zero (0), and the switch is closed when p2 is one (1). In the first example, the state of the write/only bit number 3 is being changed to one.

If p2 is not specified, p1 identifies an input (read-only, read-write) bit. The programmer can only view the status of a bit which has been identified as an input bit. The status of an input bit cannot be changed. In the second example, the bit whose status is to be viewed is the read-only bit #2 on the Control board.

Results

If p2 is not specified, the current status of the input bit identified by p1 is stored in the variable S7. You must immediately check the variable S7 after you execute this function to verify the status of the input bit. If S7 is zero (0), there is no current flow into the input bit. If S7 is one (1), there is current flow into the bit. This is true for the Control board and the Auxiliary Digital Input Output boards. For the Temperature Compensation board, if S7 is zero, the input bit is an open circuit (+V). If S7 is one, the input bit is ground (OV). For the read-write input bits, S7 contains the last value written to the output bit.

If p2 is specified in the IO command, the value of S7 is meaningless. Note that all input bits and/or output bits may not be available to the user. Availability is dependent on the MP configuration purchased.

Skip Action

The Skip Action executes even when inside a Skip block.

Error Messages

MLB-005 - Communication error

MLB-006 - Output mask logical translation error

MLB-007 - Output unavailable

MLB-021 - First parameter invalid

MLB-022 - Second parameter invalid