Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRIO generate/acquire by samples

Hello,

 

I have problem with using MyRIO. I want to acquire package of lest say 10000 samples from aquisition loop and then pass that data to next loop to analyse that data.

But with using myrio functions I can only acquire/generate one sample.  Do I need to create for loop inside my while loop to acquire 100 samples? Or there is more elegant way like in Daq-mx??

 

I need to generate signal on analog out, acquire something from analog in and then calculate correlation and delay between these 2 signals. With Daq-mx it was easy. With MyRIO I am not so sure.

 

Thanks for clearing that for me 🙂

0 Kudos
Message 1 of 5
(7,181 Views)

Dear @pawhan11

 

May I ask you to share your code here, so I can see where you got stuck?

 

Thank you!

Best Regards,
TK
Certified LabVIEW Architect (CLA)

0 Kudos
Message 2 of 5
(7,161 Views)

Hey pawahan11,

 

As you mentioned myRIO currently only supports 'single point' analog IO.  This means that each time the AI VI or Express VI executes it acquires a single point of data.  If you want to collect chunks of 10,000 samples and then process the set you'll probably want to use a producer consumer architecture.  There is some good info on producer consumer archiectures here.

 

The basic idea is that you'll have 2 loops.  The producer loop produces data that will be processed by the consuer loop.  In your example your producer loop will run and gather data points which will be buffered up until you get 10,000 or them.  At that point the data will be processed by the consumer loop while the producer loop starts collecting a new data set (if necissary).

 

You can use RT FIFOs to pipe data between the two loops and buffer up the 10,000 samples.

 

 

Let us know if you have questions about this.

 

Thanks!

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

 

 

0 Kudos
Message 3 of 5
(7,150 Views)

I have  a similar issue.

 

I want to aquire a variety of sensors at diferent rates and log them to a tdms file. Currently I have a different loop for each sensor and tdms write in each loop. I am using a loop timmer and a time stamp to log the elapsed time, but this creates a seperate time channel for each tdms group.

 

Currently I have:

4 thermocouples reading from an SPI module at 5Hz

2 pressure inputs using a simple analog in at 10hz

16 IR temp sensors using I2C at 20Hz

GPS sensor logging as fast as it can spit out data

accelerometer at 100Hz

 

What kind of archetecture will allow me to log data at different rates cleanly on a myRIO. Would I need a multiple produce, single consumer system?

 

0 Kudos
Message 4 of 5
(6,519 Views)

I'm not very clear about your user scenario, are you logging data to a seperate TDMS group for each sensor? Since these sensors are of different rates, according to my understanding, they do need a seperate time channel to describe the logged data.

0 Kudos
Message 5 of 5
(6,492 Views)