LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

64-bit parameters

We have a 64-bit DLL SDK written in C.  We have a vi for each function exported by this DLL.  We are not LabVIEW developers (we are SDK developers) and the vi's were created years ago by a previous developer who is no longer with the company.

 

Most of the functions in our DLL include a "context" parameter which is a 64-bit void pointer.  In the vi's, most of them have this parameter set as a Signed 64-bit Integer in the Call Library Function node.  I noticed a few of the vi's have this parameter set to use a Signed 32-bit Integer.  The block diagram for these particular vi's have an I32 converter in the wire from the input value to the function.  The vi's that have the parameter set to a Signed 64-bit Integer have no converter. 

The vi's set to use a 64-bit Integer seem to me to be the correct setting.  I would think the others using a 32-bit Integer with a converter could truncate the value.

 

Here is a screenshot of one of the vi's with a 32-bit parameter.  The incoming context is 64-bit.

https://www.screencast.com/t/1SdIQEngw

 

Am I correct that the context parameter should be 64-bit with no converter?  I wanted to be sure before I made the change to the parameter and removed the convertor.

0 Kudos
Message 1 of 2
(2,102 Views)

Actually if the context parameter is really a void pointer, the correct setting in the Call Library Node is "(Unsigned) Pointer Sized Integer". It is up to you if you prefer signed or unsigned for a pointer, I personally think that signed pointers are a bit weird. In the LabVIEW frontpanels you will make the parameter to be an "(Unsigned) 64 bit Integer". The Call Library Node with the "(Unsigned) Pointer Sized Integer" configuration will then use either the lower 32 bit of that 64 bit Integer to pass to the DLL function when your VI runs in the 32 bit version of LabVIEW or all 64 bit of it when the VI runs in the 64 bit version of LabVIEW.

 

Configuring this as a 32 bit integer will work right in 32 bit LabVIEW but potentially truncate the pointer in 64 bit LabVIEW and configuring it as 64 bit integer will mixup your stack when you run the software in 32 bit LabVIEW.

Rolf Kalbermatter
My Blog
Message 2 of 2
(2,073 Views)