cocowk Posted April 11, 2006 Report Share Posted April 11, 2006 Hi! I am beginner with LV. I want to know the difference between a "Value" Property Node of an indicator (integer, double or other) and a local variable pointing on this same indicator. Is there a difference in terms of performance?? Is there one solution to prefer?? Quote Link to comment
Adnan Posted April 11, 2006 Report Share Posted April 11, 2006 Read this : Performance Impact of Property Nodes Quote Link to comment
Ton Plomp Posted April 11, 2006 Report Share Posted April 11, 2006 Hi! I am beginner with LV. I want to know the difference between a "Value" Property Node of an indicator (integer, double or other) and a local variable pointing on this same indicator. Is there a difference in terms of performance?? Is there one solution to prefer?? Well cocowk, very good question for a beginner. I'm not sure how much is the difference but if you dig into the NI Forums you will find major discussions on this issue. For a quick start you could measure it yourself. Write 10000 times to a local and 10000 times to a property node and measure the time in between. Ton Quote Link to comment
Ed Dickens Posted April 11, 2006 Report Share Posted April 11, 2006 Here's a quick demo VI to show the difference. This isn't actually the best way to do this because they are fighting for processor time when all three are running, but you'll get the idea. In general, ALWAYS wire directly to the terminal when you can. If you have to update the value from somewhere else or need to write to a contrl, you should use a Local Variable. You should only use a Property Node>Value if you have to change some other property of the control/indicator. No use in taking the hit for the property node than the hit (though not much of one anymore) for the local. The artical linked above is a good explaination of what is going on in the background. Ed Download File:post-47-1144765353.vi Quote Link to comment
Dan Bookwalter Posted April 11, 2006 Report Share Posted April 11, 2006 Hi! I am beginner with LV. I want to know the difference between a "Value" Property Node of an indicator (integer, double or other) and a local variable pointing on this same indicator. Is there a difference in terms of performance?? Is there one solution to prefer?? Well on my machine i updated an I32 in a for loop 100000 times , the results : updating the terminal : 0.00021 Seconds updataing via local : 0.00032 Seconds updating via Value Property 0.25845 Seconds Dan Quote Link to comment
cocowk Posted April 11, 2006 Author Report Share Posted April 11, 2006 Here's a quick demo VI to show the difference. This isn't actually the best way to do this because they are fighting for processor time when all three are running, but you'll get the idea. In general, ALWAYS wire directly to the terminal when you can. If you have to update the value from somewhere else or need to write to a contrl, you should use a Local Variable. You should only use a Property Node>Value if you have to change some other property of the control/indicator. No use in taking the hit for the property node than the hit (though not much of one anymore) for the local. The artical linked above is a good explaination of what is going on in the background. Ed Yes I know that it is better to link directly to the terminal, but it's not possible in my case. That's why I asked the question :laugh: Thanks for all your advices. I didn't have the idea of testing this way... coco Quote Link to comment
mross Posted April 11, 2006 Report Share Posted April 11, 2006 Here's a quick demo VI to show the difference. This isn't actually the best way to do this because they are fighting for processor time when all three are running, but you'll get the idea. In general, ALWAYS wire directly to the terminal when you can. If you have to update the value from somewhere else or need to write to a contrl, you should use a Local Variable. You should only use a Property Node>Value if you have to change some other property of the control/indicator. No use in taking the hit for the property node than the hit (though not much of one anymore) for the local. The artical linked above is a good explaination of what is going on in the background. Ed I have always been curious about this but I don't have any pressing cycle time issues so I never worried about local versus prop node. Truth is I use prop nodes almost eclusively to change values, mostly boolean indicators, if that makes a difference. I realize that I will miss the error in and out if I start using locals. Mike Quote Link to comment
Ed Dickens Posted April 11, 2006 Report Share Posted April 11, 2006 mostly boolean indicators, if that makes a difference.Mike The type of control/indicator does not make a difference. They are all treated the same. If I do need to use a property node from some reason, I always set it up so that it is only written to when it needs to be. This way you get the overhead hit when needed instead of every iteration of the loop. Ed Quote Link to comment
orko Posted April 11, 2006 Report Share Posted April 11, 2006 This topic made me curious, so I added a couple of new tests to the VI in LV8. These are the results I got: Property Node: .229 sec Local: .004 sec Direct: .002 sec Shared Variable: .004 sec Global Variable: .005 sec Plus, the shared variable lets you use error in/out flow control... Note that I did not test network shared variables. Joe (orko) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.