LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire data from two accelerometers using the USB 6210

I am currently using the USB 6210 to acqurie data from two accelerometers. I have no issue in gathering data from one accelerometer but cannot use labview to acquire it from both simultaneously. I have attached the Front Panel and Block Diagram pictures that I am currently using. Keep in mind that the attachments seen is for one of the input signals, not both. For the one input signal I am using a peak detector to detect whenever the accelerometer basically accelerates above 2.5 V. Then taking the peaks and converting it to acceleration, using the acceleration through an appended array to output the data during the testing. Thanks!

0 Kudos
Message 1 of 9
(3,128 Views)

Hi,

 

Presuming that you have no problem reading from one accelerometer, have you looked into these link?: 

 

How Do I Select More Than One NI-DAQmx Channel in LabVIEW?

http://digital.ni.com/public.nsf/allkb/A3A05920BF915F1486256D210069BE49

 

 

Regards,

Lennard.C

 

Learning new things everyday...
0 Kudos
Message 2 of 9
(3,100 Views)

Well I've atttached a snippet of the configuration I use to read two different Linear encoders from the same 6210. In your example however you don't perform any set-up of the capture before capturing, has this not had an affect on the results from your measurements?

Also, is there any reason for the feedback node before your appended array? Its hard to tell from looking just as the image but it doesn't seem to have any real purpose.

 

Doing the tutorials should provide a pretty good understanding of what is going on wuth multiple channels and the sample capture.

DAQ multi-channel.png

0 Kudos
Message 3 of 9
(3,090 Views)

For what it's worth, you can select multiple physical channels for a DAQmx task (as described in the previous posts's link) so the second Create Task node isn't necessary.

 

One thing they don't make clear is that in the Browse dialog, you can select non consecutive channels by holding CTRL and clicking channels, as you would with any Windows selection:

 

browse-chans.png

 

 

---
CLA
0 Kudos
Message 4 of 9
(3,074 Views)

Thats interesting to know, does that mean that you should be able to pass an array of inputs into the create task and it should act the same? I'm just trying to figure out if there is a way to set VI up so that you can pass two channels into the same task create programmatically, and if you can Ctrl select then surely there must be a way through code to pass more then one channel to a single task create.

0 Kudos
Message 5 of 9
(3,046 Views)

Hey OGK.nz,

 

Im not quite sure what you mean by setting up the capture before capturing. The set up that I have used have the intention to click the run button in the front panel and to run multiple test, then to look back at the data through the indicator. I have been struggling to output the data in a live feed. Ultimately I want the all the data of each peak to output to a table as the experiment is occuring. The reason I used the peak detector was to ensure that whenever the accelerometer accelerated at all it would output the "peak".  If you could assist me in explaining your set up I would greatly appreciate it. 

 

Thanks,

 

Thanasi

0 Kudos
Message 6 of 9
(3,028 Views)

Have a look at the new Snippet, it should give you a better idea of what to do to properly set up the multi channel, also take a look at the Voltage-Continuous Input.vi example in the NI example finder. You should be able to apply the concept from my snippet to it and then be able to adapt it to do what you want.

 

DAQ multi-channel.png

Message 7 of 9
(3,018 Views)

@ogk.nz wrote:

Thats interesting to know, does that mean that you should be able to pass an array of inputs into the create task and it should act the same? I'm just trying to figure out if there is a way to set VI up so that you can pass two channels into the same task create programmatically, and if you can Ctrl select then surely there must be a way through code to pass more then one channel to a single task create.


Indeed.

 

Firstly, you can wire a flat string to the Create Virtual Channel VI's physical channels input. You can programmatically build up whatever string you like. You could create a range of inputs:

 

Dev4/ai0: Dev4/ai3 [edit, fixed smiley from automatically appearing]

 

or:

 

Dev4/ai0:3

 

or

 

Dev4/ai0,Dev4/ai1,Dev4/ai2,Dev4/ai3

 

You could also create an array of channel strings (eg [Dev4/ai0, Dev4/ai1, Dev4/ai2, Dev4/ai3] ) and use Array to Spreadsheet String to create a single, comma delimited array and then wire that in. You could also use DAQmx Flatten Channel String, which does the same thing as far as I'm aware.

 

You can probably also Type Cast a string of channel names to a physical constant, but I haven't ever used that.

 

Of course, you can do the same thing with physical channel constants and controls (as posted previously) and it'll give the same result. One reason you might want not want to do this is that your DAQ may be enumerated with different device names/numbers on different systems, so rather than having physical channels specified in a hardwired constant, you may choose to have them loaded from an entry in an INI file.

---
CLA
Message 8 of 9
(2,997 Views)

Helpful, thanks.

0 Kudos
Message 9 of 9
(2,958 Views)