forked from GerhardHoffmann/DCLibraries
		
	diagnosis
This commit is contained in:
		@@ -1,3 +1,10 @@
 | 
			
		||||
/*
 | 
			
		||||
History:
 | 
			
		||||
06.12.2023: weitere IN-requests in Autorequest übernommen
 | 
			
		||||
            Umschaltung mit/ohne Verkauf, während VK nur 12 wichtige, sonst alle 36
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
#include "datIf.h"
 | 
			
		||||
#include "sendWRcmd.h"
 | 
			
		||||
#include "controlBus.h"
 | 
			
		||||
@@ -81,7 +88,8 @@ T_datif::T_datif(QObject *parent) : QObject(parent)
 | 
			
		||||
    dif_scanStep=0;
 | 
			
		||||
    selectedSlaveAddr=FIX_SLAVE_ADDR;
 | 
			
		||||
    cycl_running=0;
 | 
			
		||||
    gpi_storeDcDataValid(0);        // data are not yet valid, no response from DC by now
 | 
			
		||||
    epi_resetDcDataValid();        // data are not yet valid, no response from DC by now
 | 
			
		||||
 | 
			
		||||
    datif_noResponseCtr=0;
 | 
			
		||||
 | 
			
		||||
    datif_repeatCtr=0;
 | 
			
		||||
@@ -137,14 +145,14 @@ char T_datif::datif_cycleSend()
 | 
			
		||||
    if ( !myDCIF->isPortOpen())
 | 
			
		||||
    {
 | 
			
		||||
        //qDebug()  << "com port not available";    // wird ununterbrochen ausgegeben
 | 
			
		||||
        gpi_storeDcDataValid(0);    // DC data not valid
 | 
			
		||||
        epi_resetDcDataValid();    // DC data not valid
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // supervise if DC data are valid
 | 
			
		||||
    datif_noResponseCtr++;         // inc every 20ms
 | 
			
		||||
    if (datif_noResponseCtr>250)   // no life sign from device controller (DC) for about 3s
 | 
			
		||||
        gpi_storeDcDataValid(0);    // DC data has not updated for >=5s -> no longer valid!
 | 
			
		||||
        epi_resetDcDataValid();    // DC data has not updated for >=5s -> no longer valid!
 | 
			
		||||
 | 
			
		||||
    // Ueberwachung ob ein oder mehrere Commands am Stueck erfolgreich waren
 | 
			
		||||
    if (gpi_wantToResetSupervision())
 | 
			
		||||
@@ -337,7 +345,7 @@ char T_datif::datif_cycleSend()
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        dif_scanStep=0;         // always start from beginning
 | 
			
		||||
        gpi_storeDcDataValid(0);
 | 
			
		||||
        epi_resetDcDataValid();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    datif_cmdWasPerformed=0;    // 0: no response by now
 | 
			
		||||
@@ -362,8 +370,8 @@ char T_datif::sendINrequestsAutomatic(void)
 | 
			
		||||
    uint8_t datif_maxNrCommands=35, datif_sendNow;
 | 
			
		||||
 | 
			
		||||
    // send quicker while transaction is ongoing:
 | 
			
		||||
    uint8_t datif_vendRequCommandList[15]={102,107,108,110,112,115,116,31,32,40,41,42,0,0,0};
 | 
			
		||||
    uint8_t datif_maxVendingCmds=12;
 | 
			
		||||
    uint8_t datif_vendRequCommandList[15]={102,107,108,110,112,115,116,31,32,40,41,42,23,0,0};
 | 
			
		||||
    uint8_t datif_maxVendingCmds=13;
 | 
			
		||||
 | 
			
		||||
    // special commands:
 | 
			
		||||
    // 102: get IOs run constantly!!!
 | 
			
		||||
@@ -1029,7 +1037,7 @@ char T_datif::loadRecDataFromFrame()
 | 
			
		||||
    case 31:        // Get dynamic machine conditions (doors, voltage, alarm….)
 | 
			
		||||
        if (RdDleng>50)
 | 
			
		||||
        {
 | 
			
		||||
            gpi_storeDcDataValid(1);    // DC-Data are valid as DC responded.
 | 
			
		||||
            epi_setDcDataValid();    // DC-Data are valid as DC responded.
 | 
			
		||||
                                        // Could be set to every response but this (31)
 | 
			
		||||
                                        // is a very common and very important request
 | 
			
		||||
            gpi_storeDynMachineConditions(RdDleng, receivedData);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user