LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

About execution when the event structure value changes

When the value changes in the event structure, I created a VI to move to the next state and see the read value.

 

The 27-digit character string read by the barcode is input to the event structure, but it is quick to recognize that the value has changed, and it moves to the next state while reading the barcode. It will end up. (Only two digits can be detected from the barcode.)

 

The situation is made into a video.

Originally I want to read "HYT235V-CAB-EU62 80923", but only "HY" is entered.

0 Kudos
Message 1 of 2
(1,021 Views)

Hi kucha,

 

your VI is hard to understand with all those (mangled) Japanese chars, it would be nice to use English/ASCII labels only…

(It also does NOT help to provide that enum typedefinition with a different filename as is used in the VI.)

 

On your problem:


@kucha wrote:

Originally I want to read "HYT235V-CAB-EU62 80923", but only "HY" is entered.


Because you explicitely set the string control to "Read while typing", so you get a ValueChange event for each char!

 


@kucha wrote:

The 27-digit character string read by the barcode is input to the event structure, but it is quick to recognize that the value has changed, and it moves to the next state while reading the barcode. It will end up. (Only two digits can be detected from the barcode.)


Why do you proceed to the next state even when the barcode is not valid? You could prevent that programmatically!

 

Your overall design seems questionable: usually event structures should not be buried inside a case of a case structure. Events should be handled whenever they occur, so the event structure should be able to execute at all time…

Best regards,
GerdW


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