取消
显示结果 
搜索替代 
您的意思是: 

Thermocouple logging code

已解决!
转到解答

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 项奖励
1 条消息(共 15 条)
5,685 次查看

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

2 条消息(共 15 条)
5,663 次查看

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
3 条消息(共 15 条)
5,621 次查看

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 项奖励
4 条消息(共 15 条)
5,602 次查看

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
5 条消息(共 15 条)
5,598 次查看

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
6 条消息(共 15 条)
5,596 次查看

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
7 条消息(共 15 条)
5,593 次查看
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 项奖励
8 条消息(共 15 条)
5,545 次查看

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
9 条消息(共 15 条)
5,514 次查看

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 项奖励
10 条消息(共 15 条)
5,495 次查看