dpConnect in a loop

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
bhavna
Posts:37
Joined: Mon Dec 20, 2010 1:12 pm

dpConnect in a loop

Post by bhavna »

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 ?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: dpConnect in a loop

Post by leoknipp »

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

aorange
Posts:147
Joined: Thu Nov 04, 2010 10:07 am

Re: dpConnect in a loop

Post by aorange »

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().

bhavna
Posts:37
Joined: Mon Dec 20, 2010 1:12 pm

Re: dpConnect in a loop

Post by bhavna »

Thank You.

4 posts • Page 1 of 1