LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing configuration data from a .sav file.

Solved!
Go to solution

I'm extremely new to Labview, so I'm not entirely sure what you just said. 😁 How would I change the format? Replace the binary format cluster?

0 Kudos
Message 11 of 31
(1,050 Views)

Yes. Add what ever you need to the cluster and that becomes your new format.

Tim
GHSP
0 Kudos
Message 12 of 31
(1,042 Views)

@aeastet wrote:

Yes. Add what ever you need to the cluster and that becomes your new format.


Do note that this will mean that your new code will NOT be able to open files using the older format.  Another reason to change to an ini, xml, or json file format.


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 13 of 31
(1,039 Views)

Is it as simple as inserting a 'Create Text File' vi in between the binary file output and close file input? Or is there a special vi special to file conversion?

0 Kudos
Message 14 of 31
(1,033 Views)

@JayWW wrote:

Is it as simple as inserting a 'Create Text File' vi in between the binary file output and close file input? Or is there a special vi special to file conversion?


My recommendation is to completely gut out how the file is currently saved/read and make VIs to do the same job using a more user friendly and expandable format.  I am talking a complete replacement to make your future life easier.


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 15 of 31
(1,019 Views)

@crossrulz wrote:

My recommendation is to completely gut out how the file is currently saved/read and make VIs to do the same job using a more user friendly and expandable format.  I am talking a complete replacement to make your future life easier.

I agree with this. However, it is unclear to me if you're adding hardware or replacing old hardware and just need to change some values in the existing configuration. If just need to change then a quick solution might be read, change values, then write, not having to change any existing code.

0 Kudos
Message 16 of 31
(1,015 Views)

I'm replacing a couple of power supplies that have different values than the old power supplies. Just making a quick change to some values would be ideal.

0 Kudos
Message 17 of 31
(1,009 Views)

@JayWW wrote:

I'm replacing a couple of power supplies that have different values than the old power supplies. Just making a quick change to some values would be ideal.


Read the values just like in the picture that you posted, change the necessary values in the cluster, and then write the cluster back to file using Write to Binary File. I would make sure that I had a backup of the existing file before doing anything (just in case you're not using some type of source code control, or this file is not included in the source code control).

Message 18 of 31
(1,000 Views)

I found this vi in an older thread, but it didn't work. It basically output the file the same way Notepad would.

0 Kudos
Message 19 of 31
(998 Views)

So what you have there is a "binary" file. This means the file type was custom-defined by the guy you inherited your code from. You can't open it (meaningfully) with anything, at all, other than a LabVIEW program configured exactly the same as he defined it.

 

Your code there tells you how to decode it. The Cluster going into "Read binary file" is the "type" of that file. That cluster being there tells LabVIEW how to interpret it.

 

What you need to do is to Read the file into LabVIEW, change it within LabVIEW, then do a Write to Binary File. The wire coming out of "Read" is the actual data within the file. You can modify that data within LabVIEW then write it using a "Write binary file" function.

 

There is no way to make this file human-readable, as your main code expects the file in that specific format. Thus, you can either change ALL of the code that reads the file to something simple (like ini/xml/json) or if you just need to change a value, make a new program that does Read-Modify-Write, all within LabVIEW.

0 Kudos
Message 20 of 31
(993 Views)