LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Troubleshooting for sending data for 16 sensors to an excel spreadsheet using file io

Solved!
Go to solution

Hello everyone. I'm trying to take data from 16 sensors using multiple analog inputs. The device i'm using is a USB-6210 daq module and so far I must've over complicated the program cause it doesn't seem to work when I run it. I read that you can add multiple channels to a Daq Assistant and use just this one Daq Assistant for all of the sensors and use a seperate signals function, but I'm not sure how to write the code that can be used for the task of trying to send the data from all 16 of the sensors to one excel spreadsheet file. If anyone can help by sending me an attached file on how to properly do this that would be great. I'll put the attactched file down below from what I tried to do.

 

Thank you everyone for your help.

 

0 Kudos
Message 1 of 9
(2,947 Views)
Take the output of your DAQ Assistant and wire it to a Write to Measurement File. Done. No separate function.
0 Kudos
Message 2 of 9
(2,940 Views)

Thank you so much for your help Smiley Happy So I pretty much take my Daq Assistant, wire it to my Formula function, then wire that to my Write to Measurement file so that my sensors data can be readable? How would it know whether or not to get output voltage or chlorophyll data?

0 Kudos
Message 3 of 9
(2,930 Views)
I don't know what the formula function does. You asked about recording the sensors and what I said will record the raw data.
0 Kudos
Message 4 of 9
(2,916 Views)

Oh okay. Thank you very much for your help.

0 Kudos
Message 5 of 9
(2,910 Views)
If the formula does your scaling, I would suggest you create the scales in the DAQ Assistant. You can also assign meaningful names to each channel on there.
0 Kudos
Message 6 of 9
(2,908 Views)

Okay I can try that and see if it'll work.

0 Kudos
Message 7 of 9
(2,896 Views)
Solution
Accepted by topic author EETG9000

Start by telling yourself "Never use the DAQ Assistant!".  Instead, read this excellent overview of NI-DAQmx that tells you how to do almost everything you need quickly and easily.  What I suspect you want to do is at each time point, sample all 16 channels and get them as an array of I16 numbers (or, if you have scales defined, as 16 Dbls in the units you define).  You can "wrap" your single DAQ Read function inside a While or For loop to get N samples (say, until you push Stop), then take the (now 2D) array of N points from 16 channels and write that to Excel.

 

First, get the data in "better shape" using DAQmx.  Have you tried opening MAX and getting the data using the Test Panels?  Can you see how MAX can sample all 16 channels at once, at whatever rate you specify, continuously?  You can use MAX to define scales, and if you make a Task in MAX, you can (when you configure your DAQ VIs) pull down that already-defined-and-configured Task and thereby have almost all of the configuration done for you by MAX (well, not really done for you, but done by you when you made and saved the Task).

 

Bob Schor

 

P.S. -- Those Front Panel indicators are a little gaudy, aren't they?  But very pretty ...

0 Kudos
Message 8 of 9
(2,885 Views)

Thank you for you're help this should really help. I'll try it out tomorrow Smiley Happy and its been awhile since I've used NI-DAQmx  so I'll consider trying it out. And yeah it was an early prototype and was considering changing things up in the end haha.

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