LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you pass a Visa Resource Name to LV Created DLL

Hello and thank you for reading.

 

Here's my problem: I have to create a DLL for a customer who wants to use the LV code I developed in thier software. I am using an FTDI chip as a virtual COM port through the visa drivers. I created a test.vi that takes reads a serial value. The only problem is that I need to be able to pass the com port to the dll and I don't know how to do this. 

 

The function prototype when I build the DLL (or shared library in LV) is as follows:

 

int32_t __cdecl READX(uintptr_t *VISAResourceName2);

 

Can someone help me understand the proper way to do this? I don't know how to get the information for the uintptr_t *VISAResourceName2.

 

Thanks!

Joshua

0 Kudos
Message 1 of 3
(2,305 Views)

Joshua

 

Are you putting your Com Port on the Front Panel as a Control and wiring it to the connector pane? Are you saving the VI before trying to create the DLL?

 

Kira T

Applications Engineer

National Instruments

0 Kudos
Message 2 of 3
(2,288 Views)

Kira,

   Yes, it is all connected correctly. The problem was that I didn't know how to deal with VISA resource data type when it creates the DLL. So I created code in LV that took an int and combined it with a "COM" string and coerced it to a visa resource just by wiring the string the the visa resource port. I am not crazy about coercing variables and hate the red dot so I type casted it from a string to a visa resource in LV. Thay way in C++ I could just pass the port number and have LV DLL take care of the typecasting. 

 

Thanks,

Joshua


0 Kudos
Message 3 of 3
(2,272 Views)