03-16-2004 12:28 PM
Solved! Go to Solution.
03-16-2004
01:51 PM
- last edited on
12-12-2024
03:29 PM
by
Content Cleaner
Well this is not a full answer but,
If you use a property node and attempt to read the "value" of a latch action boolean, it will return an error.
The ClassName property will say boolean it the control is a boolean.
So if you pass an array of control references into a For loop and read the ClassName FIRST and then attempt to read the value you should be able to at least figure out which controls are booleans and which of those are latch action.
I took a quick look a the type descriptor and it apears that a new boolean from the palette will have the first byte equal to 12 and copied boolean have 14 in the first byte.
Now how to decide which type of latch action....
Can't help you there.
Ben
Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com
For the record: This approach was inspired by the save all control function originally devloped by Jean-Pierre and is available via OpenG. I am not blaming him if this does not work! I am only trying to give credit where credit is due.
03-17-2004 02:33 PM
07-04-2016 06:43 AM
I know this is a really old post, but I found it when I was searching for how to read the mechanical action of a boolean. I needed it for a tool I'm writing to analyze running VIs and one of the things I want to check about them is the controls that are latching booleans.
Ben's suggestion of checking for an error coming out of the value property node worked great for my application! But there is something slightly tricky you have to do to get it to work. If the value variant is unwired, LabVIEW tries to be super helpful and compiles the value property node out, since it thinks you are not using it (at least for me, it seems like this is what it did). This makes it so you never get an error, even if the control is a latching boolean. So what you need to do is wire the value variant to something, anything will do, even just a tunnel on a loop or something, so LabVIEW knows you are actually using the property node. Then it will actually give you an error for latching booleans. It took me a while of being confused before I figured this out, so hopefully this helps if someone else comes across this post and wants to do the same thing.
--Hope
07-04-2016 08:12 AM
If you activate scripting, you can access a MechAction property, which makes it somewhat easier:
07-04-2016 08:51 AM - edited 07-04-2016 08:51 AM
Yeah, that is a much less hack-y way to do it, but scripting doesn't work while it's running, so I can't use it for my application, since I'm trying to monitor VIs that are running.
--Hope
07-04-2016 09:24 AM
@prettypwnie wrote:...but scripting doesn't work while it's running, so I can't use it for my application
Scripting is a very general term, so that's definitely right. Certain things which fall under the scripting label (particularly things that change things) don't work on running VIs, but things which just read generally work, including this property.
07-05-2016 01:24 AM
Wow, you're right, it does work, even while the VI is running. Nice! I guess I'll go back and make my code a bit cleaner with this.
02-19-2021 09:33 AM
It is not available on runtime. what a shame.
02-19-2021 11:26 AM
Hi Tony,
@dj_tony wrote:
what a shame.
Why do you think so?
Why do you (think you) need that feature at runtime?