Is polling required to latch a digital input

sorka

Active Member
I'd like to send http post to my ISY whenever a digital input on my CAI is tripped. Looking at some of the loop examples that require testing the input and then doing some sort of delay seems like I could miss input changes that only last a few hundred ms unless I'm willing to poll at a rate guaranteed to catch it. So if the input is only set for a tenth of a second, then it seems like the PLC loop would have to delay no more than 50 ms. 
 
Am I missing something here? Is there a way to test in the loop that the input was triggered even if it's no longer the case? 
 
WC8 has a hardware counter, that is operating in hardware, even with other tasks going on. To capture a short pulse, you might consider using that to capture it, by comparing counter number with your last saved number to decide if a trigger was made.  WC8 hardware counter can catch up to 4Mhz high frequency pulses.
 
Back
Top