04-12-2016 03:14 AM
I want to activate a button by program, but I'm unable to do it.
I read on the forum that it must not be a latching one, and that's ok it's a common "switch when released".
So I saved its state:
... and in anothe part of the program I try to switch its state:
the problem is that when the switching happens it only partly works, e.g. I see the button label switch Start<->Stop,
but the associated methods (e.g. shown above "Stop camera") do not fire, as if the case structure <"Start": value change> is not activated...
any hint?
alessandro
Solved! Go to Solution.
04-12-2016 03:33 AM
Hi!
Try changing button's value via property node-> value(signaling). This will trigger the event structure
04-12-2016 04:05 AM
Hi alessandro,
So I saved its state
I hope you don't mean this copy operation from terminal to local variable as "saving": What's the purpose of reading a terminal and writing this value back into a local variable of the terminal/control?
and in anothe part of the program I try to switch its state
This looks like heavy overuse of local variables!
but the associated methods … do not fire
These are no "methods", it's an event structure handling events!
As said before: writing to local variables will not fire an event. Only UI actions (well, mostly) do fire events - and special property nodes…
04-12-2016 08:21 AM
thank you all for the help...
it is just a few days I struggle with Labview, and I'm still confused!
There is some place a page about "common Labview mistakes" ? If it's there, I'd like to add this:
If you arrive from some other language, and you are thinking about using a local variable, in 99% of the cases you are thinking about a Property Node.
alessandro
04-12-2016 08:30 AM
@alzyx wrote:
There is some place a page about "common Labview mistakes" ? If it's there, I'd like to add this:
If you arrive from some other language, and you are thinking about using a local variable, in 99% of the cases you are thinking about a Property Node.
alessandro
No. That's not true at all. Local variables are very similiar to "Value" property nodes with some subtle differences you won't need to worry about now.
Your statement really should say that "In LabVIEW the wire is the 'variable'. "
04-12-2016 08:37 AM
@alzyx wrote:If you arrive from some other language, and you are thinking about using a local variable, in 99% of the cases you are thinking about a Property Node.
You just hit my pet peeve #1. The Value Property Node is a HORRIBLE alternative to a local variable. I am talking 1000+ times slower. Use wires whenever possible! The wire is the variable!
04-12-2016 10:00 AM
Obligatory free training links, feel free to go over some when you have some free time, I recommend the Self paced training if you have an SSP (bought LabVIEW in the last year), or the 6 hour introduction. Some of it maybe review but I'm sure there are a few things to learn from it.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord