LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dll connection

Solved!
Go to solution

Hi :

I am facing problem using DLL  " Cal library function "

 

i want to  define bool connection type to terminals 

 

but i can't see bool type in this cal function . what i see only : Numeric, array, string , waveform,digital data type 

 

how can i define bool " true/ false" ?

 

 

. thanks for helping me.

0 Kudos
Message 1 of 5
(3,790 Views)
Solution
Accepted by topic author elyan

Boolean is no ANSI C datatype. Therefore it is not available.

In ANSI C, boolean are normally I8 with the differentiation of value = 0 and value != 0.

If i recall it correctly, FALSE is presented by value = 0.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 5
(3,788 Views)

Hi :

 

if i used digital data type is that as bool

 

thanks

 

0 Kudos
Message 3 of 5
(3,772 Views)
That question doesn't make much sense. How is "bool" defined in the C code in the first place? It has to be defined there somewhere. In that case you would use the same datatype.
0 Kudos
Message 4 of 5
(3,760 Views)

smercurio_fc wrote:
That question doesn't make much sense. How is "bool" defined in the C code in the first place? It has to be defined there somewhere. In that case you would use the same datatype.

Well bool is a predefined datatype for C++ (Actually C99 too). But LabVIEW does not know about C++ and its Call Library Node does only allow to call exported standard C functions.

 

And according to the standard the size of a bool is implementation defined. It says only that its size must be big enough to contain the two values 0 and 1. This would probably mean that a compiler will usually use an 8 bit integer for this but it could just as much use a 32 bit integer or a single bit if the underlaying hardware has support for such variables. So there is no easy way to interface to a function that would use the bool datatype without also knowing what compiler was used to compile that function and what memory size that compiler uses for the bool datatype.

 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 5
(3,736 Views)