02-02-2017 03:46 PM
Hello,
I'm trying to assign a local variable to a timed while loop running on a MyRIO to control the rate at which the loops run, but when I do this the loops do not run. Any help appreciated.
-T
02-03-2017 11:01 AM
Hello TallGrass
I would like to know if you are in the VI is located in the FPGA or in the Real Time Target. It is just to try something here in my system. Also, feel free to attach a screenshot of your code.
Regards
02-05-2017 03:24 PM
It is in the Real-Time Target. I don't have a copy of the code as I am away from my office but will upload a screenshot as soon as possible Monday morning. Thanks -T
02-06-2017 01:59 PM
Hi TallGrass
I will be waiting for that info
Regards
02-06-2017 02:25 PM
Here is a shot of my issue.
When I assign a value of 1000 to the sample period in the top loop with a local variable it doesn't run the loop, however the bottom loop still runs.
When I assign the value in the configuration box of the timed while loop it works.
Thanks,
-T
02-07-2017 08:02 AM
Hello TallGrass
Thank you very much for attaching the screenshot.
I am wondering about where are you writing the local variable? I am asking that because it might be possible in the specific moment where the time loop reads the local variable it did not have any value loaded yet.
On the other hand I would like to know why did you use a local variable to set it?
Regards
02-07-2017 10:11 AM
The local variable is assigned in the frame before in a flat sequence. It is used a handful of other times to the period for timed while loops throughout my code, and thought it'd be better to assign it this way rather than connecting it directly to each loop. Maybe I should try connecting it directly?
02-08-2017 10:23 AM
Hello TallGrass
Do you mean using a wire? Let's try that.
Regards
02-09-2017 04:51 PM
A wire still doesn't work. When I probe it it says no value has been assigned.
I guess I am confused on the order of operations being performed and am unsure why it is not being read before the loop starts
02-10-2017 09:57 AM
Hey TallGrass
I was trying to recreate the issue you are having here and I realized something but first of all I would like you try:
What I was thinking is that you were using wrong number representation for the dt Parameter. See the screenshot
Let me know if something changes