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
I use visa functions in my program for serial communication , I want to save selected resource name in windows registery and next time that i run my program, i want to read it from registery and assign it to my visa resource name control.
example:         My visa resource name control value = COM2
                        I close my program with this value (how i can easily save COM2 to windows registry key ?)
                        I open my program again (how i can load COM2 in my resource name control from registry Key?)
                        How i can access to visa resource name list? example: COM1     COM2      LPT1     COM56     COM255
Thanks.
0 Kudos
Message 1 of 12
(3,964 Views)
Do search in the LV examples for Registry. You will find examples for reading and writing registry values.

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 2 of 12
(3,957 Views)
Hi;
 
I am professional in using registry but my problem is loading visa resource name in intialing step of my program.
how i can initial visa resource name with my value ? example : my computer has this serial ports: COM1 COM3 COM6
how i can initial my resource name control with COM6 or COM3 or COM1 ?
0 Kudos
Message 3 of 12
(3,923 Views)

Hi,

Mike is right.

but could it be that your problem is different?

why not simply define the com port using "make current values default"?

or keep track of default values in a file that you would open at begining of your program?

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 4 of 12
(3,919 Views)
I guess I don't understand your problem. All you have to do is ready the key containing the desired resource name and wire the resulting value to the appropriate terminal on the open VI. That's as hard as it gets...

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 5 of 12
(3,904 Views)
I create VISA resource name in front panel:
 
Controls ---> Modern ---> I/O ---> VISA resource name
 
I click in right arrow in created control and i can view list of resource names.
example:  items of my visa resource names:
                   COM1
                   COM2
                   LPT1
 
How i can read this item list and for example place or save items on array?
 
 

Message Edited by javadi_ali on 06-11-2007 09:04 AM

0 Kudos
Message 6 of 12
(3,887 Views)
Oh that... I don't think you can. That list is built dynamically from the resources that are available on that particular PC. What is it that you are trying to accomplish?

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 7 of 12
(3,882 Views)
In some PCs such as Labtop when we use USB to RS232 converter to adding COM ports to PC. the number of port is undefined and it may be one of COM1 to COM256 and i must add all of COM1 to COM256 to my COM port list, but in visa resource name COM ports appear dinamically and don't need to list all 256 ports.
0 Kudos
Message 8 of 12
(3,873 Views)
It doesn't matter what is in the list as long as the COM port that you pass to the control exists on the system that you are running the code on.

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 9 of 12
(3,854 Views)
OK, thanks I know it , but I use two serial port and I must initial my two visa resource with different names, in addition in end of my program I want to save last value of two visa resource names and when i run my program again, I want to load these two visa resource names with saved values.
0 Kudos
Message 10 of 12
(3,841 Views)