Syntax
SetAsInput(n1, n2, n3,…)
|
SetAsInput the I/O lines numbers n1, n2, n3
|
Operands | n1, n2, n3: IO line number. It specifies the position of the control bit associated to the I/O line in the IO_mask. |
Binary code
Description | Some drives/motors include I/O lines that may be used either as inputs or as outputs. Before using these lines as inputs you have to use the SetAsInput command with the input numbers as argument. The input numbers identifies the corresponding bit from the IO_mask, i.e. input number 2 has associated bit 2 in the IO_mask. In TML the input lines are numbered from 0 to 15. |
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. Each product has a specific number of inputs, therefore only a part of the 15 input lines is used. |
• | You need to set an I/O line as input, only once, after power on |
Example
SetAsInput(2,5); //Set IO line 2 and 5 as inputs
v1 = IN(2); //Read I/O line 2 data into variable v1
|