Jump to content

strange thing:the difference between "Local Variable" and "Property Node"


lgk

Recommended Posts

When I use "Right Popup Menu",there are some differences between "Local Variable" and "Property Node".The "Property Node" will cause program "Pause",but "Local Variable" will not. :(

Are we talking about the node in the bottom loop in the Start Case?

The first question I have to ask is why are you considering using a Property node instead of just wiring directly to the terminal (not a Local Variable) like you have in the Local Variable version. There absolutly no reason to do this.

Not considering that, I've played with both version a bit and I don't see this pause happening with the property node. Could you give some more details on what is happening?

Ed

Link to comment
Are we talking about the node in the bottom loop in the Start Case?

The first question I have to ask is why are you considering using a Property node instead of just wiring directly to the terminal (not a Local Variable) like you have in the Local Variable version. There absolutly no reason to do this.

Not considering that, I've played with both version a bit and I don't see this pause happening with the property node. Could you give some more details on what is happening?

Ed

I'm sorry that "sine wave" should be wire to the "Local variable of the waveform graph" instead of directly to the terminal in the Local Variable version.

In the Property node version, it will not continue running until you selected an option of the right-click popup menu when the program display waveform. However, the Local Variable version will not.

The attached figures show the code differences between this two version:

post-2517-1129254651.jpg?width=400

post-2517-1129254687.jpg?width=400

Link to comment

Hi LGK:

I agree with Ed Dickens-- Unless there's a reason not to (and I can't see one) you would be better off wiring directly to the terminal, rather than either the property node or the local variable.

I don't know offhand why the property node and the local variable are behaving so differently-- perhaps someone else can help with your original question. I do recall reading about differences in another thread in the forum, but I can't remember which one.

But if you can wire directly to the terminal, you will bypass the whole question, and probably have a routine that runs faster than either of the thumbnails you've shown.

Good Luck & Best Regards, Louis

Link to comment
Hi LGK:

I agree with Ed Dickens-- Unless there's a reason not to (and I can't see one) you would be better off wiring directly to the terminal, rather than either the property node or the local variable.

I don't know offhand why the property node and the local variable are behaving so differently-- perhaps someone else can help with your original question. I do recall reading about differences in another thread in the forum, but I can't remember which one.

But if you can wire directly to the terminal, you will bypass the whole question, and probably have a routine that runs faster than either of the thumbnails you've shown.

Good Luck & Best Regards, Louis

Thanks.

The reason why I wire to "Property node" instead of directly to the terminal is that, the "sine wave" data perhaps may be wired to the different waveform graph sometimes in the different situation. So I put the references of waveform graph into an array and use them by index array. In my opinion, I feel it's easy to control the large application code by reference.

Link to comment
I'm sorry that "sine wave" should be wire to the "Local variable of the waveform graph" instead of directly to the terminal in the Local Variable version.

In the Property node version, it will not continue running until you selected an option of the right-click popup menu when the program display waveform. However, the Local Variable version will not.

The attached figures show the code differences between this two version:

Overall, you'd be better off using the Local Variable as long as you are only writting the Value to the termial. And still, only do this if you need to. Otherwise always wire directly to the terminal. Also, if you're writing to the terminal from several locations where you must use variables, wire to the terminal in one place, never leave it unwired. Try to pick the one that where it will be written to the most.

Local Variables are a bit more efficient than a Property node, but if you're also writting to another property of the node, you might as well use the Property node for both the Value and any other properties. Local Variable cause a copy of the data to be created in memory. So if you're constantly writting a large array of data to a variable, you're constantly making copies of that array.

A property node makes a copy of the data as well, but it also forces the application to switch to the user interface execution thread and update the front panel. This could be part of the pause you're seeing, but it still doesn't sound likely.

I've never seen this pause happen and I still can't duplicate it on my PC.

Ed

Link to comment
Thanks.

The reason why I wire to "Property node" instead of directly to the terminal is that, the "sine wave" data perhaps may be wired to the different waveform graph sometimes in the different situation. So I put the references of waveform graph into an array and use them by index array. In my opinion, I feel it's easy to control the large application code by reference.

LabVIEW does some optimizing when writing to terminals and local variables. Unless you set the control to update synchronously, LabVIEW only posts the new data to a buffer and signals the control that it should update without waiting for the control to redraw. The actual redrawing is done in a different thread, the UI thread, not more than 50 times a second if necessary at all. This is still much faster than even the fastest human could distinguish the data.

For the Value property LabVIEW does nothing at all like this. The property node will hang in there and only return to the diagram, after the new values have been redrawn in the control, which for a graph is typically a very lengthy operation.

So for the terminal and local variable the diagram can continue to execute other code or in the case of a loop recalculate many new data before the graph is completely redrawn, while for a value property the actual redrawing of the graph will limit the speed the loop can execute.

Consider for updating different controls depending on some other condition a case structure instead. Your programs written in such ways will typically perform much better.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.