03-01-2022 04:56 AM
I have a DLL that I want import to Labview.
The problem is that there is this funzione:
int32_t GetParam(HANDLE DeviceHandle, int32_t ParamId, void *ParamValue, int32_t ParamSize)
where *ParamValue is a pointer to a float or a int.
when importing I have to specify Data type, and in pass I set "pointer to value".
But What have to specify in Data type?
Thanks,
S.
Solved! Go to Solution.
03-01-2022 09:49 AM
I do not speak with experience or authority here, this is only a suggestion:
I presume that you know in advance what kind of data type the function expects. You can create two CLFN nodes, one for the integer type and the other for the float (or double?). Then call the correct one, depending on the expected return type.
03-01-2022 05:43 PM - edited 03-01-2022 05:46 PM
LabVIEW is strictly typed and doesn’t allow variables to change type at runtime, except for variants but they are a lot more complex under the hood than a typeless void pointer.
So follow Lindenbauers advice, Make two VIs calling this function with a Call Library Node, one using a double float and one using an int32. You need to know which type to use when you want to access a specific parameter, also when programming in C.
05-16-2022 08:37 AM
thanks, i hadn't thought about this simple solution