03-02-2012 03:02 PM - edited 03-02-2012 03:04 PM
Hello!
I am using a cRIO to get five channels of analog voltage in Scan Mode. I have three parallel Timed-while loops. When I use a 1ms dt, the vi does not run, and cRIO is disconnected from the project (it says that cRIO does not respond). When I use a 100ms dt the vi works normally. But the acquisitions have to be made with an interval of 1ms! The possibility exists to be a limitation of the Scan Mode?
Thank you!
Solved! Go to Solution.
03-02-2012 03:15 PM
The scan engine should be able to handle 1ms acquisitions, but make sure you configure the scan engine period for 1ms. You may want to synchronize the timed loops to the scan engine instead (this is one of the timed loop timing options).
If you're trying to run 1ms loops and there's a lot going on in the loops, you may lose the connection with the cRIO because the thread that services TCP connections runs at a lower priority than timed loops. If the timed loops take up all the processor time, there's no CPU time left to handle communication. Do you need to process every sample as you receive it, or can you read the data every ms but process it more slowly in batches? If you upload your code, we may be able to help you eliminate inefficient code that is slowing your loops.
03-03-2012 05:21 PM
I think the sample processing is not the problem, because even though I have three loops, each performs a simple task: the first read one channel and evaluate when the test is over, the second read the other channels and put in a queue, and the last loop provides this queue in shared variable, to be saved. I may try to put it together in a loop or two. When you say to configure the scan engine you refer to the attached image? And for the choice of timed-loop timing options? Where do I configure this? Unfortunately I don't have the codes now ... Thank you for your answer!
03-05-2012 10:34 AM
I'm surprised that the "Synchronize to Scan Engine" option isn't available in that loop - is that loop not running on your cRIO?
The configuration to which I was referring is under the cRIO target properties, in the Scan Engine page. You can set the scan engine period there. The default period is 10ms, so you'll need to change that if you want data every ms.
03-06-2012 04:13 AM
03-07-2012 09:53 AM
It worked! The project had been created with a Scan Egine of 100ms. I modified to 1ms and synchronized wit the loops and worked.
Thanks nathand!
03-10-2012 01:51 PM
Hello
I use Crio in scan mode and have same problem with timed loop. I use two timed loop for two different PID loop. I need to get 1ms delay for PID loop. But When I two run realtime side with timed loop, only one of them work (when ı send command from host side). Is it possible to run two time loop 1ms. How can I configure each timed loop work together properly? (ı configured the each time loop as synchron scan enginee 1ms)
03-11-2012 02:04 PM
I don't think the problem is with your configuration of the timed loops.
I can't understand what you want your code to do. Why the for loops? If both timed loops run at the same rate, synchronized with the scan engine, why do you need to two loops? How are you sending a command from the host?
My guess is that either "piston1veri" or "verigonder2" is an empty array, so the associated for loop never runs. You could check this by probing the values while the code is running. Have you done any debugging, or run this with execution highlighting?
If the above does not help you resolve the problem, you may want to start a new thread. This thread was already marked as "Solved" so fewer people are likely to read it.
03-11-2012 02:30 PM
Both array are used for sinusoidal position data to send from host vi. I use time delay (1 ms) to make certain frequency and sample size for PID loop(I adjust sample size for 1000 for 1 hz 500 for 2 hz).Each loop control to position of servo system with PID. So I use two VI in my host side and I send two different sinus data with array. I tested with one timed loop it works vey well. But When I try it two time loop it dosent work. Thank you ı will make a new thread