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
已解决! 转到解答。
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
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.
Does this look close to what both of you are talking about?
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.
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.

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:
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.
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.