LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW2010 .NET interop VISA resource name LVReferenceNumber issue.

I have a VI that uses a VISA resource name, and communicates with a hardware device.

I have compiled this VI into an (.NET) interop, so that I can call it in VB.net 2010.

I have included references in VB.NET for VISA and Labview.

I can see the function as i created it in Labview Builder with intellisense.

 

My problem is that the VISA Resource Name input requires an LVReferenceNumber, and the the LVreferenceNumber constructor only accepts an Integer.

I can create a session using ResourceManager.GetLocalManager().open("aliasName"),

and can get the resourcename by doing a MessageBasedSession.ResourceName,

But I cannot find a way to get the VISA Resource name as an LVReferenceNum

 

Any help with this would be much appreciated,

Thanks.

 

0 Kudos
Message 1 of 4
(2,169 Views)

Mike,

 

I'm not sure there is a direct way of getting a VISA resource name as refnum.

 

As far as the application goes, I'm not sure why you have to pass the VISA Resource Name as a LVReferenceNumber. Is there a reason why you are doing this that I am missing?

 

Regards,

 

Daniel

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,151 Views)

Daniel,

I would like to pass the resource name as a string.  However, when I compile the VI as an interop, the VISA resource name input requires it to be a LVReferenceNumber.

If it accepted a string there wouldn't be a problem.

 

Thanks,

Mike

0 Kudos
Message 3 of 4
(2,149 Views)

Mike,

 

You won't be able to pass it as a string. There is also not an easy way to convert this to a refnum. 

 

Check out this dev zone article:

 

http://zone.ni.com/devzone/cda/tut/p/id/3251

 

There is a section under Developing Programmed I/O for creating a visa refnum using another vi.

 

Hopefully this will help.

 

Daniel

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,134 Views)