General-purpose I/O – Related TML Instructions and Data (Firmware version FBxx)

Variables

INSTATUS        Provides status of the following digital inputs:

The above bits are set to 0 if the input is low (at connectors level) and 1 if the input is high (at connectors level). The information is automatically corrected in the case of inverted inputs. The other bits INSTATUS have no significance.

Instructions

user_var = IN(n)        Read input n in the user variable user_var

user_var = IN(n1, n2, n3, …)        Read inputs n1, n2, n3,… in the user variable user_var

OUT(n) =value16        Set the output line as specified by value16

OUT(n1, n2, n3, …) =value16        Set the output lines n1 n2, n3 as specified by value16

SetAsInput(n);                Set the I/O line #n as an input

SetAsOutput(n);                Set the I/O line #n as an output

 

Programming Example        

user_var = IN#36;                        // read input #36 in user_var

GOTO label1, user_var, NEQ;        // go to label1 if input #36 is 1

// input #36 is 0

user_var = IN#39;                        // read input #39 in user_var

GOTO label2, user_var, EQ;        // go to label2 if input #39 is 0

// input #39 is 1

...

Label1:                                        // input #36 is 1

...

Label2:                                        // input #39 is 0

...

 

See also:

General-purpose I/O – TML Programming Details

TML Description