Is there any difference (in terms of performance) between
a. Calling dpConnect() in a loop 100 times to connect to 100 DPs
b. Calling dpConnect() with a list of 100 DPs ?
For eg: calling dpConnect to display read-back value of 100 power supplies in a table, which method will be more efficient ?
dpConnect in a loop
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpConnect in a loop
Hello,
the difference between these two methods is the amount of data passed to the work-function if values change.
If you use a dpConnect with a list of dp-elements you'll get in every work function the complete list of dp-elements with their current values, even if only one dp-element is changed.
If you do dpConnects with only one dp-element you'll get only one dp-element and its value in the work function, when this value is changed.
Best Regards
Leopold Knipp
Senior Support Specialist
the difference between these two methods is the amount of data passed to the work-function if values change.
If you use a dpConnect with a list of dp-elements you'll get in every work function the complete list of dp-elements with their current values, even if only one dp-element is changed.
If you do dpConnects with only one dp-element you'll get only one dp-element and its value in the work function, when this value is changed.
Best Regards
Leopold Knipp
Senior Support Specialist
- aorange
- Posts:147
- Joined: Thu Nov 04, 2010 10:07 am
Re: dpConnect in a loop
From my experience it seems more efficient to make 1 dpConnect with 100 DPE's than to call the same function 100 times with only 1 DPE. Same applies to a dpGet() and dpSet().