Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Continuous Data Retrieval
Forum Updated to NodeBB v4.3 + New Features

Continuous Data Retrieval

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 189 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    V0rtex
    wrote on last edited by
    #1

    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?

    JonBJ 1 Reply Last reply
    0
    • V V0rtex

      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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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 &&/||/!.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved