LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event-driven button value change event for press/release

Solved!
Go to solution

Correct.

 

If you want to trigger something to happen at the start, wire a boolean to the Value Change (Signalling) property node of that control.

0 Kudos
Message 11 of 18
(1,878 Views)

Ok, I've come up with this code so far,

 

If I may ask, how can I then write values an Analog Output? I have to unserstood that I must include those events with the buttons events as done in the VI, or can i put those in a parallel while?

 

I'll have also to read values but that'll be next step

0 Kudos
Message 12 of 18
(1,862 Views)

You can put the analog outputs in a parallel while loop. Or you can put them in another event case that is configured for the value change events of those 4 numeric controls.

 

Your VI has a broken wire.  Hover over it and it will tell you why.  It says the numeric types have incompatible units.

 

Get rid of the units for your controls.  If you want to show m for meters, then create a caption and put the letter in there.  You could also do a custom format for the control such as %f m  and the m will show up inside the control, but is not a unit.

 

Units were something that seemed like a good idea when NI added them to LabVIEW.  But in reality they cause more problems than they are worth.

0 Kudos
Message 13 of 18
(1,853 Views)

This is the code so far, is there a more elegant way to execute the read of data? At least it works now.

 

Thank you for the big help you're giving me with understanding how LabView works.

 

Also I'd like to ask why if I run it as a subVi of the MenuVi (GUI.vi) it doesn't work as the valves won't turn open (see that the led doesn't turn green)

Download All
0 Kudos
Message 14 of 18
(1,843 Views)

You really need to get rid of ALL the value and value(sgnl) property nodes. None are needed!!!

0 Kudos
Message 15 of 18
(1,840 Views)
Solution
Accepted by Ub4thaan

You still did not change the mechanical action. You can greatly simplify your code by using clusters and arrays (and if you make the containers transparent, you cannot tell the difference!)

 

Here's how one of your loops could look like:

 

altenbach_0-1612985920673.png

 

 

 

(You still need a reasonable way to stop the loop, not shown. )

 

Arguably simpler , better, and more functional than your version below:

 

altenbach_2-1612985717306.png

 

Also note that your indicators are inside the "No error" case, meaning they will not update when there is an error and thus might show stale and misleading values. My code makes them all FALSE if an error occurs.

0 Kudos
Message 16 of 18
(1,833 Views)

OK, that seems a lot more readable than my code, also I could repurpose that code for the other input/output.

 

Again thanks a lot

0 Kudos
Message 17 of 18
(1,829 Views)
Solution
Accepted by Ub4thaan

A cleaned up version of your code.

0 Kudos
Message 18 of 18
(1,825 Views)