From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How to convert binary data from the front panel controls into ASCII values?

Solved!
Go to solution

Hello,

 

I have seemed to run into a road block with how to convert binary values into ascii.

 

I created this .vi to save all control values into an .ini file and call them back when I am executing the .vi as shown in the attached file. The save button will simply save the data and cancel button will ignore all the current changes. 

 

I would like to understand how to retrieve all the control values in ascii format, so I assign them into a global variable for later usage. I have been looking everywhere for a good reference document and I couldn't find one which would explain my question. I would be greatly appreciated if someone could point me in the right direction.

 

Thanks

Sam

 

0 Kudos
Message 1 of 10
(4,528 Views)

I think you picked some pretty old and way over too complex example. This is just much easier. Did you search in the forum and elsewhere how to properly use configuration files? This is one of the 10 most often asked questions in the forum. There is waste of examples in the forum and other places how to properly do it.

 

Sam_Sharp here gives some good ideas how to do it using the openG toolkit:

 

http://forums.ni.com/t5/LabVIEW/Saving-application-state-for-later-resume/m-p/3225945/highlight/true...

0 Kudos
Message 2 of 10
(4,503 Views)

Thanks for giving me a different prespective on how to slove my issue. I have been seeking a simple way to save control values in the front panel for while now and you have shown me different method. In my main application, there are muliple VIs that I need to commence this process.

 

For my initial issue, I think I figured out the solution after trying out different things. I used the "Flattened String To Variant Function" to slove my issue.

 

Thanks

Sam

0 Kudos
Message 3 of 10
(4,473 Views)
Solution
Accepted by topic author Sam2009

I have been seeking a simple way to save control values in the front panel

 

Do not reinvent the wheel, when there are ready to use solutions, for example:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209753

Use the MGI Save & Restore Settings VI from the palette (for example it saves all settings modified in a Graph, very useful), and the MGI Save (Restore) Front Panel Data VIs (to save and restore control values in the Front Panel).

Here is an example:

 

MGI_save_and_restore_example.png

 

 

 

Message 4 of 10
(4,451 Views)

Awesome. Thanks for your guidance. Most importantly, I will utilize your method by using the MGI library in my application.

 

I just wanted to let you know that I did use the OpenG library and was able to reduce the complexity of my VI tremendously.

0 Kudos
Message 5 of 10
(4,433 Views)
I was happy to help 🙂
0 Kudos
Message 6 of 10
(4,423 Views)

Hello,

It's really helpful.

But there is another quention, how to save the front panel values and restore it on different VIs?

For example, the main VI use some confire values like hardware port, report path and so on, when we want to change it, we will use Menu bar--Config event and user interface to reconfirge them, and then save it. After restart the main vi.exe, it should restore the values that confired at last time, not press Menu bar--Config- restore event.

How to realize it?  

Thanks.

WILL I AM
0 Kudos
Message 7 of 10
(3,328 Views)

@Will_Yuan wrote:

Hello,

It's really helpful.

But there is another quention, how to save the front panel values and restore it on different VIs?

For example, the main VI use some confire values like hardware port, report path and so on, when we want to change it, we will use Menu bar--Config event and user interface to reconfirge them, and then save it. After restart the main vi.exe, it should restore the values that confired at last time, not press Menu bar--Config- restore event.

How to realize it?  

Thanks.


I do not understand what is the question actually. You should just program easily what you described. Like you can programmatically save/restore settings using the Event structure...

0 Kudos
Message 8 of 10
(3,320 Views)

@Will_Yuan wrote:
After restart the main vi.exe, it should restore the values that confired at last time

Just do the load settings as part of the VI's initialization.


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 9 of 10
(3,317 Views)

Yes, you are right.

I made a logic mistake.

The "save and restore front values functioning" should in the Main Vi, not in the "Configure user interface vi".

It works now.

Thanks.

WILL I AM
0 Kudos
Message 10 of 10
(3,301 Views)