LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write a vi that will save graph data and text data (related to the graph) so the next time I want to view the graph data the text data is included in the read vi?

I am new at writing vi's and hope you may be able to help. I would like to create a vi that will graph measurements taken from a daq device. I would like to include text data that a user can choose from (example: machine number, test circuit, load cell type) that will stay with the graph so when the graph is viewed at a later time the text data (explaining parts of the graph) will display with the graph data. I have included a vi I am using to capture and display a force value. Any help would be greatly appreicated.
0 Kudos
Message 1 of 3
(2,839 Views)
What you want is a DATALOG file:

When you save a file, use the BUNDLE function to bundle your machine number, test circuit, whatever (include a few spare fields), plus your graph data. Get the graph data from the source, or use a local variable of the graph itself.

Wire the bundle output to the DATALOG TYPE of a NEW FILE function. (I presume you'll use a FILE DIALOG set to SAVE FILE to choose a file path).

Write the same bundle output to the DATA input of a WRITE FILE function.

Use a CLOSE FILE function to (ahem) close the file.

When you want to read a file, use a FILE DIALOG set to EXISTING FILE (or some other means) to specify what file to read. Wire the same cluster type to the DATALOG TYPE of the FILE DIALOG, so that it will only
offer files of the correct type.

When you have a file path chosen, wire the bundle to the DATALOG TYPE input of a FILE OPEN operation.

Use a FILE READ to read a single cluster - the output of FILE READ will be a cluster of the right type.

Use a CLOSE FILE function to....

Out of the FILE READ function, you can UNBUNDLE BY NAME the data and send to the graph and the other fields, or, if you're clever, you can use a cluster on the screen, and not unbundle it. That's harder though, since you probably want the text fields to be controls (inputs) and the graph to be an indicator (output).

Hope that helps.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 3
(2,839 Views)
What you want is a DATALOG file:

When you save a file, use the BUNDLE function to bundle your machine number, test circuit, whatever (include a few spare fields), plus your graph data. Get the graph data from the source, or use a local variable of the graph itself.

Wire the bundle output to the DATALOG TYPE of a NEW FILE function. (I presume you'll use a FILE DIALOG set to SAVE FILE to choose a file path).

Write the same bundle output to the DATA input of a WRITE FILE function.

Use a CLOSE FILE function to (ahem) close the file.

When you want to read a file, use a FILE DIALOG set to EXISTING FILE (or some other means) to specify what file to read. Wire the same cluster type to the DATALOG TYPE of the FILE DIALOG, so that it will only
offer files of the correct type.

When you have a file path chosen, wire the bundle to the DATALOG TYPE input of a FILE OPEN operation.

Use a FILE READ to read a single cluster - the output of FILE READ will be a cluster of the right type.

Use a CLOSE FILE function to....

Out of the FILE READ function, you can UNBUNDLE BY NAME the data and send to the graph and the other fields, or, if you're clever, you can use a cluster on the screen, and not unbundle it. That's harder though, since you probably want the text fields to be controls (inputs) and the graph to be an indicator (output).

Hope that helps.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 3
(2,838 Views)