10-06-2011 03:02 PM
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.
10-07-2011 03:58 PM
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
10-07-2011 04:04 PM
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
10-10-2011 03:17 PM
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