LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring temperature and flow with USB 6009

Hi,

 

As a part of a project I need to make a LabView program that takes the measurements from two channels; a pressure sensor, and from a thermocouple, using a DAQ USB 6009.. and writes this out in two graphs; temperature in celsius, per time, and flow per time. I also need to store all the measurements to a file. And the time should be down to at least seconds, if not even more accurate.

 

The main problem for me is to understand how I get to divide the signals, and then to graph them. Even how to derive the time, as the USB 6009 does not have an internal clock?

 

I am also really new to LabView, and would appreciate as much help as possible:)

 

Thanks, Ingrid

0 Kudos
Message 1 of 14
(4,258 Views)

Would suggest you to post your data acquisition code so that we can see what you have done. Then, we can help you with modifications and improvements to achieve what you need.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 2 of 14
(4,255 Views)

Thanks for responding;)

 

The thing is, I am still waiting on my co-student to do the other part; So I am basically doing this as a preproject without any parameters..

 

I know we are using the NI USB 6009, with a thermocouple, and a pressure sensor. I am also using the Daq MX base for mac.

I need to know how to derive the time; using a mx base sample clock? And how to split the signals; so I get the time on the x-axis on two graphs, and the temperature (C) as y-axis on one of them, and the flow in the other graph:

Can I use split signals and then get waveform-components?

 

0 Kudos
Message 3 of 14
(4,250 Views)

The acquisition with a 6009 is hardware timed and the dt is returned as part of the waveform you capture. You should be getting a 1D array of a waveform data type. You only need to use the index array function to get each signal and yes, the get waveform components function will return the dt.

0 Kudos
Message 4 of 14
(4,239 Views)

Hey; that is helpful, although not possible in my case, as I am using Mx base, and the read VI does not output waveform, so it seems like using "get waveform" is not an option, and so; is there any options? Can I replace it by an array maybe?

 

Cheers, Ingrid


 

0 Kudos
Message 5 of 14
(4,221 Views)

Ingrid,

 

You can use the arrays you get from the read VI and build them into waveforms using the Build Waveform primitive.  The reciprocal of the sample rate is dt.

 

Or just feed the arrays to the graphs and use property nodes to scale the x-axis according to your dt.  Graphs were used with arrays this way many years before the waveform datatype was introduced.

 

Lynn

0 Kudos
Message 6 of 14
(4,217 Views)

Thanks:) I sorted that out! 

So now I think I´ve done something right to at least get one of the channels graphed, the thing is I am using two channels and want to divide the channels, and get two graphs; one showing the temperature per time from a thermocouple, and the other graph should show the flow per time taking measurements from a pressure sensor.

 

Attaching the program, and the subVI, 

 

In the subVI I´ve included a formula node, and filters for no purpose now, as I don´t have any idea what the equation is going to look like yet, and what frequencies I will work with..

 

In advance: thanks!!

Download All
0 Kudos
Message 7 of 14
(4,212 Views)

Ingrid,

 

I am not sure what you are asking now.  Do you want to know how to separate the array of waveforms for display on two different charts?  If so, use the Index Waveform Array VI from the Waveform palette.

 

The Create Channel VI has a required input missing.  Something must be connected to the Physical Channels input.

 

Lynn

0 Kudos
Message 8 of 14
(4,196 Views)

What I mean is that I want to get the measuements from two different channels, and then when reading, and writing out these measurements in my program, I want to be able to get the measurements from the two channels in different charts, and be able to identify the two different signals seperately somehow.

 

So when I use the mx base read VI I suppose it reads the signals from all the channels I am using? And also the time information is now read, right? 

I now whish to divide the signals that has been inputted, and write the measurements out in two seperate charts, (both charts having the time-info as the x-axis) 

I later want to write all the data to one file.

 

I am now using split signals as a solution, is this going to work?

 

Regards, Ingrid

0 Kudos
Message 9 of 14
(4,184 Views)

Ingrid,

 

Conversion to Dynamic Data Type then back to arrays then to waveforms is way too much work!

 

Index Array will automatically expand to the number of dimensions in the array.  Each row is a different channel.  The samples are in consecutive columns.  The 1D array of samples for one channel can be fed directly to the waveform chart for that channel.  You can set the x-axis scale once, outside the loop, with a property node.

 

The Array to Spreadsheet String function will convert an array of numbers to text in a format which can be written to the file.  The Byte Array to String function will not give you the kind of results you probably want when fed an array of double precision floating point numbers.

 

Connect a string indicator to the text input to the Write to Text File function to see what you will be getting.  You use line feed one place and End of Line another.  They might be the same on your platform or maybe not.  Also you have Tabs after the line feed or End of Line.  Typical text file data formatting has tabs separating data elements for each row and end of line between rows.

 

You want the file refnum to be passed via a shift register.  You were started in that direction but did not quite get there.

 

I do not have any compatible DAQ devices so I cannot run your VI.  I have not tested my modifications.  Most likely the string formatting is not quite right.

 

Lynn

0 Kudos
Message 10 of 14
(4,165 Views)