Continuous Data Retrieval
-
Hi
There is information that I constantly get from PLC. I show a pop-up to the screen in error situations.
if(PLC_Fault_Data.powerOK and not PLC_Muhur.powerOK) { PLC_Muhur.powerOK=true; ShowMessage(tr("Güç Kesildi.")); writeToLogTableError(tr("Güç Kesildi.")); SendEmail(tr("Hata"),tr("Güç Kesildi."),false,"",""); } else if (not PLC_Fault_Data.powerOK and PLC_Muhur.powerOK) { PLC_Muhur.phaseFault=false; }
PLC_Fault_Data My boolean info from PLC.
PLC_Muhur, on the other hand, is a structure that I only use on the rising edge and the falling edge.Since the program is constantly running, with this method, I only pop-up once on the screen when an error occurs.
Is there a better way? -
@V0rtex said in Continuous Data Retrieval:
Since the program is constantly running, with this method, I only pop-up once on the screen when an error occurs.
Why? I don't follow what makes it only pop-up once. If you want more than once, clear whatever error condition so that you can re-detect next time and re-show?
I would have thought this code is running in a thread, since you say it is "constantly running"? If so this thread cannot show a UI pop-up, you must emit a signal for the UI to slot onto and display a message?
Separate issue: do you really want to write C++ using
and
/or
/not
? I know they "work", but 99% of the rest of the world use&&
/||
/!
.