LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace VISA resource name control with an enum control

hi,

When programming a serial communication application , the LV new version (8.0) using VISA to do this, but it always generate a VISA resource name control that marked a I/O , I do not like the style , anyone knowing the  way using an enum or a ring control to replace it ? thanks.


David
0 Kudos
Message 1 of 5
(4,297 Views)
Hello David,

for a quick solution:
use your enum/ring, connect it to a case structure and wire the proper VISA constant to the output of the case.
Not fancy, but should work 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(4,285 Views)
All you have to do to use a ring or enum is to use the Strings[] property. Use the Index Array with the enum/ring control wired to the index and you'll get a string that you can input to a VISA Resource Name input. Of course, when you do this, you'll loose some functionality. The VISA Resource Name control will list all VISA resources that are actually present. When you use a ring or enum, the only resources a user can choose from are the ones that you actually enter as items. You might have Com1 and Com2 on your system but if you move the app to another computer, it could very easily be something completely different.
Message 3 of 5
(4,282 Views)

Hi David

Alternatively, you can use the enum and convert it to a string which the visa open will accept.

See attached vi

David

Message Edited by David Crawford on 01-25-2006 09:37 AM

Message Edited by David Crawford on 01-25-2006 09:40 AM

Message Edited by David Crawford on 01-25-2006 09:41 AM

Download All
Message 4 of 5
(4,289 Views)
Thanks all!

David
0 Kudos
Message 5 of 5
(4,256 Views)