03-15-2011 07:48 AM
Hi all,
i was trying to plot a wave and save the data to excel. Now i want to control the write-data-to-spreadsheet.vi to record data whenever i wish which means the vi won't record anything until i send a command to it. How can i make this happen or do i need any other vis?
Nicky
Solved! Go to Solution.
03-15-2011 08:11 AM
You will need to put a little bit of programming around the write data to spreadsheet.vi to do what you want.
For instance you can put a button on you front panel with the label "save to file" and on the diagram, put an event structure that will detect a "value change" event on that button, and only then would you use the write data vi to save the data from your plot to a file.
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-15-2011 08:46 AM
Thanks for the reply. But could you explain the "value change" more clearly coz i didn't get the point.
Nicky
03-15-2011 08:52 AM
After placing an event structure on you block diagram, you can right clic on the frame to "add event", then you have to define the event you want the structure to be able to catch, in your case a clic on the "save" button, so in the event edition dialog windows, select the control (the "save" button) and then the type of event on this control (a value change).
You should be able to find example on how to use the event structure if you go to "Help" >> "Find examples..." and search for "event".
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-16-2011 03:46 AM
it seems doesn't work. And what should i put in that event structure? i was also wondering if i can use a case structure to make it.
03-16-2011 04:36 AM
Hello,
I don't know exactly how you want your application to work but I think the event structure is a nice option, you can get it to work as well with a case structure though.
Here is a very simple example with an event structure (in LV8.6), do you want the same kind of behaviour or do you want something different?
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-16-2011 06:03 AM
Firstly, thanks for the vi. I guess I didn't tell so clearly in my previous post. What I mean is that suppose a stream of numbers is reading continuesly but I don't want them to be saved to file. From the moment I click on the save button the following numbers will begin to be recorded in file.
03-16-2011 06:20 AM
Hi,
May be this wat you are trying to do.. Let me know if it helps..
Regards,
nitzz
(Kudos are always Welcome:))
03-16-2011 06:43 AM
Thanks Nitzz. It really helps 🙂