12-18-2014 01:18 PM
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.
Solved! Go to Solution.
12-18-2014 01:34 PM
12-18-2014 02:32 PM - edited 12-18-2014 02:39 PM
Thank you so much for your help 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?
12-18-2014 02:50 PM
12-18-2014 03:07 PM
Oh okay. Thank you very much for your help.
12-18-2014 03:11 PM
12-18-2014 03:43 PM
Okay I can try that and see if it'll work.
12-18-2014 04:18 PM
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 ...
12-18-2014 05:32 PM - edited 12-18-2014 05:39 PM
Thank you for you're help this should really help. I'll try it out tomorrow 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.