From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bool indicator is "True" if I connect this indicator to terminal. (In case structure)

Lugaro_0-1632119192365.pngLugaro_1-1632119214684.png

Why he is "True" if constant to case is "False"?

 

0 Kudos
Message 1 of 12
(526,688 Views)

Hi Lugaro,

 


@Lugaro wrote:

Why he is "True" if constant to case is "False"?


Because you NEVER set that boolean indicators to FALSE.

Because you also made TRUE the default value of those indicators…

Because indicators, which are connected with the connector pane, should NEVER be placed within (case) structures!

 

Based on your question: Did you take those "Training resources" offered at the top of the LabVIEW board?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(526,681 Views)

 As Suggested by GerdW, you need to go through LabVIEW Basics (https://www.ni.com/getting-started/labview-basics/).

 

In addition if you want see the execution flow during runtime- Check the Highlight Execution in the Block Diagram.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 12
(526,640 Views)

@Lugaro wrote:

 

Why he is "True" if constant to case is "False"?


Because of the magic of dataflow. Follow the wire! Your program does exactly what you programmed it to do. (...and why are you using continuous run"? Since you have no controls, nothing can ever change)

 

Obviously, you must have simplified your demo ad absurdum. Can you show us a more functional program that shows what you are trying to achieve?

0 Kudos
Message 4 of 12
(526,595 Views)

Hello. I repit my simple demo in another file and they show different result. Why?

Lugaro_1-1632215471798.png

 

 

Lugaro_0-1632215277816.png

My original problem is VI for bar-code scaner.

I scan bar-code and wont to see it while I dont use scanner. But string indicator clear in next cycle. Somtime (and today) it work as I wont. Sometime case work evry cycle after start - clear "string" and ON "test" indicator   

Lugaro_3-1632216179032.png

 

 

0 Kudos
Message 5 of 12
(526,551 Views)

Thank for "Highlight Execution". But it show that indicator must be "False".

 

0 Kudos
Message 6 of 12
(526,550 Views)

@GerdW wrote:

Hi Lugaro,

 


@Lugaro wrote:

Why he is "True" if constant to case is "False"?


Because you NEVER set that boolean indicators to FALSE.

Because you also made TRUE the default value of those indicators…

Because indicators, which are connected with the connector pane, should NEVER be placed within (case) structures!

 

Based on your question: Did you take those "Training resources" offered at the top of the LabVIEW board?


Addendum:

Because an indicator, that is connected to the connector pane, is set to its default value at start of the VI execution. That is in contrast to an indicator that is not connected to the connector pane, that will not be changed just by starting the VI.


Regards, Jens

Kudos are welcome...
Message 7 of 12
(526,544 Views)

I repit my simple demo in another file and they show different result. Why?

Lugaro_0-1632221773262.pngLugaro_1-1632221793929.png

 

 

0 Kudos
Message 8 of 12
(526,530 Views)

@Lugaro wrote:

I repit my simple demo in another file and they show different result. Why?

Lugaro_0-1632221773262.pngLugaro_1-1632221793929.png

 

 


I repeat my previous reply:

Addendum:

Because an indicator, that is connected to the connector pane, is set to its default value at start of the VI execution. That is in contrast to an indicator that is not connected to the connector pane, that will not be changed just by starting the VI.

 

Solution: Make sure, that a return value is always set at the end of the VI execution regardless of case-structures, ....

i.e. in case that "Boolean 2" is your return value, set it outside of the case structure:

JensG69_0-1632222651635.png

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 9 of 12
(526,524 Views)

Lugaro_0-1632224351927.png

I try it. Do you have not error? 

 

0 Kudos
Message 10 of 12
(526,516 Views)