02-22-2013 02:38 AM
hello, when load and open the OPC directions from database, I have this error:
" the deferred callback cue is full. "
// SQL Query y conector a la tabla ...
Fmt(sqlquery,"%s<SELECT dir FROM opc_dirs ORDER BY codigo");
hstdb = DBActivateSQL ( conectdb, sqlquery);
resCode = DBBindColChar (hstdb, 1, 100, OPC_DIR, &opcdirstat, "");
// ... y obtenemos una posición a cada una de las columnas de las direcciones del OPC
if (OPC_COM){
while ((DBFetchNext (hstdb)) == DB_SUCCESS){
status = DS_Open (OPC_DIR, DSConst_ReadWriteAutoUpdate, OPC_Callback, NULL, &OPChandle[numOPC]); <-- THIS FUNCTION GENERATE THE ERROR !!!!!
if (status < 0 ){
SetCtrlVal(panelPrincipal, PANEL_MSGS, 8); // INFO: error de --> OPC
Fmt(buffer, "%s<[%s] OPC ERROR: loading OPC[%d] %s\n", TimeStr(), numOPC, OPC_DIR);
SetCtrlVal(panelLogs, LOGPANEL_TXTLOGS, buffer);
}
++numOPC;
}
}
any solution to solve it ?
thanks.
05-16-2013 08:27 AM
any solution, please ?
07-08-2013 02:23 PM
The deferred callback queue holds thread callback events that are waiting to be executed. These are generated by the PostDeferredCallback function. Internally, the DataSocket library is using PostDeferredCallToThread when handling events. However, the only time these events are processed is when GetUserEvent, RunUserInterface, or ProcessSystemEvents is called.
How many times does your while loop execute before you receive this error? If it is opens too many new DataSocket connections before the thread has an opportunity to call ProcessSystemEvents, the queue might fill up.
Add a call to ProcessSystemEvents( ) in your while loop and that should fix the problem.