Issue
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.
Environment
Automation Server
SXW UI module
Script Program
Cause
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.
Resolution
Instead of a digital input, use a counter input and modify the PE Script to toggle the output when the count increments.
EXAMPLE:
Numeric Input theINPUT
Numeric Output theOUTPUT
Numeric thePreviousInVal
1:
thePreviousInVal = theINPUT
goto 2
2:
if theINPUT > thePreviousInVal then goto 3
3:
if theOUTPUT = off then theOUTPUT = on else theOUTPUT = OFF
goto 1