LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

value signaling & mechanical action

Solved!
Go to solution

Hi everybody, I checked for some existing posts about this but no one solved my problem.

Seems the question have to be very simple but it doesn't work.

See the attached vi:

 

I have a boolean indicator that can be switched on and off bi pressing a boolean push button, you can try yourself 🙂

 

so, the problem is that I have to switch on or off the push button "remotely" by some event occurence, in the specific case of this vi by pressing another button (REMOTE) I can switch on or off the first boolean button driving it by the value signaling property node, yes this does work but...nothing happen to the boolean indicator, the output of the boolean swithc remains OFF.

 

Can someone help me to solve the question?

 

Thankyou very much.

0 Kudos
Message 1 of 21
(3,246 Views)

The REMOTE control sends a value signaling to the ON/OFF control which will only be read after your entire sequence structure completes running.

 

You can fix it, but you should look at a few of the online tutorials to get a feel for what else is wrong with your program.  🙂

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 21
(3,241 Views)

Hi jcarmody, can you please be more specific on which tutorials? Eventually posting me the links?

Thnakyou very much.

0 Kudos
Message 3 of 21
(3,232 Views)

http://lmgtfy.com/?q=site%3Ani.com+labview+tutorials  😄

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 21
(3,211 Views)

Ohhhhhh thankyou very much, you're so kind!

Message 5 of 21
(3,196 Views)

@ghrsdr wrote:

Can someone help me to solve the question?


There are many things wrong with your VI, typical beginner mistakes. Obviously, both the the upper and lower code only runs once per loop iteration, meaning the ON/OFF button will not be read while the lower code is trapped inside the sequence. If you want the two parts to really run in parallel, they need to be in seperate loops. Still, you don't need all that!

 

What is the point of the upper case structure? Why not simply wire the On/Off button to the indicator and skip the case structure entirely? Even if you want to keep the structure, the indictator belongs outside the case, eliminating the property node.

 

What's the point of the lower case structure? Since you don't have an event structure, you don't need a signaling value property, a plain value property or even better, a local variable will serve the same purpose. Wouldn't it make more sense to write to the indicator boolean instead of the on/off boolean?

 

When no button is pressed, your loop spins millions of times doing nothing but consuming all CPU. Place a small wait.

 

Here's is a quick rewrite to give you some ideas. Many cases are still not fully defined by your specifications? What should happen if it is on REMOTE but the ON/OFF switch is pressed? should that be ignored? Should it turn off the remote?

 

Overall, the entire thing should be implemented as a state machine. Try it!.

 

 

 

0 Kudos
Message 6 of 21
(3,191 Views)

Thankyou so much altenbach, I solved the problem following your first suggestion: putting the two codes in two separate loops (see modified vi attached) now it works.

 

Only remain a little thing to fix: Value(signaling) property only work if the mechanical action of the button is not in latch mode, and this is the mode my button have to be set in the main vi...

0 Kudos
Message 7 of 21
(3,186 Views)

The attach 🙂

0 Kudos
Message 8 of 21
(3,183 Views)

@ghrsdr wrote:

Thankyou so much altenbach, I solved the problem following your first suggestion: putting the two codes in two separate loops (see modified vi attached) now it works.


Ever looked at your CPU use? Both loops need a small wait!


ghrsdr wrote:

Only remain a little thing to fix: Value(signaling) property only work if the mechanical action of the button is not in latch mode, and this is the mode my button have to be set in the main vi...



You are making statements that make absolutely no sense. Value signaling has nothing to do with mechanical action. In your particular case, a plain value property or a local variable would work exactly the same, have you even tried?

 

What do you mean by "main vi" are there others? Are you trying to control from within a subVI?

(1) Value, (2) value(sgnl) and (3) local variables are incompatible with latch mode, but you can always program around this restriction.

 

Let me repeat: in your top loop, you are writing to the terminal in one case and to a value property of the same in the other case. This mean that you write to the same indicator in both cases, this means that the indicator belongs outside the case and only the diagram constant belongs inside the case. Shared code belongs outside!

0 Kudos
Message 9 of 21
(3,161 Views)

altenbach ha scritto:

Ever looked at your CPU use? Both loops need a small wait!


Yes, this was only an explicative vi, not my main vi (this don't mean I have sub vi's but only that those subroutines run in a more complex vi).


You are making statements that make absolutely no sense. Value signaling has nothing to do with mechanical action. In your particular case, a plain value property or a local variable would work exactly the same, have you even tried?

 

 

Let me repeat: in your top loop, you are writing to the terminal in one case and to a value property of the same in the other case. This mean that you write to the same indicator in both cases, this means that the indicator belongs outside the case and only the diagram constant belongs inside the case. Shared code belongs outside!

 

Yes your'e right, I am not a programmer (striclty speaking) and labview's architecture is so complex so this is the reason whereby I probably wrote some "bull **bleep**" 🙂

Then, thankyou very much for your support.


 

0 Kudos
Message 10 of 21
(3,137 Views)