LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2-channel simultaneous sampling on cRIO-9233

Hi,
I need help with simultaneous sampling on the USB 9233. I am reading acceleration data from two channels having different accelerometers (that is the min value, max value and sensitivity settings are different for both).
 
Until now, I was acquiring data from one channel. I have used DAQmx create virtual channel, timing, start task, and read VIs to accomplish acquisition. My settings are shown in attached image.
 
The acquisition is triggered against a digital pulse, which is why I need to keep the 'Relative to' setting at 'Most Recent Sample'.
 
Now, with two channels:
 
1) Do I need to use two separate create virtual channel VIs because the sensors are different?
 
2) If answer to (1) is yes, I guess that means I have created two tasks, right? Then, how do I ensure that when I fire my two Read VI, I will get the simultaneous sampled data points from the buffer?
 
3) Ideally, I would have liked to flatten my two tasks into one thread after the Create Virtual Channel VI and thereafter use only single instance of Timing, Start, and Read VIs. Can I do that or something similar?
 
Hardware: NI cRIO-9233
Software: LV-FDS 7.1, DAQmx 8.0, Win 2000 Pro
 
Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 8
(3,689 Views)
Hi Gurdas,
there is now attachment. Smiley Happy
 
If both sensors are analog inputs, then you can use only one task, but you can call the create virtual channel vi as often as you need it. So if you have two sensors with for example different voltages you can use it two times.
 
Mike
Message 2 of 8
(3,688 Views)
Oops, sorry! Here is the attachment.

Message Edited by Gurdas on 05-28-2008 07:53 AM
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 8
(3,684 Views)

Hi Gurdas,

which is the second input? DEV3/ai2? If yes you can use only one task.

Mike



Message Edited by MikeS81 on 05-28-2008 02:51 PM
0 Kudos
Message 4 of 8
(3,680 Views)
Mike,
 
Thanks! Do you mean to say I daisy chain my Create Virtual Channel VIs passing the task from first to second and then from the second to the Timing VI?
 
Like attached .... ?
 
That is simple... now why did I not think of that  ?  🙂
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 5 of 8
(3,675 Views)

Hi Gurdas,

yes you can do it, but if both have the same ranges you can also do it like this.

Mike



Message Edited by MikeS81 on 05-28-2008 03:07 PM
Message 6 of 8
(3,672 Views)
Mike,
 
Thanks a bunch! That answers my query. Since I have different ranges, I will use the daisy chain scheme.
 
Some wishful thinking: Is there a way to pass an array for each parameter of the Create Virtual Channel VI ? So, if I am acquiring three channels (dev3/a11:3), I input an array with three elements for each parameter and the VI auto indexes my array to the channel array index...
 
For my two channel function using two Create Channel VIs is OK. But what if someone is working with 24 or 180 channels and each of them has subtle differences in ranges?
 
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 7 of 8
(3,667 Views)

Hi Gurdas,

of course you can use it in a loop. See the attached picture.

Mike



Message Edited by MikeS81 on 05-28-2008 03:21 PM
Message 8 of 8
(3,664 Views)