LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn Off A Control?

I am writing a VI that runs on the PC and controls a NXT robot.  I have a boolean control on the front panel that turns on the motors.  If the touch sensor detects a hit, I would like to turn off the motors by turning off the boolean motor control.

I have not discovered a way to do this, since there are no inputs for boolean controls.  Is there a way to do this that I haven't discovered?  Or is it impossible?

Thanks...
0 Kudos
Message 1 of 9
(9,418 Views)
create a local variable from the frontpanel or blockdigram boolean control.
This local can be written to.

Like my LabVIEW master always says rightclick and you can see.....

This only works when the boolean control has no mechanical latch function but then it would already fall back when read by the program. (latched booleans do on purpose not support local variables)

greetings from the Netherlands
Message 2 of 9
(9,415 Views)
Thanks, that's really helpful!

I have one question, though.  How would anyone ever find this out on their own?  Is it documented anywhere?

Or do you have to just get lucky and have someone take pity on you and tell you?     🙂
0 Kudos
Message 3 of 9
(9,401 Views)
Or ask in a forum.

It is documented ofcourse. But there is so much documentation that it takes months to just read it.
Jim Kring wrote a nice introduction 5cm thick at least and weghing 1610 gram.

But when you use LabVIEW professionally I advise you to follow a course instead. And try to follow the nuggets from Darren and the rest of the incrowd to understand better
http://zone.ni.com/devzone/cda/tut/p/id/5720     shows an overview of the first nuggets.
greetings from the Netherlands
Message 4 of 9
(9,400 Views)
It is documented ofcourse. But there is so much documentation that it takes months to just read it.
Jim Kring wrote a nice introduction 5cm thick at least and weghing 1610 gram.

Is the documentation available to me somehow?  I'd love to have all 1610 grams of it.

But when you use LabVIEW professionally I advise you to follow a course instead. And try to follow the nuggets from Darren and the rest of the incrowd to understand better
http://zone.ni.com/devzone/cda/tut/p/id/5720     shows an overview of the first nuggets.

Will do, and thanks again...
0 Kudos
Message 5 of 9
(9,383 Views)
One last question:

Is a local variable always associated with a control?  Or can you create one that's independent of anything on the front panel?

Thanks...
0 Kudos
Message 6 of 9
(9,383 Views)
Hi

The link to Jim's and Travis book is:  http://www.labviewforeveryone.com/wiki/Main_Page

the second question is right. You always need a control or indicator, a local needs some storage defined.
But you don't need to show this on the frontpanel. From the diagram rightclick and hide control/indicator and only from the blockdiagram you can show it again.
It does not have to be connected to the connector pane and can even keep its info between calls but don't use that feature.

greetings from the Netherlands
0 Kudos
Message 7 of 9
(9,381 Views)
It does not have to be connected to the connector pane and can even keep its info between calls but don't use that feature.

You mean it works at the moment but is not guaranteed to work in the future?               🙂

0 Kudos
Message 8 of 9
(9,378 Views)
No it will stay, but it is bad programming practice to use these features that are implied with the language.
If you do, you should document on the diagram that you are using the control this way.
There are better ways to check for something like first call.
This "feature" was invented when the "first call" function did not yet exist and people used such a control to keep track of the number of runs in their vi.
If you want a better way check the forum for functional globals or LV2 globals.

greetings from the Netherlands
0 Kudos
Message 9 of 9
(9,375 Views)