LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature input

Hello,

I have a VI which takes input from various sources, and writes it to a file.  I have the file include data in its comments section as the data is of the form "header data, header data, sample data", and this is a natural input.  The problem I am having is that some of the data I am trying to input, specifically the temperature, is from a gauge that runs in the background, and when I wire it to the comments, the VI does not execute (in a non-fatal error).  It doesn't even get to the sequence structure.  I think the problem is that the program does not know how to get a single value from a dataset running continuously in the background.

I have attached the VI.  Specifically, what I am trying to do is wire the bolometer temperature double into the comments of the Write to File VI.  Every time I do this (with proper concatenation and conversion to string, of course), The VI does not run.

Any help would be greatly appreciated.

-Mike
0 Kudos
Message 1 of 2
(2,606 Views)
You may have read some place that LabVIEW is a dataflow language. Let me explain what that means. A section of code (function, structure, whatever) will not execute until the data inputs required are available. With a while loop, if you wire from inside the loop to something outside, the data outside will not be available until the while loop finishes. That means that when you wired the data to the sequence structure, the sequence structure will wait until you click the 'stop 2' button in your VI. There are many ways to avoid this in your case but the easiest may be to simply put a local variable of the temperature indicator inside your sequence structure.
 
I question what you are doing with the case statement inside your while loop. First, it's never a good idea to hide code inside by making the structure smaller. Second, it would seem that you are parsing comma separated data with a whole lot of unneccessary code. If it truly is comma separated, you can do everything with the Spreadsheet String to Array and an Index Array function. You can specify a comma as a separator for Spreadsheet to Array and it will convert it to an array of DBLs. Use index array to get the element(s) you want.
0 Kudos
Message 2 of 2
(2,586 Views)