LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How I can saving visa resource name in windows registery and load it again?

Solved!
Go to solution
If you want a customized list of VISA resource, get rid of the resource name control and use a string control, e.g. a listbox.
Of course you will need to properly initialize the list, for example using the VISA Find Resource function to get a list of the current available resources.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 11 of 12
(619 Views)
Solution
Accepted by javadi_ali
Ok, I think I understand what is going on. You want to have a pop up control that the user can select the port number from at runtime. In addition, when the program stops you want to save the user's last selection as a default to be used for the next time its run.

As I said before, there is no way of reading that sort of thing from the control - or setting it. There is undoubtedly a system call in Windows that allows you to list the serial ports that are present but I don't know what that might be. Why not just have the VISA control on the front panel as it automatically updates itself for what is available.

In terms of saving the value of the control, that's simple: just write it to a custom key the application's ini file (for things like this I prefer the ini file to the registry) when the application stops, and read it back in when you start back up. By the way, the output of those controls shows up as a special datatype but you can wire strings to them and LV will coerce them to the proper datatype.

Mike...



Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 12 of 12
(612 Views)