11-17-2008 07:11 PM
Hello all,
I am attemping to understand some timing issues.
I have two while loops running in paralle. One while loop is not timed, the other while loop is set at 0.5second (just for the fun of it). Both loops seems to be running conccurrently (both graphs update normally).
Then, I changed the while loops into timed loops (and did nothing else). Now, only one loop updates once every 5 sec? The other one is completely dead (graphs not updating). I have a stop button for each of the loops, so I stopped the loop that was updating, and the other loop remains dead. I was expecting them to behave the same as they did with just while loops. What is happening?
11-17-2008 09:07 PM
11-18-2008 01:10 AM
Most likey you are making a simple mistake and it would be trivial to troubleshood of you would attach your two code versions (before and after).
11-18-2008 05:40 PM
It is an RT system, it is the R 7833. I don't know how realistic it is to post all the files needed to run this thing. But here are the pictures.
Basicly, I just right click on the loop and select "Replace with timed loop". The front panel have graphs.
Before
And after:
11-18-2008 06:17 PM
Oh... I have figured out why now.
This is completely stupid. I linked the stops together. I didn't do this before, and did it after, forgetting that the loop depends on it.
Now, how do I link the stops together so i only have to press stop once?
11-18-2008 06:44 PM
In this use case i think it would be appropriate to use a local variable of the stop button in the other loop.
hope this helps
11-18-2008 06:46 PM
Yes, you created a data dependency between the two loops. 😄
You could place a local variable of the stop button inside the other loop. (you nee to change the button to switch action to do that. Don't forget to set it back to false outside the loop.)
11-19-2008 08:16 AM
One of the few perfect uses for a local.
Also remember if you're on RT, there's more than one choice of internal clocks. That can be a "gotcha" with timed loops on RT.
11-19-2008 10:18 AM