07-03-2012 06:50 AM
hi all,
I prepared a vi that calculates something and show these calculated values via indicators. I want to see some of these calculated values later to compare the previous calculations and I want to do it manually. For instance, I run the via continuously and change the inputs manually and it calculates, I want to compare the first and the fifth calculation, I do not need 2., 3., and 4. calculations results, hence after the first calculation I press a button and write these results into a table. I run 2.,3., and 4. calculation but I do not press to save these values after the 5. one I press again the button to save the 5. calculation results. How do I program this kind of vi? Thanks in advance.
07-03-2012 07:01 AM
Hi newbieeng,
Cannot understand much from this explanation.Please attach your prepared VI or any outlines for what to do?
07-03-2012 07:10 AM - edited 07-03-2012 07:11 AM
Hi newbie,
"I press a button and write these results into a table."
I would use a case structure and a file save function (maybe WriteToSpreadsheetFile?). That's it...
"I run the via continuously"
Using run continuously is just for debugging...
You ask very basic questions. Ever considered to take the basics tour offered by NI?
Getting Started with NI LabVIEW Student Training
http://zone.ni.com/devzone/cda/tut/p/id/7466
Introduction to NI LabVIEW - Learn LabVIEW Basics
http://www.ni.com/gettingstarted/labviewbasics/
07-03-2012 07:24 AM
I tried to explain what I want to do in the attached jpeg. I really do not know how to do it, so I could not prepare the program. That's why I am asking. Thanks.
07-03-2012 07:27 AM
GerdW wrote:"I press a button and write these results into a table."
I would use a case structure and a file save function (maybe WriteToSpreadsheetFile?). That's it...
I was thinking more along the lines of saving the values in a shift register. But it does really depend on the architecture and requirements.
07-03-2012 07:28 AM - edited 07-03-2012 07:29 AM
@GerdW wrote:
Hi newbie,
"I press a button and write these results into a table."
I would use a case structure and a file save function (maybe WriteToSpreadsheetFile?). That's it...
"I run the via continuously"
Using run continuously is just for debugging...
You ask very basic questions. Ever considered to take the basics tour offered by NI?
Getting Started with NI LabVIEW Student Training
http://zone.ni.com/devzone/cda/tut/p/id/7466
Introduction to NI LabVIEW - Learn LabVIEW Basics
http://www.ni.com/gettingstarted/labviewbasics/
I really do not think that it is too easy as you said. Maybe I could not explain what I want to do. I attached a jpeg to the previous reply to try to explain in the best way. Maybe it could be easy for you but it is not for me and I really read help files and look example vis before writing to this forum.
07-03-2012 07:37 AM - edited 07-03-2012 07:37 AM
Hi newbie,
as Crossrulz said:
Use a shift register to hold the contents of your table.
Then:
- Don't use RunContinuously (as has been mentioned before). Use a (while) loop instead - you need it for the shift register anyway.
- Use a case structure. When the button is true then you add the values as new row to the table...
07-03-2012 07:37 AM
Well, first of all put your code into a while loop and do NOT use the Run Continuously function. Add a stop button to stop the program.
Are you familiar with event structures? I would add a button to use to aquire the data. Then you have the save button to add the data into the table.
The table is a 2D array of strings. So what you need to do is format your data into strings and use the build array to make a 1D array. You then use the build array again to append the 1D array onto the table.