Make a loop to trigger a Subroutine every 33 ms.

A

Thread Starter

AT

We are trying to post values on certain registers at a certain rate (~33 Hz). We use a TON block (T32) and set the PT to 34 ms. Using the compare integer block (I>=33), we trigger the subroutine that manipulates the input data and posts the value on output registers.

Is this the right way to get data post at 33Hz? How can I use an oscilloscope to measure data is posted at 33Hz?

Any other ideas suggestions will be greatly appreciated.
 
W

William Sturm

First, 33 Hz is closer to 30 milliseconds (1/33). Second, your scan time will add variation to your time delay. It would be better to use a timed interrupt, if your PLC has one. If your scan time is consistently low, say < 3 ms, depending on your accuracy requirements, then it may not be an issue.
 
Top