A script program monitors the value of a digital input on an IO module. The input is wired to a switch that, when pushed by an operator, will toggle a digital output ON/OFF to start/stop a piece of equipment.
The issue is the program will randomly fail to see the input changing when the operator releases the button too quickly. This happens even though the IOU module detected the input change as indicated by the LED on the input channel of the UI-16 module.
SXW UI module
In SmartStruxure, Script programs are executed by a task and then go dormant until the task schedules the program to run again. If the input changes and then returns to the value it had the last time the program executed, the change will be missed.
Instead of a digital input, use a counter input and modify the PE Script to toggle the output when the count increments.
Numeric Input theINPUT
Numeric Output theOUTPUT
thePreviousInVal = theINPUT
if theINPUT > thePreviousInVal then goto 3
if theOUTPUT = off then theOUTPUT = on else theOUTPUT = OFF