LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to acquire an array of BOOL data type from a DLL in labview ?

Hello,
I am having problem getting an array of C data type BOOL, from a DLL ?
the function looks like this FXXXX ( BOOL * Status , int Count )
some one has idea about it ?
Regards
-Ahmed
0 Kudos
Message 1 of 5
(3,293 Views)
helo ahmed,

first determine, which size a "BOOL" has.
i guess it might be one byte.

then you can handle the "BOOL" in LabVIEW as an integer with one byte (U8) and convert it into a boolean value.

regards,

robert h
national instruments
0 Kudos
Message 2 of 5
(3,288 Views)
Robert,
i appreciate your prompt response.
the size of BOOL array is 14, and i have tried such as Char, Integer, Type cast and Adapt to type as well, but none of them worked. it is also causing my system to crash so often.
Regards,
-Salman
0 Kudos
Message 3 of 5
(3,285 Views)
Robert,
i appreciate your prompt response.
the size of BOOL array is 14, and i have tried such as Char, Integer, Type cast and Adapt to type as well, but none of them worked. it is also causing my system to crash so often.
Regards,
-Salman
0 Kudos
Message 4 of 5
(3,283 Views)
hello salman,

since "BOOL" is not a C type, it is necessary to get the size of one single "BOOL" ( sizeof(BOOL) ).
this determines, which type of integer you use as equivalent.

then you pass an array of this type to the DLL function.

what is the error message, when the system crashes?
check the right calling convention for your DLL;

i cannot reproduce the behaviour, since i don't a DLL with a BOOL parameter to test with.

regards,

robert h
national instruments
0 Kudos
Message 5 of 5
(3,279 Views)