LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bool

Hi everyone,

 

I have a VI that contents the following input.

char*stdPortName

DWORD Baundrate

WORD  Timeout

bool bRTS

bool bDTR

 

the output is true or false.

 

I do not know how I implement it in labview, because how I will go to put a bool variable in the input. 

0 Kudos
Message 1 of 6
(2,675 Views)

A bool variable is a boolean control/constant/indicator in LabVIEW, depending on whether u want an input, constant, or output.

 

Are you having trouble finding these? Or have I misunderstood your problem?

Prashanth N
National Instruments
0 Kudos
Message 2 of 6
(2,668 Views)

A VI would not have those inputs. Those datatypes indicate (most likely) a Windows API function call. Are you talking about calling a DLL? If so, bool is equivalent to an integer, so on the LabVIEW side you can use an INT32.

 

If that's not what you are talking about, then please provide more details to explain your problem better.

0 Kudos
Message 3 of 6
(2,662 Views)

@smercurio_fc wrote:

A VI would not have those inputs. Those datatypes indicate (most likely) a Windows API function call. Are you talking about calling a DLL? If so, bool is equivalent to an integer, so on the LabVIEW side you can use an INT32.


Windows API sometimes returns a BOOL which is a 32 bit int. However, typically an input would actually be of type bool, not BOOL. This looks like it's a bool, especially since the variable starts with b which indicates bool. A bool is a 8 bit unsigned char.

 

Matt

 

@Pereira, by the way, you can use the bool to (1,0) vi to convert from labview bool to the dll unsigned char so that you can feed it into the call library function node.

Message 4 of 6
(2,650 Views)

Well, the Windows API doesn't have "bool". It has "BOOL" (which is an int), so I took that as the user entering it wrong. "bool" is a Visual C/C++ datatype, which, as you correctly indicated, is a 1 byte datatype.

 

Still don't understand what the user is trying to do.

0 Kudos
Message 5 of 6
(2,641 Views)

Yeah, you're right about the win API not having bool, only BOOL.

0 Kudos
Message 6 of 6
(2,623 Views)