Hello everyone,
I'm curious to know if it's possible to do single queries (_DriverX.SQ), sending 'Dp Identifiers' dyn_string instead a single dpe each time.
Something like this, dpSet(_DriverX.SQ, dsDpesToSingleQuery), to reduce drasticaly the generated messages when we do it individualy.
We are doing single queries to get some data that is too poor to polling it, and we look that, while that data is being queried, a lot of messages are generated, and sometimes, it affects to the event manager.
I share below a simplied code of our script, once we have all Dp identifiers ready to query, if someone have any idea to reduce the generated messages:
for(int i=0; i<dsDpesToSingleQuery.count(); i++)
singleQuery(dsDpeDriver.at(i), dsDpesToSingleQuery.at(i), dtDpesTimeStamp.at(i));
dpSingleQuery(string sDriver, string sDpe, time tTimestampOld){
int iAttemptsDone, iMaxAttempts = 20 , iDelay = 20;
time tTimestampNew = tTimestampOld;
dpSet(sDriver+".SQ" , sDpe);
delay(0 , iDelay);
dpGet(sDpe + ":_online.._stime" , tTimestampNew);
while((tTimestampOld == tTimestampNew) & (iAttemptsDone <= iMaxAttempts)){
delay(0 , iDelay);
dpGet(sDpe + ":_online.._stime" , tTimestampNew);
iAttemptsDone++;
}
if (iAttemptsDone > iMaxAttempts)DebugTN("Error dpSingleQuery: "+sDpe);
}
Thanks!
multiples dpes on a driver single query
- pablo.chamorro
- Posts:54
- Joined: Mon Jan 27, 2020 1:42 pm
multiples dpes on a driver single query
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: multiples dpes on a driver single query
The function 'dpGetMaxAge()' might useful in your case if the used driver supports this.
Perhaps it is an option to put these addresses in a pollgroup with a (very) slow poll rate. Or only activate this poll group when if values are needed.
Otherwise a general query could be done to read all address configs.
Depending on the used driver there might be more options.
Perhaps it is an option to put these addresses in a pollgroup with a (very) slow poll rate. Or only activate this poll group when if values are needed.
Otherwise a general query could be done to read all address configs.
Depending on the used driver there might be more options.
- pablo.chamorro
- Posts:54
- Joined: Mon Jan 27, 2020 1:42 pm
Re: multiples dpes on a driver single query
I missed that dpGetMaxAge() function.
We are using S7 and S7Plus, it seems that its not supported for S7 but I will try it for S7Plus.
A general query could be a good option too but I would like to read the needed address only if its possible.
Thanks!
We are using S7 and S7Plus, it seems that its not supported for S7 but I will try it for S7Plus.
A general query could be a good option too but I would like to read the needed address only if its possible.
Thanks!
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: multiples dpes on a driver single query
In your example I cannot see which time for the delay is used.
It looks like the script can be simplified to use a dpConnect() or a dpQueryConnect() to get the values updated by the single query. Then you do not have to make a "polling" with dpGet() inside of the script.
Best Regards
Leopold Knipp
Senior Support Specialist
It looks like the script can be simplified to use a dpConnect() or a dpQueryConnect() to get the values updated by the single query. Then you do not have to make a "polling" with dpGet() inside of the script.
Best Regards
Leopold Knipp
Senior Support Specialist