I have actually thought of using an interupt for this function but like the HSCDEF function, which instigates the operation of a custom function when a count value is reached (in my case just a count of 1), the time it takes to perform the Cusf, counts are still missed, and I believe that would also be the case with using interupts.
I have tried the following:
Cusf#20
HSCPV[1]=0
HSCDEF 1,21,1
SETIO pulsein
Cusf#21
HSCPV[1]=0
HSCDEF 1,20,1
CLRIO pulsein
The 'pulsein' is a contact label which opens and closes providing the input for internal counters. I've also used straightforward inputs to counters via the I/O ports to no avail. Can you see anything wrong with what I am doing or is this a problem that cannot be overcome due to the pulse speed versus the program size?
Can the PLC also be overclocked as a possible way of speeding up the scan speed?