LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get max sample rate on cRIO using different modules.

Solved!
Go to solution

Hi everyone,

 

I'm currently developing a lv project which involves acquiring data from multiple modules (NI-9253, NI-9213) using a cRIO-9075.

I´ve used a consumer-producer approach, where the cRIO only acquires and transmits the data read through shared variables (RT-Fifo enabled).

And the Pc reads those shared variables, displays the data and then proceeds to store it.

I am using the scan engine with scan period of 5ms and network publishing period of 10ms.

 

The problem i am having is that i am getting sampling rates of about 40 S/s, where for example the NI9213's maximum sampling rate is 75 S/s. For my application i need to be getting above 1000S/s with the NI-9253 and 75 S/s from the NI9213.

 

I understand for this i need two parallel loops to acquire data at different sampling rates on de cRIO, then transmit that data through a shared variable to the PC which will handle it. I've read people recommend using queues rather than shared variables, but i don't know how to do that between Vi's which are running on different targets without using shared variables.

I leave attached the parts of both VI's which are in charge of that functions. Any suggestion, comment, correction, is more than welcome.

 

Thanks for your time.

Download All
0 Kudos
Message 1 of 6
(2,577 Views)

Hi S.,

 


@S.Hansen wrote:

For my application i need to be getting above 1000S/s with the NI-9253 and 75 S/s from the NI9213.


In this case I recommend to change from ScanEngine to FPGA programming. This will allow those sample rates for sure! (Your cRio is rather old and it's ScanEngine is quite limited!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,555 Views)

Hi,

Sorry for the late reply, but i just realized i made a mistake on the description. I actually have the cRIO-9057 not the 9075.

I don´t know if this changes the answer you gave me.

PS: It would be great if it did as i´ve never programed the fpga before, and im kind of lost of the changes to be made to the code.

 

Thanks for the answer!

0 Kudos
Message 3 of 6
(2,495 Views)

For the 9057 you can also use DAQmx instead of FPGA mode, if that is more to your liking. (see here: Using CompactRIO with the NI-DAQmx API)

 

0 Kudos
Message 4 of 6
(2,449 Views)

That is what i am currently using, as in the example i posted. The only difference with the link you sent me is that i am acquiring single points of data instead of a waveform. 

 

I tried splitting the acquisition into two loops, one for the temperature module, which has a lower sampling rate, and another for the current input module. 

But now I'm getting the following error on the second loop (current one):

Error -200714 occurred at RT-new.vi Possible reason(s): Acquisition has stopped because the driver could not transfer the data from the device to the computer memory fast enough. This was caused by computer system limitations. Reduce your sample clock rate, the number of channels in the task, or the number of programs your computer is executing concurrently.

 

The thing is, i need 1000 S/s on that module as a program requirement, plus this system is supposed to be able to handle much higher sampling rates.

I attached screenshots of the real time target´s program as of now.
 

Download All
0 Kudos
Message 5 of 6
(2,433 Views)
Solution
Accepted by S.Hansen

Hi S.,

 


@S.Hansen wrote:

The only difference with the link you sent me is that i am acquiring single points of data instead of a waveform.


I recommend to read waveforms/arrays of samples instead of single points!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,413 Views)