LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Another "bug" with setting control value using Property node

I am using Property Nodes to set some controls, mainly to get the "data flow" feature using the error line:  as most of my VIs have the error line running through them, I can ensure the control value changes after MyVI by simply wiring the ErrorOut from MyVI into the ErrorIn of the control's property node. However, I found a "feature" that (so far) I have not seen documented -- if there is an "error" on the Error line, the value will not update!  This came as a complete surprise to me, as there is no "intuitive" (or "obvious") reason for me to expect that an error would prevent a control from updating or allowing any of its properties to change. I am aware of the arguments that "updating controls using property nodes" is "bad" (because it can be slow) -- however, having it inexplicably "not work" is (to my way of thinking) an even more important reason to avoid this practice!  Time to dive into my VIs ...

Bob Schor

P.S. -- I'm attaching a picture of a very simple VI that demonstrates this. Note I've only tested this with a Boolean control. Also, I should mention I'm running Version 8.5.
0 Kudos
Message 1 of 11
(3,104 Views)

Hi Bob,

Not a bug, but a coding standard.

With the exception of "close" type operations, vitually all functions that accept a error cluster will not execute if their was a preceeding error. In fact, the VI-Anaylzer will complain about error in cluster not being handled by a case structure inside a sub-VI.

I rely on this behaviour in that if I have an error reading from an I/O, I don't wnat to drive my outputs to "forever" because it looks like the value dropped to zero.

Just trying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 11
(3,094 Views)


Bob Schor wrote:
This came as a complete surprise to me, as there is no "intuitive" (or "obvious") reason for me to expect that an error would prevent a control from updating or allowing any of its properties to change.


If an error is not a reason, then what it should be an "intuitive" (or "obvious") reason ?
It is totally expected behavor.
If you want to achive , what you describe, just re-wire...... see image
0 Kudos
Message 3 of 11
(3,092 Views)
The value does not get updated because the property node does not execute if an error is sent to the errorin terminal.  Should an error occur, functions which the error is wired through will not execute so that the VI may finish and the error be reported to the user. 
-Cory
0 Kudos
Message 4 of 11
(3,085 Views)
I am aware that "good coding practice" involves incorporating an error line and encapsulating code inside an "error case statement", where the "error" condition is usually, but not always, "do nothing".  I didn't realize that, at the level of very elementary LabVIEW functions like setting a property value, the error status being true results in a "functional no-op".  As for my code, given the behavior of the error line, the proper way to "sequentially set controls" is to NOT use the property node, but to embed the control in a sequence and wire the error line through it.  This will have the behavior that I desire, and "expect" (see attached).

Bob Schor
0 Kudos
Message 5 of 11
(3,047 Views)

True

My comment was general, for every property node. For the "value" property, in this case , what you said is true.

The frames are not needed...



Message Edited by Pnt on 05-31-2008 09:06 AM
0 Kudos
Message 6 of 11
(2,996 Views)


@BOB Schor wrote:
....However, I found a "feature" that (so far) I have not seen documented -- ...

I opened up the help on property nodes and found this:

This VI or function runs normally only if no error occurred before this VI or function runs.


(it's in the description of the Error In Boolean value)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 11
(2,957 Views)
If you want to implement your desired behavior for property nodes, you can right click the property node and select Ignore Errors Inside Node, which will cause it to change the value even if there's an error. You'll get a visual indication this is selected, because the output "?!" text next to the error output will turn red.



Message Edited by Jarrod S. on 05-31-2008 11:25 PM
Jarrod S.
National Instruments
0 Kudos
Message 8 of 11
(2,942 Views)


@jarrod S. wrote:
If you want to implement your desired behavior for property nodes, you can right click the property node and select Ignore Errors Inside Node,


Jarrod,

have you tested this?
I always thought (and verfied by testing) that 'Ignore Errors Inside node' didn't forwarded an error from the first property to the second property node. So they all start with the error on the 'error in' side.
An error in stops all the properties from executing (and it should).

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 9 of 11
(2,932 Views)

Ton wrote


Jarrod,

have you tested this?


ditto that Smiley Wink

Ben

[Edit: Mis-spelled Ben Smiley Mad ]



Message Edited by Ben on 06-01-2008 09:31 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 11
(2,921 Views)