LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to pass VISA references to external code module

Hi,

I have a dll which use to access gpio through com port but it need to create handler to access it.

So, how am i going to convert the Visa resources name to valid ID handler??

 

I have go through the KB : Can I Share Open VISA Sessions in LabVIEW with External Code?

Inside get mentioned:

However, the Call Library Function Node can perform this conversion. If you wire a VISA resource name or VISA refnum to a 32-bit integer input terminal of a Call Library Function Node, the node coerces the refnum into a valid VISession ID, which you can use in your external code.

 

How can i do this??

 

Thanks and Regards,

Simon

0 Kudos
Message 1 of 9
(3,285 Views)

hi simon76,

  what exactly you want to do?Whether you want to convert a refnum to I32 or you have any problems with call library function?

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 9
(3,275 Views)

try refnum to session

0 Kudos
Message 3 of 9
(3,257 Views)

Hi,

Let me explain the details: i need to access a hardware by usb-uart, after driver installation, it works like normal com, i have no problem to read/write. Now, i will control the gpio & been given dll, and i try on vb by create handler

hDrv = CreateFile(TEXT("COM1"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);

 and is working fine.

Since labview return back visa resource name, so how can i convert to handle ID session to be use on external code module??

 

KateB,

where can i get the refnum to session property?

0 Kudos
Message 4 of 9
(3,241 Views)

Use search in function palette, and search with the same function name.

0 Kudos
Message 5 of 9
(3,235 Views)

Hi,

Do you mean search for visa in function paletta??

 

thanks and regards,

0 Kudos
Message 6 of 9
(3,228 Views)

Search for "refnum to session" in function palette.

0 Kudos
Message 7 of 9
(3,226 Views)

@KateB wrote:

Search for "refnum to session" in function palette.


What version of LabVIEW are you using?  I don't see that in LV 2010.

0 Kudos
Message 8 of 9
(3,220 Views)

Ok. That one comes with TestStand. So try http://digital.ni.com/public.nsf/allkb/FB001AA027C8998386256AAD006C142D 

0 Kudos
Message 9 of 9
(3,214 Views)