LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Variant to dll using call library function node

Hi,

 

Using LV2012

 

I have a dll that the following prototype:

SetTestResult(LPCTSTR Serial, int Test, int Result, VARIANT measuredValue);

 

How can I pass the Variant to this node when my variant can be either int or float.

 

I have tried "ToVariant" function but it is not sending data and gets error 1517 on LabView. For configuration parameters for variant I have used ActiveX type and datatype as activeX Variant Pointer.

 

So for call library function node my prototype looks like this:

int32_t SetTestResult(CStr Serial, int32_t Test, int32_t Result, VARIANT  *measuredValue);

 

Can someone help me understanding What am I doing wrong here please?

 

Thank you,

Hiren

Hiren Patel
0 Kudos
Message 1 of 3
(2,690 Views)

Anyone has any comment or solution for this?

 

Thanks,

Hiren Patel
0 Kudos
Message 2 of 3
(2,634 Views)

Hello Hiren,

 

Posting your code (even without the DLL) would definitely make it easier for people to point out potential issues.  Here is an example that demonstrates passing an ActiveX variant to a DLL built in CVI, I would suggest cross-checking the way the Call Library Function Node has been configured.

 

Example:Transferring an ActiveX Reference Pointer to a CVI DLL

http://zone.ni.com/devzone/cda/epd/p/id/3343

 

Regards,

Tom L.
0 Kudos
Message 3 of 3
(2,629 Views)