LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Rate Question Using cRIO-9101 Chassis

Hello I have a question using cRIO hardware. I am using the cRIO-9012 processor attached to the 9101 chassis. This is all connected to a TPC-2512 touch screen computer. My question is about using the scan engine and or FPGA. I was required for my project to collect 16 Analog inputs and 6 Digital rate inputs using a sample rate of 100 samples a second. The requirement has been rased to 500 samples a second. When I aquiring the data (I have not reached 500 sam/sec yet) at 250 samples a second I am seeing the data value repeat many times before it changes. I am using a scan engine trick to do this. I am unsure if it is a limitation using this was or if I should use all FPGA but the values do not seem to be publishing to the network fast enough for me to aquire them. Any help will be usefull.

 

Adam

0 Kudos
Message 1 of 12
(3,690 Views)

Hey Adam,

 

I would recommend acquiring your data via the FPGA.  In scan mode a rough estimate of the fastest you can sample is about KHz.  With 16 AI channels at a sample rate of 500 samples/sec you are exceeding that limit.  The 1 kHz is just a guarantee and most likely (like you have shown), you can do better than KHz.  However, the high rate you are trying to achieve will just not be possible in scan mode.  Utilizing the FPGA you would not have a problem with that rate.  However, in order to use the FPGA on the cRIO you have to have the LabVIEW FPGA Module.  Do you have this software?  I hope this helps!

 

-Cody C

0 Kudos
Message 2 of 12
(3,670 Views)
I do have the FPGA module so I can easily do that. Can I acquire the data that fast using the Host VI or do I have to do it in the actual FPGA and save it to memory. My experience accessing the FPGA from the Host seemed slower but I may have been doing something wrong.
0 Kudos
Message 3 of 12
(3,665 Views)

Good Afternoon,

 

You actually need to pass the data through to the Real-Time controller, and then from there you can pass it to the host.  The memory on the FPGA is extremely small and you would fill that up very fast if you tried to save it to the memory on the FPGA.  I would therefore suggest passing the data from the FPGA to the Real-Time controller on the cRIO using DMA FIFOs.  Take a look at this document which will explain how to go about doing this.  Hope this helps!

 

-Cody C 

0 Kudos
Message 4 of 12
(3,651 Views)

This is actually what I tried but I get an array of 0's instead of my data. Also I don't think I can use Real-Time with the touch screen computer I am using as my host unless I am missing something. I have the data from my analog input card one going directly to the DMA FIFO then when I try to read the DMA FIFO on the host all I see are 0's

0 Kudos
Message 5 of 12
(3,647 Views)

I'm trying to pass Fixed Point data straight through the DMA and I have it configured to pass fixed point data but it still only returns an array of 0's.

0 Kudos
Message 6 of 12
(3,633 Views)

Hey Adam,

 

I believe that you are going to have to pass data to the Real-Time controller.  The VI you develop on the Real-Time controller will not run on the touch screen computer, but deploys directly to the controller.  The data can then be passed back to the touch screen computer via shared variables (or other methods) over Ethernet connection.  How were you passing your data from the Real-Time controller to Host Computer when you initially tried it?

 

-Cody C

0 Kudos
Message 7 of 12
(3,626 Views)
I initially was using the scan engine but the values wernt being published quick enough but I think I have figured it out. Even though the fifo was configured to use fixed point numbers it still would not work to I changed them to use u32 and convert them back to fixed point data. After I did that it let me send data directly to the host vi. I still have to impliment storing the data but I can at least see it now. I just need to separate each channel and compare them to thresholds now. If thresholds are crossed store all 16 analog imputs as fast as possible.
0 Kudos
Message 8 of 12
(3,623 Views)

 

I am having another problem that is most likely easily solved but I am over thinking it. I am reading in the data from 1 module and putting all 8 AI channels into an array and sending them over the fifo. On my personal computer it is fast enough to read in 8 elements at a time and separate each one. However on the touch screen the processor and memory isn't quick enough to keep up so I must increase number of elements I read in at a time to avoid and overflow. For some reason I can't think of a way to separate the data into multiple arrays of 8 and look at every single value and compare it to a given threshold.

0 Kudos
Message 9 of 12
(3,601 Views)

If you take a look at the DMA FIFO tutorial that Cody linked to you above, scroll down to the bottom and you'll see that they are using a 1D Decimate Array VI to separate the data from the FIFO in the Host VI into 4 separate arrays.  It sounds like to me that this is what you're trying to do in reading from the FIFO and separating each of the 8 channels.

Regards,
Austin S.

National Instruments
Academic Field Engineer
0 Kudos
Message 10 of 12
(3,587 Views)