LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Thermocouple logging code

Solved!
Go to solution

Hello. I have been trying to write some code to get temperatures through thermocouples with a USB-TC. The temperature output is a 1D array. I am trying to make a 2-D array. Time and Temperature and then put them in a graph. The hard part is, I want to be able to pick which thermocouples are in use and show up on a graph/chart. The graph needs to update with each reading. I am thinking a queing system will work but am not sure. Does the picture look like I am on the right track? Any help would be well appreciated.

Thanks

0 Kudos
Message 1 of 15
(4,464 Views)

I assume the board number is 0, the low channel is 0 and the high channel is 7.  If it is the case, you obtain an array of 8 doubles (8 temperatures) and one value for the time.  The two arrays will not have the same lenght.  Try something like this.

 

Jean-Marc

 

USB-TC.jpg

Message 2 of 15
(4,442 Views)

Just a comment on J-M's code.

It is correct and functional, however there is a slightly easier way to do it.

Since the data collected will be at a regular interval (in his case 10 / second) you do not need an XY graph.

You can use a waveform chart, and just format the X-Axis to 'Absolute Time'.

 

Then, you also do not to build an array, because a Chart has a built in history.

Cory K
Message 3 of 15
(4,400 Views)

Does this look close to what both of you are talking about?

 

 

 

Architecture.jpg

Message Edited by nicholas03 on 09-21-2009 09:41 PM
0 Kudos
Message 4 of 15
(4,381 Views)

Hmm, not quite.

On your x-axis, you will have time.

But on your y-axis, you will have 2 plots:

1) Time

2) Temperature

 

You only need the second one.

 

Also, you do not need the For loop.

By doing that, you are building an array with only 1 element in it every iteration.


Just remove the For loop, cluster elements, and time stamp.

Cory K
Message 5 of 15
(4,377 Views)

Well, the -1 going into your For Loop N node means the For Loop will never run.

 

Just eliminate the For loop completely.

 

You don't need the time functions and certainly don't bundle them with the data into waveform chart.

 

Just take your Array of data, convert it to a cluster (set the size on that function to however many channels you have) and wire it to the waveform chart.

Message Edited by Ravens Fan on 09-21-2009 10:51 PM
Message 6 of 15
(4,375 Views)

I dont have the TIn function, so just pretend that this numeric control is your TIn.

You can just wire it straight to the chart, since the chart has a history.

 

TIn.png

 

 Then right click the graph and go to Formatting.

Change the x-axis to Absolute Time.

 

Absolute Time.png

Cory K
Message 7 of 15
(4,372 Views)
Is there a way to read the temp vs. time data? I want to find out at what time does the temp reach 100.
0 Kudos
Message 8 of 15
(4,324 Views)

Do you want to find the first time it passes 100? Or all points above 100 degrees?

 

If you want the former of the two:

100.png

If your Time array and Temperature array are the same size, just run through your temperature array until it passes 100 degrees.

When it does, stop looping, and index the time at that same index.

Cory K
Message 9 of 15
(4,293 Views)

The picture is without the hardware plugged in so all the values are 0. Nevertheless, I am unable to read, in an array, the time at which temps are taken.

 

Architecture.jpg

Message Edited by nicholas03 on 09-25-2009 03:30 PM
Message Edited by nicholas03 on 09-25-2009 03:31 PM
0 Kudos
Message 10 of 15
(4,274 Views)