
Keypad Entry Allowing Values Outside Range
I'm working on a script that shouldn't allow a value to get passed through to the PLC if it outside the range. But the value is getting passed to the PLC when it is outside the range.
Code:
spLow = event.source.parent.getComponent('ledSetpointLow').value
spHigh = event.source.parent.getComponent('ledSetpointHigh').value
keyPad = event.source.getComponent('ledSetPointSpeed').value = system.gui.showNumericKeypad(event.source.getComponent('ledSetPointSpeed').value)
if keyPad <= spLow:
system.gui.warningBox("Setpoint too Low")
elif keyPad >= spHigh:
system.gui.warningBox("Setpoint too High")
else:
keyPad
I'm thinking there is something I might be missing in the script to cancel the action if the value is outside the range.