LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of a file handeling VI

Hello,

I'm trying to create a simple subVI that handles the opening and closing of a file as well as writing data (both starting and stopping the data) This VI is supposed to be run whenever new
data is available. The external input is a waveform array which gets periodically added to by the parent VI. Have four buttons for this sub vi: open, close, start data capture, abort data capture. I would like to be able to open a file, then return to the parent vi so it can capture data in it's look, then if the capture data button is hit I would like to capture data.. etc. Should be very simple to do. But I don't know how to store the refnum of the file in the VI. How is this done so that the next time the VI is called the st
atic var can be used?
0 Kudos
Message 1 of 2
(2,454 Views)
You can "remember" that reference in a shiftregister. To have shiftregister you need either a while or a for loop.
So Add a while to your diagram (with all code inside) and store the result of the open in the shiftregister. In the close store a NIL in the shiftregister.
In the other cases simply connect the input and output of the shift register.
Be carefull not to initialize the shiftregister !
greetings from the Netherlands
0 Kudos
Message 2 of 2
(2,454 Views)