11-02-2007 10:30 AM
11-02-2007 11:18 AM
Without knowing all of the details of your app, I see two issues that don't match up with what you mentioned you are trying to do.
1) The Open Waveform VI is set to "Create New Always", so at each iteration of your while loop, the old HWS file is being destroyed and a new one is getting created in it's place. If you are intending to append data to an HWS file, you must use the "Read/Write" permissions only.
2) Your inner for loop has a Create New Waveform VI inside of it. So what is happeing is that each iteration of your for loop is creating a new waveform inside of your HWS file rather than appending to the already existing one. HWS files can save multiple waveforms into one HWS file. I see you are naming each waveform, so I'm guessing this was intentional.
If you are trying to stream to a file only when the button is pressed, my guess is that your problem is with item 1) above. When the button is pressed, any existing HWS files at that filepath are getting destroyed, and a new one is getting created in it's place. So when your application is finished, you will have one file with one set up data in it. The data will be from the last while loop interation when the boolean was set to true.
If you are trying to append to an existing HWS file, you will need to open the file with Read/Write permissions and then use the Open Existing Waveform VI rather then the Create New Waveform VI inside of your for loop.
-JaredW
11-07-2007 09:54 AM
11-07-2007 10:00 AM
In the HWS palette in LabVIEW, go to the niHWS Low Level Read palette. There you will find a vi called "niHWS Get Wfm Reference.vi". Sorry for mixing up my words in the last post 🙂
-Jared