LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property node standard error in functionality - odd behavior

I am getting what I would consider unusual behavior from a property node when there is an error on the error cluster input. The Help for the VI indicates this node has Standard Error In functionality, which I interpret as if there is an error on the input then the node does not run and the error is simply passed through to the output.

 

The behavior I'm getting is that the error gets passed through, but the properties of the node also get passed out with the data that was present the last time the node was called (including when it wasn't this specific node, but a different property node within the same VI that has the same property outputs).

 

In Psuedo code, this is what I'm doing:

Use Invoke node to call a method from a DLL (which sends a command to a device and gets its response).

Pass the method reference to a property node, which then outputs the properties of the method (the response from the device).

 

This works fine when everything is as it's supposed to be (device I'm communication to is connected, etc.).

If I disconnect the device completely and then run the VI again, I get the property outputs from the previous communication out of the property node, which are obviously not valid as the device isn't even connected. This happens even if the command I sent to the device is not the same; Command1 is sent and gets valid response, disconnect device, command2 is sent and I get response for command1 from the property node of command2. Command1 and command2 are in different cases of a case structure.

 

At first I thought there might be an issue with the DLL functionality (and there might be) reporting stale data, but before that is even an option it seems the property node shouldn't even be possible to have data output when the node is supposed to be bypassed entirely when an error is passed in.

 

Is this supposed to happen? Am I missing something?

 

0 Kudos
Message 1 of 5
(2,756 Views)

The property node is going to output some data even if there's an error in; it can't produce no data.  It surprises me that it's returning old data - I would have expected default values - but I think the lesson here is if you get an error out of the property node, ignore any data that comes from it.

0 Kudos
Message 2 of 5
(2,746 Views)

Yeah, I guess I didn't state that very well. I would have expected default or null values (if possible), not "no data". What's even more odd to me is that it's not only returning old data, it's returning old data from an entirely different instance of the property node.

0 Kudos
Message 3 of 5
(2,743 Views)

Also, I didn't implement any sort of error handling logic directly around the node because I wasn't expecting to have to handle this situation. I can add that in throughout the entire VI, but I'd also like to know if this is expected behavior or if I'm missing something and/or did something wrong in the first place. It just seems like odd behavior to me, so before adding in a bunch of extra logic code to every call of the property node I'm hoping there's a more elegant solution.

0 Kudos
Message 4 of 5
(2,736 Views)

Coincidentally, this week I ran into what appears to be the same behavior with the Scan from String function, and I thought of this thread.  It doesn't help solve your problem, but maybe it's useful to know that this behavior happens in other built-in functions, not just Property Nodes.  I started a new thread to look at this more generally.

0 Kudos
Message 5 of 5
(2,716 Views)