LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a VISA resource to a SubVI using a cluster

I am coding a SubVI that controls several instruments using VISA, and requires too many inputs to connect them all individually on the subVI icon. I am trying to figure out how to pass clusters of instrument parameters into the subVI (like one cluster per instrument, with about four parameters per cluster). The only one I'm having trouble with is the VISA Resource Name control. It won't let me place the control in the cluster for some reason. I have tried Googling it as well as searching this forum, but haven't come up with anything useful. Can someone please either point me in the right direction? Thanks!

0 Kudos
Message 1 of 5
(3,309 Views)

I am able to place a VISA resource name in a cluster.  What version of LabVIEW are you using?

0 Kudos
Message 2 of 5
(3,299 Views)

I think I figured out what I was doing wrong...

 

I was trying to create a cluster definition so each element in the cluster could be named. I was doing this by creating a cluster constant and then placing dummy constants within it, each with a label, then connecting that cluster into the top terminal on the Bundle function...then connecting my actual device parameters to the element inputs of the Bundle function.

 

As I discovered, the problem that I was actually confused about was how to create a member definition for the VISA Resource name in the dummy cluster. Obviously you can't add a VISA session to a cluster of constants, and the VISA resource already has a label, so it's really unnecessary.

 

However, I am still trying to figure out how to create a cluster that includes the VISA resource and named constants. When I try to bundle the cluster of constants with the VISA resource, and then try to unbundle it by name again, it just ignores the cluster of constants, and the only element that is able to be unbundled is the VISA resource...I'm having difficulty describing my problem...see attached image, hopefully it will help clarify my question.

0 Kudos
Message 3 of 5
(3,286 Views)

I'm assuming since there isn't a visible label on the cluster that you didn't give it a label.  Carefully right click on the edge of the cluster and show label, give it a name, then you'll be able to unbundle it by name.

Message 4 of 5
(3,272 Views)

Ahh, yes, you're right! Although that didn't have the exact effect I was looking for...it essentially made the new, named cluster a single cluster element, rather than breaking out it's elements when unbundled...however, I think I was over complicating things by trying to bundle the cluster constant. I think simply bundling the dummy parameters without using the cluster constant at all accomplishes what I'm trying to do. Thanks for your help! 🙂

0 Kudos
Message 5 of 5
(3,253 Views)