취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Importing configuration data from a .sav file.

해결 완료!
솔루션으로 이동

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 포인트
11/31 메시지
1,494 조회수

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

Tim
GHSP
0 포인트
12/31 메시지
1,486 조회수

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



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 포인트
13/31 메시지
1,483 조회수

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 포인트
14/31 메시지
1,477 조회수

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



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 포인트
15/31 메시지
1,463 조회수

@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 포인트
16/31 메시지
1,459 조회수

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 포인트
17/31 메시지
1,453 조회수

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

18/31 메시지
1,444 조회수

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

0 포인트
19/31 메시지
1,442 조회수

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 포인트
20/31 메시지
1,437 조회수