Hello,
In the customs functions you have some TBASIC functions
SETIO relay/output-name ' To set On the corresponding relay
CLRIO relay.output-name ' To set Off the corresponding relay
TOGGLEIO relay/output-name 'To invert the current state of the corresponding relay (From ON to OFF or OFF to On)
TESTIO (relay/output-name) 'To verify in an IF Statement. function return 1 if the corresponding relay is ON and 0 if Off.
exemple:
IF TESTIO (RELAY1) = 0 THEN SETIO RELAY1 ENDIF 'Change the state of RELAY1 from 0 to 1
IF TESTIO (RELAY1) = 0 THEN TOGGLEIO RELAY1 ENDIF 'Change the state of RELAY1 from 0 to 1
In the I)Trilogy softwareinstallation you have a sample file that illustrate theses commands:
C:\TRILOGI\TL6\usr\Samples\setIO.PC6