LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data using a button

Solved!
Go to solution

Hello,

 

I have created a programm that can save data to a file using the "Write to measurement file"-Symbol, when I start the programm. However, what I want is that when I press a button the system asks me where I want to save the data and when I click it again, the aqcuisition stops. Then again when I click the button it should ask again.

 

Since I am using an Omega box, I deleted most of the things in the VI

 

Can someone help me?

 

 

0 Kudos
Message 1 of 12
(4,684 Views)

u.pngAs far my understanding, There is an option to ask the user everytime when the express VI executes

 

Under Action click Ask each iteration

u.png

Modify your code as shown above

0 Kudos
Message 2 of 12
(4,677 Views)

Thank you for your reply. When I run the programm and then click on the button it asks me where I want to store the data and when I click it again the aqcuisition stops. However, when I click again it doesn't ask me where I want to save my data. How is it possibly that LabView asks for the path every second time I click on the button?

0 Kudos
Message 3 of 12
(4,645 Views)

It should ask every time depending on how it is coded.  Post your code and we can better suggest a solution.

0 Kudos
Message 4 of 12
(4,630 Views)

Here is the Code. I don't know if you can open it, since I am using ULx from Measurement Computing. I also created pretty much the same thing with DAXmx from NI as a comparison. As you can see, it is a simple programm for data acquisation that uses the internal clock of my device (Omega DAQ2416) to give a signal to a while loop in which the data is stored to a file. Thank you for your help

0 Kudos
Message 5 of 12
(4,619 Views)

Double click the Write express VI, change the Action to Ask each iteration instead of Ask only once.

0 Kudos
Message 6 of 12
(4,614 Views)

If I change it to each iteration the data save window shows up everytime the while loop operates. I just want it to show up when I click the button every second time.

0 Kudos
Message 7 of 12
(4,608 Views)

The mechanical action of the button isn't the right type.  It is set to Switch When Pressed you probably want Latch When Released.  Then it will only be true once then be false again until it is pressed.  Right now it works more like a toggle switch where it is true over and over until you make it false. Alternately you could browse for a new path when you click the button, but then keep the selected path in a shift register and use that path until the user presses the button again.

0 Kudos
Message 8 of 12
(4,602 Views)

Thank you for your help. But it still doesn't work. The problem is that I have to reset the "write to measurement file" element, when the button is pushed the second time. But when I do so it resets it every time the while loop is performed, resulting in a pop up of the where to save window

0 Kudos
Message 9 of 12
(4,575 Views)

I think to write the data in a file you should use the wirte to spreadsheet file.vi and in the path terminal, use the application directory node followed by the build path function. Application directory gives you the path of the current directory where you have saved the application. In build path function give your file name.

I think it should work.

Correct me if i'm wrong.

 

Certified-LabVIEW-Developer_rgb.jpg

Best Regards,
Prince Agarwal,
Certified LabVIEW Developer
0 Kudos
Message 10 of 12
(4,569 Views)