LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change state in a state machine from an event

I want to return to the setup state when any dial is pressed after the set color state but i dont really know how.

0 Kudos
Message 1 of 5
(180 Views)

I cannot open your VI. Consider "save for previous" (2020 or below) before attaching.

 

Also give your VI a reasonable name. "Untitled 2.vi" is not a useful name.

0 Kudos
Message 2 of 5
(143 Views)

Sorry im still learning to use it.

0 Kudos
Message 3 of 5
(138 Views)

Your code has some basic flaws and it would be much simple to use an event structure.

 

Glaring race conditions:

There is no guarantee that the property nodes at B is read only after it has been written at A. Both occur in parallel.

altenbach_0-1727589876027.png

Why not just branch the wire to the color code indicator and eliminate eh read property entirely?

A color code is a U32 (or colorbox). Wiring to a DBL indicator makes no sense.

 

Your color inputs should be U8, not I32.

 

You have absolutely no time control and your loop spins like crazy, millions of time per second. It need a wait.

 

You need to simplify! I doubt you even need a state machine for any of this. A simple toplevel loop with events for all possible buttons would be sufficient. All you need to do is change the color when one of the RGB controls changes. What exactly is the purpose of the "star colorize" state? What is it supposed to do?

 

I would nit micromanage the enabled states. Any button should be operational at all times.

0 Kudos
Message 4 of 5
(110 Views)

See if this can give you some ideas.

0 Kudos
Message 5 of 5
(103 Views)