LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

limitations with cRIO in Scan Mode

Solved!
Go to solution

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 1msThe possibility exists to be a limitation of the Scan Mode?

 

Thank you!

0 Kudos
Message 1 of 9
(4,385 Views)
Solution
Accepted by topic author fpalma

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.

0 Kudos
Message 2 of 9
(4,380 Views)

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!

0 Kudos
Message 3 of 9
(4,369 Views)

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.

Message 4 of 9
(4,346 Views)
Yes I found it now! I'm sorry, I just opening the configuration screen of a loop outside the cRIO ... I'll try and say the result later!
 
Thank you!
0 Kudos
Message 5 of 9
(4,337 Views)

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!

0 Kudos
Message 6 of 9
(4,316 Views)

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)

0 Kudos
Message 7 of 9
(4,291 Views)

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.

0 Kudos
Message 8 of 9
(4,278 Views)

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

 

0 Kudos
Message 9 of 9
(4,273 Views)