LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple channels using DAQ

Hey guys,

 

I am new to labview, and I am writing code for my Data logger. I have been following this tutorial https://www.youtube.com/watch?v=fIy6XT3CdPQ. I feel like I could do something different right around the 13 30 mark. This is pretty much exactly what I need to do but I need to write to 16 channels, and  I need to display the temperature at each iteration in the while loop. Using 16 channels get messy real quick, See attached picture. Is there a cleaner way to do this? 

 

I think the biggest problem is the graph because if i didnt have that I could just display the current temperature using an array, and I could write each iteration array to a 2d array outside the loop, right?

 

0 Kudos
Message 1 of 2
(2,123 Views)

Here's a suggestion -- rather than watching random You-Tube Videos, spend a little bit of time with the LabVIEW Tutorials shown at the beginning of this Forum to get the general idea of what LabVIEW is, and how it works.  When you are ready to collect data, you should learn a bit about DAQmx, for which there are also excellent White Papers and Tutorials from NI.

 

Now, as to your specific problem.  What, precisely, are you trying to do?  It sounds like you want to record from 16 channels (of what?  with what?  At what rate?  for how long?) and display the data (ah, I see "temperature" in your question).

 

Sometimes it's not a bad idea to write some code that simulates what you are trying to do.  For example, suppose I wanted to record 16 channels of data at 1 Hz and plot it, but I didn't have the hardware.  What would I do?  Well, I'd start with a While Loop with a Stop Control, and inside I'd put a For Loop with 16 wired to N (for my 16 channels).  Floating around in the While I'd put a Wait(ms) with 1000 wired to it to make the While Loop run once/second.  To generate my 16 channels of data, I'd use the index value "i" as my data (so I'd get 0, 1, 2, 3, ...) and to make it more realistic, I'd add 0.1 * Random number to add some "noise".  If I bring this out though an indexing tunnel (so I have an array of 16 floats), all I have to do is plot it and admire my work.

 

What do you know about plots?  Do you know the difference between a Graph and a Chart?  Do you know that when looking at "data as it comes in", Charts are much preferred?

 

Once you have your simple simulation working, it shouldn't be difficult to take out the "Simulated Data-producing Device" and put in some DAQmx code that produces data for you.  Note that for many data acquisition situations, you are not sampling at such slow levels, and when you start sampling faster, you almost never take one point at a time, but may a sample of 100 (or 1000) at a time.  Of course, when the data come in very rapidly, it might not make sense to try to "look at every point" ...

 

Bob Schor

0 Kudos
Message 2 of 2
(2,090 Views)