IanJohnston Posted June 13, 2003 Report Posted June 13, 2003 Hi, GX IEC Developer (ver 4 & 5) & Q02 cpu. I decided I needed a POU that will only run say every 4000ms (4 secs), so I created a new entry in the task pool and specified:- Prio=10 Interval = T#4000ms I'm finding that the POU doesn't run for 4 secs after everything else is running, but from that point onwards it seems to be running full whack. I'm using a Mits GOT930 terminal which works by way of direct memory access, so the parameters on the LCD are actual PLC memory locations. I can see them delay for 4 secs but then continually refresh. There's no other POU's updating the same memory locations. Any ideas? Ian. Quote
navillusi Posted June 18, 2003 Report Posted June 18, 2003 The problem with the tasks is that once you enable them, you must disable them when finished. Here is how I would tackle this, assuming that you want your subroutine to run every 4 seconds for one scan only.. In your main continuous task, create a 4 second timer which, when done will set a BOOL which you have declared in the GVL (lets call it Task_1) Create a new task within the task pool which will run your "one scan" POU In the task attributes box you will set Event = Task_1, Interval=0, priority=10. This will then enable the POU after a 4 second delay, all you will need to do now is turn it off after 1 scan. Therefore at the end of your "one scan" POU, you will turn off or reset the timer which is still enabled in the main program. I am sure there must be a simpler way than this, but it's the best I can think of. Regards Ian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.