LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Enum Twice

Solved!
Go to solution

Hi all,

 

I'm controlling the output of a state machine with an enum. The output from the boolean indicator goes to the "Select" function which determines the next state. When the next state is executing a user can select another value from the enum list before the end of execution, forcing the user to select a different state in the list before the already selected one can be read. Is it possible to read the same value in the enum twice by a mouse click if it is already selected in the list?

 

One way I thought of is disabling the control until the state has finished executing but would like to avoid this if possible.

 

Example_VI_BD.png

 

 

0 Kudos
Message 1 of 4
(1,381 Views)

You could use an event structure.

 

You might even look at the Template for A Producer- Consumer loop (Events) vi

 

Your entire vi makes no sense and could have the equivalent code fit on a postage stamp.


"Should be" isn't "Is" -Jay
Message 2 of 4
(1,378 Views)
Solution
Accepted by topic author OA1

@OA1 wrote:

Is it possible to read the same value in the enum twice by a mouse click if it is already selected in the list?

 


You have some confusing statements, but if the user is supposed to be able to select the same entry twice in a row, why not add a new enum item that does nothing and set it to that after each read?

 

Here's how that could look like.

 

altenbach_0-1657032185921.png

 

Sorry, I am very confused about the rest of your code. Seems very convoluted, but I am sure there is more to it in the full program. 😄

Message 3 of 4
(1,353 Views)

Hi Altenbach,

 

I admit I didn't explain myself well but you understood the jist of what I was trying to say. Your solution is nice and simple. I will implement it, thanks.

0 Kudos
Message 4 of 4
(1,303 Views)