Internet PLC Forum

General => Technical support => Topic started by: M Thouin on February 13, 2004, 09:13:54 AM

Title: Checking fot Inputs
Post by: M Thouin on February 13, 2004, 09:13:54 AM
I want to check the status of my inputs (on or off) using a "for to next" command. Can someone send me a sample code?  
Title: Re:Checking fot Inputs
Post by: support on February 13, 2004, 09:55:42 AM
To test the ON/OFF status of an I/O bit, use the TESTIO( label) function or TESTBIT(n, x) function.

IF TESTIO (IN1) THEN

ELSE

ENDIF

You should not use a FOR NEXT loop to check the status of an input because the physical inputs are only updated at the end of the ladder logic scan or execution of the REFRESH statement.