16
Technical support / Re: PLC INPUT Interrupt Behavior
« on: October 06, 2022, 09:42:05 PM »
I wrote some test code to see if I could figure out how long it takes from the time that an active INPUT ISR is turned off via the IntrOff statement to when the state of the physical INPUT can been "seen" by ladder logic.
The amount of time is 2 to 3 scans of the ladder logic. In most cases it takes 2 scans.
I have attached a image of the ladder logic and the complete program for the test to this reply.
The CF, Ch1FndLowSw sets up the interrupt for the INPUT[1] and issues a StepMove command. The RELAY, GO, will invoke the CF.
The ISR CF, Ch1LmtSLo_Int, will be triggered when the INPUT[1], Ch1LmtSwLo goes active. The ISR is configured to respond to a rising edge event. The ISR does two important things:
1. Turns off the ISR
2. Sets the RELAY, Ch1Intr to indicate that the interrupt has been serviced.
The CF, IncScanCount increments the TBASIC variable A on each scan of the ladder logic that the CH1Intr RELAY is active.
The PLC code is very simple. Just complicated enough to answer some of my questions.
Best regards,
Gary Dickinson
The amount of time is 2 to 3 scans of the ladder logic. In most cases it takes 2 scans.
I have attached a image of the ladder logic and the complete program for the test to this reply.
The CF, Ch1FndLowSw sets up the interrupt for the INPUT[1] and issues a StepMove command. The RELAY, GO, will invoke the CF.
The ISR CF, Ch1LmtSLo_Int, will be triggered when the INPUT[1], Ch1LmtSwLo goes active. The ISR is configured to respond to a rising edge event. The ISR does two important things:
1. Turns off the ISR
2. Sets the RELAY, Ch1Intr to indicate that the interrupt has been serviced.
The CF, IncScanCount increments the TBASIC variable A on each scan of the ladder logic that the CH1Intr RELAY is active.
The PLC code is very simple. Just complicated enough to answer some of my questions.
Best regards,
Gary Dickinson