LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using "Write to Measurement File" to write new files each time?

I apologize in advance because I know this question has been asked many times (and I'm pretty new to Labview; I did search though).  I'm trying to build a data acquisition VI and I'd like to be able to stop/start recording from multiple channels independently of one another.

 

I just started with 2 channels merged into a single signal (to simulate a single data set that I'd want to record), and then used "write to file" within a case structure with a boolean controlling it.  Write to file exists in the true case, and the false case is left empty.  When I switch the boolean control on and off, write to file does not prompt me for a new file name each time (it appends instead).  Only when I stop and restart the entire VI am I able to change the file name. I tried changing write to file from an Express VI to a standard VI (issue 179472), and while that helped, I still wasn't able to get the control I wanted.

 

Attached are JPGs of my block diagram and front panel

 

Thanks in advance!

Download All
0 Kudos
Message 1 of 5
(3,139 Views)

Hi Fenixgoon,

  I had attached the vi.Please revert back to me if any further clarifications.

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 5
(3,110 Views)

I think it would be better if you used write to spread sheet.vi

 

Here is an example:

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 3 of 5
(3,099 Views)
Hey thanks a ton for the replies!  Solved my problem perfectly 🙂  Would you mind explaining what the shift registers and additional case structure do?  Thanks again!
0 Kudos
Message 4 of 5
(3,014 Views)

Hello,

 

You can think of the shift registers almost as local variables. They are used to store information from the previous iteration of the loop to the current iteration. In the example that srikrishnaNF posted, he has basicalyl implemented a state machine architecture to control the different options. Once the file path it set, it is saved for the next loop iterations within a shift register until it is updated with a new path. The first case structure determine whether you want to write to a file or not. The second case structure determine whether the user needs to be prompted for a new file path, or whether it is still writing to the same file. This is indicated by looking at the true and 1 case. Here, the user wants to write to a file and the file path has been selected in the true and 0 case. In the true and 0 case, the user has selected a file, the 0 has been changed to a 1, and you then enter the true and 1 case. In this case, the value is kept at 1 meaning that the user will not be prompted for a new file path as long as the write to file button remains true. Once the write to file button switched, you will enter the false case. This case resets the 1 to a 0 and will cause the user to enter the true and 0 case when the write to file button is clicked again.

 

-Zach

0 Kudos
Message 5 of 5
(2,992 Views)