From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save desired calculated values in a table

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.

Egemen
0 Kudos
Message 1 of 8
(2,573 Views)

Hi newbieeng,

                        Cannot understand much from this explanation.Please attach your prepared VI or any outlines for what to do?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 2 of 8
(2,569 Views)

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/

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(2,563 Views)

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.

Egemen
0 Kudos
Message 4 of 8
(2,551 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(2,547 Views)

@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.

Egemen
0 Kudos
Message 6 of 8
(2,544 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(2,530 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(2,529 Views)