SETIO                Set I/O line as input or output

Syntax                        

SETIO#n IN

SETIO#n as Input port

SETIO#n OUT

SETIO#n as OUTput port

Operandsn: I/O number 0<=n<=39)

PlaceTMLOnline

Binary code

SETIO

DescriptionSome drives/motors include I/O lines that may be used either as inputs or as outputs. Before using these lines, you need to specify how you want to use them, with the SETIO commands:

SETIO#n OUT;        //Set the I/O line #n as an input

SETIO#n IN;        //Set the I/O line #n as an output

Remarks:

Check the drive/motor user manual to find how are set, after power-on, the I/O lines that may be used either as inputs or as outputs
You need to set an I/O line as input or output, only once, after power on  

 

In TML the I/O lines are numbered: #0 to #39. Each product has a specific number of inputs and outputs, therefore only a part of the 40 I/O lines is used. The I/O numbering is common for all the products; hence each product has its own list of available I/Os.

 

Example        

SETIO#12 OUT;        //Set IO line 12 as output

ROUT#12;                //Reset IO line 12 level low (0 logic)

SETIO#12 IN;        //Set IO line 12 as input

v1 = IN#12;        //Read I/O line 12 data into variable v1