Ankündigung

Einklappen
Keine Ankündigung bisher.

LBS: 19001030: Modbus TCP Master Read

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • gulp2k
    antwortet
    Sorry... das kommt davon wenn man nicht richtig debuggen kann
    E1 & E7 sollten jetzt richtig ausgewertet werden und Daten sollten auch wieder kommen...
    PHP-Code:
    ###[DEF]###
    [name =     ModBus TCP Master Read]
    [e#1 trigger=         Autostart #init=1]
    [e#2 important=         Host #init=e3dc.knx.pattison.de] ModBus Slave IP or Host
    [e#3 optional=         Port #init=502] Modbus Port
    [e#4 =         Mode 0/1 #init=1] 0 UDP, 1 TCP
    [e#5 optional=         SlaveID #init=0]
    [e#6 =         Logging #init=6]
    [e#7 =        Loop #init=0]
    [e#8 =        Delay #init=1000]
    [e#9 important=         Address1 #init=40072]
    [e#10 important=     Length1 #init=1] #Word size=2bytes
    [e#11 important=     Type1 #init=0] 0=Int, 1=uInt, 2=String
    [e#12 important=        Function1 #init=3]
    [e#13 option=Address2]
    [e#14 option=Length2]
    [e#15 option=Type2]
    [e#16 option=Function2 #init=3]
    [e#17 option=Address3]
    [e#18 option=Length3]
    [e#19 option=Type3]
    [e#20 option=Function3 #init=3]
    [e#21 option=Address4]
    [e#22 option=Lengt4]
    [e#23 option=Type4]
    [e#24 option=Function4 #init=3]
    [e#25 option=Address5]
    [e#26 option=Length5]
    [e#27 option=Type5]
    [e#28 option=Function5 #init=3]

    [a#1 = Value1]
    [a#2 = Value2]
    [a#3 = Value3]
    [a#4 = Value4]
    [a#5 = Value5]
    [a#9 = Trigger Ext]
    [a#10 = Error]

    [v#1             = 0 ]
    [v#2             = 0 ]
    [v#3                   = 0 ]
    [v#4             = 0 ]
    [v#5             = 0]
    [v#100           = 0.5 ]
    [v#101           = 19001030 ]
    [v#102           = ModBusMaster Read]
    [v#103           = 0 ]
    [v#104           = 0 ]
    [v#105           = 0 ]
    ###[/DEF]###


    ###[HELP]###

    INSTALLATION:
    This LBS requires phpmodbus.php to be present on Edomi.
    You can either copy the included zip file and extract the content to /usr/local/edomi/main/include/php/ or
    download phpModbus yourself. The version included is slightly modified to reduce logging output.

    USAGE:
    This LSB allows to query up to 5 Values from a Modbus TCP Slave.
    It can either run once on a trigger or run continously.
    E2 is the IP or Hostname, E3 the Port wich should default to 502.
    E4 is TCP or UDP Connection and E5 is the Slave ID which is usually not changed.
    E6: Sets the Logging Level meinly 0 or 8 for debug. In debug mode it will write a lot so be warned!
    E7: Loop or no Loop
    E8 is the delay in ms between loops, default is 1000 which is 1s.
    E9 is mandatory address where we start to read. Be aware that addresses are counted from 0 but not all documentation take this into account.
    You might need to play with Address+-1 to get good values.
    E10 is the length of data we read in Dword! Meaning 1 is 2 bytes long. Again check the device doc.
    E11 is the data type that is returned so the LBS can convert accordingly.
    E12 is the Function to use, at the moment only F03 is implemented!
    From now it just repeats for differents inputs.
    The Result is the put to A1 to A5.
    A9 is a trigger that can be used to cascade several LBS. After each run but before the delay starts it will be triggerd with a 1.
    A10 indicates an error which usually means the LBS has stopped and need to be restarted.


    E1: Autostart, Default=1
    E2: Host or IP of Modbus Slave
    E3: Port (Currently not used)
    E4: Mode: 0=UDP, 1=TCP
    E5: Modbus Slave ID, Default=1
    E6: Logging, 0=none, 8=Debuggen
    E7: Loop, Default=0, 0=False=Run once,1=True=Run till Edomi END
    E8: Delay between runs in ms, Default=1000 (1sec)
    E9: Address1 Datapoint
    E10: Lenght to read 1, Default=1 (1=1 Dword=2 Bytes)
    E11: Type of Data returned 1, 0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String, 6=Swap Float
    E12: Function to use (Currently only FC3 Read_Multiple_Registers is implemented)
    E13: Address2 (see E9)
    E14: Length2 (see E10)
    E15: Type2 (see E11)
    E16: Function2 (see E12)
    E17: Address3 (see E9)
    E18: Length3 (see E10)
    E19: Type3 (see E11)
    E20: Function3 (see E12)
    E21: Address4 (see E9)
    E22: Length4 (see E10)
    E23: Type4 (see E11)
    E24: Function4 (see E12)
    E25: Address5 (see E9)
    E26: Length5 (see E10)
    E27: Type5 (see E11)
    E28: Function5 (see E12)

    A1: Result of Query 1
    A2: Result of Query 2
    A3: Result of Query 3
    A4: Result of Query 4
    A5: Result of Query 5
    A9: Trigger ext, Can be used to chain LBS together, will send a 1 at the end of each loop
    A10: Triggers on Daemon Error 1=Generic Error, 2=Timeout Error

    V1: Indicator whether daemon is running
    V2: PID of EXEC Daemon
    V3: Array of used Inputs
    V4: Endianness 0/1
    V5: Timout Counter
    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level
    V104: One log file per LBS instance
    V105: log ID in each log entry

    #Changelog
    v0.1 Initial version
    v0.2 small bugfix + new Datatype "Swap Float"
    v0.3 "Swap Float" fix
    v0.4 Implemented Endianess Setting in V4
    v0.5 Refactoring of EXEC part to avoid potential Memory Leak. EXEC Part is not a daemon anymore. increased Debug Output.
    v0.6 Suppress wrong data due to corrupted Modbus Message
    ###[/HELP]###

    ###[LBS]###
    <?
    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
      $E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '', $logName);
        if (logic_getVar($id, 104))
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }

    function LB_LBSID($id) {




      if ($E=logic_getInputs($id)) {
        $loop=$E[7]['value'];
        $delay=$E[8]['value'];
        if (logic_getState($id)==1 && $E[1]['value']==0){
          logic_setState($id,0);
          LB_LBSID_logging($id, 'LBS ended');
        } else {
          setLogicElementVar($id, 103, $E[6]['value']); // set loglevel to #VAR 103
          if (logic_getState($id)==0) {
            LB_LBSID_logging($id, 'LBS started');
          }
          $activeInputs=array();
          if ($E[9]['value']!=""){
            $activeInputs[]=9;
          }
          if ($E[13]['value']!=""){
            $activeInputs[]=13;
          }
          if ($E[17]['value']!=""){
            $activeInputs[]=17;
          }
          if ($E[21]['value']!=""){
            $activeInputs[]=21;
          }
          if ($E[25]['value']!=""){
            $activeInputs[]=25;
          }

          setLogicElementVar($id,3,implode(";",$activeInputs));
          if (getLogicElementVar($id,1)!=1) {
            setLogicElementVar($id,5,1);
            setLogicElementVar($id,1,1);                        //setzt V1=1, um einen mehrfachen Start des EXEC-Scripts zu verhindern
            callLogicFunctionExec(LBSID,$id);                 //EXEC-Script starten (garantiert nur einmalig)
          } elseif (logic_getVar($id,5)>9){
            setLogicElementVar($id,5,0);
            setLogicElementVar($id,1,0);
            logic_SetOutput($id,10,2);
          } else {
            $v5=logic_getVar($id,5);
            logic_setVar($id,5,$v5+1);
          }
          if ($loop=1){
                logic_setState($id,1,$delay);
            } else {
              logic_setState($id,0);
            }
        }

      }
    }
    ?>
    ###[/LBS]###
    ###[EXEC]###
    <?
    require(dirname(__FILE__)."/../../../../main/include/php/incl_lbsexec.php");
    require_once(dirname(__FILE__)."/../../../../main/include/php/ModbusMaster.php");
    set_time_limit(0);                                       //Wichtig! Script soll endlos laufen
    sql_connect();
    logging($id, "START ModbusMaster Exec",null,6);
    setLogicElementVar($id, 2, getmypid());
    $suppressModBusError='0';
    //
    // error_off() : switch off error reporting
    // error_on() : switch on error reporting
    //
    function myErrorHandler($errno, $errstr, $errfile, $errline)
    {
      global $id;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')OR($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }
    function myErrorHandlerModBus($errno, $errstr, $errfile, $errline)
    {
      global $id, $suppressModBusError;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')){
        $suppressModBusError='1';
        logging($id, "Corrupt ModBus Message received");
        return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }

    function error_off()
    {
      $error_handler = set_error_handler("myErrorHandler");
      error_reporting(0);
    }

    function error_on()
    {
      restore_error_handler();
      error_reporting(E_ALL);
    }

    function logging($id, $msg, $var = NULL, $priority = 8)
    {
      //$E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '_', $logName);
        if (logic_getVar($id, 104) == 1)
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }


    date_default_timezone_set('Europe/Berlin');

    error_off();


    if ($E=getLogicEingangDataAll($id)) {
      $endianness=getLogicElementVar($id, 4);
      $v3=getLogicElementVar($id, 3);
      $inputs=explode(";",$v3);
      $querys=array();
      logging($id,"v3:" . $v3);
      logging($id,"inputs:" , $inputs);
      $retries=0;

      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));

      //$Looping = true;
      //while (getSysInfo(1)>=1 AND $Looping){
      //logging($id,"Memory before New ModBusMaster: " . (string)memory_get_usage());
      // Create Modbus object
      $modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
      //logging($id,"Memory after New ModBusMaster: " . (string)memory_get_usage());
      for($i = 0, $groesse = count($inputs); $i < $groesse; ++$i) {
        logging($id,"i:" . $i . "; input:" . $inputs[$i] . "; address:" . $E[$inputs[$i]]['value'] . "; length:" . $E[$inputs[$i]+1]['value'] . "; type:" . $E[$inputs[$i]+2]['value']);
        //logging($id,"i:" . $i);
        //logging($id,"input:" . $inputs[$i]);
        //logging($id,"address:" . $E[$inputs[$i]]['value']);
        //$query=Array('address'=>$E[$inputs[$i]]['value'],'length'=>$E[$inputs[$i]+1]['value'],'type'=>$E[$inputs[$i]+2]['value'],'function'=>$E[$inputs[$i]+3]['value']);
        //logging($id,"Query:" , $query);
        //$querys[]=$query;

        //logging($id,"Querys:" , $querys);


        //for($i = 0, $groesse = count($querys); $i < $groesse; ++$i) {
        try {
          // FC 3
          if ($E[$inputs[$i]+3]['value']==3){
            set_error_handler("myErrorHandlerModBus");
            $suppressModBusError='0';
            $recData = $modbus->readMultipleRegisters($E[5]['value'], $E[$inputs[$i]]['value'], $E[$inputs[$i]+1]['value']);
            restore_error_handler();
            //logging($id,"Memory after Read: " . (string)memory_get_usage());
          }
        }
        catch (Exception $e) {
          // Print error information if any
          logging($id, "Modbus Error: ", $modbus,4);
          logging($id, "Modbus Error: ", $e,4);
          logging($id, "Retries:" . $retries);
          //logging($id,"Memory in error: " . (string)memory_get_usage(),4);
          if ($retries<3){
            $retries+=1;
            break;
          }else{
            setLogicLinkAusgang($id,10,1); //send error to A10
            setLogicElementVar($id,1,0);  //allow to restart
            logging($id, "Error: Retry counter reached max. Exiting!",null,4);
            exit;
          }
        }
        // Print status information
        logging($id,"Status:" . $modbus);

        // Print read data
        if (isset($recData) AND $recData!=false AND $suppressModBusError=='0'){
          logging($id,"Type:" . $E[$inputs[$i]+2]['value'] . "Raw Data:",$recData);
          //0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String
          if ($E[$inputs[$i]+2]['value']==0){
            $ret=PhpType::bytes2signedInt($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==1){
            logging($id,"unsigned start");
            $ret=PhpType::bytes2unsignedInt($recData, $endianness);
            logging($id,"unsigned stop");
          }elseif ($E[$inputs[$i]+2]['value']==2){
            $ret=PhpType::bytes2float($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==3){
            $ret=$recData[0];
          }elseif ($E[$inputs[$i]+2]['value']==4){
            $ret=0;
          }elseif ($E[$inputs[$i]+2]['value']==5){
            $ret=PhpType::bytes2string($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==6){
            if (getLogicElementVar($id, 4) == 0){
              $ret = (($recData[3] & 0xFF)) |
              (($recData[2] & 0xFF)<<8) |
              (($recData[1] & 0xFF))<<16 |
              (($recData[0] & 0xFF)<<24);
            }else{
              $ret = (($recData[3] & 0xFF)<<24) |
              (($recData[2] & 0xFF)<<16) |
              (($recData[1] & 0xFF)<<8) |
              (($recData[0] & 0xFF));
            }
            $ulong = pack('L*', $ret);
            $float = unpack('f*', $ulong);
            $ret = $float[1];
          }


          logging($id,"Data:" . $ret);
          setLogicLinkAusgang($id,$i+1,$ret);
        }
      }
      //Loop
      //if ($E[7]['value']==0){
      //  $Looping=false;
      //  logging($id,"Looping:" . var_export($Looping,true));
      //}
      setLogicLinkAusgang($id,9,1);
      //Delay
      //logging($id,"Delay:" . $E[8]['value']);
      unset($modbus);
      //usleep(1000*$E[8]['value']);
      setLogicLinkAusgang($id,9,0);
      logging($id,"end of delay");
      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
    }
    //}

    setLogicElementVar($id,1,0); //allow to restart
    //logging($id,"Memory at End: " . (string)memory_get_usage());
    logging($id, "STOP ModbusMaster EXEC",null,6);
    error_on();
    sql_disconnect();
    ?>
    ###[/EXEC]###

    Einen Kommentar schreiben:


  • hx5
    antwortet
    Er liefert jetzt gar keine Werte mehr:

    Code:
     [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]
    [TR]
    [TD]Zeitstempel[/TD]
     			[TD]ms[/TD]
     			[TD]PID[/TD]
     			[TD]LogLevel[/TD]
     			[TD]Meldung[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]153646[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]156799[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]157118[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]157174[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]157210[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]157236[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]157445[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]281922[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]282284[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 10bb00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 10bb0000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]283041[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:51[/TD]
     			[TD]283858[/TD]
     			[TD]15545[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]207839[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209269[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209512[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209549[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209589[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209614[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]209820[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]387053[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]387521[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 252200000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 25220000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]388631[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:05:56[/TD]
     			[TD]389628[/TD]
     			[TD]15550[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]278615[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]279949[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]280221[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]280273[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]280327[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]280365[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]280682[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]333479[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: b9e400000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: b9e40000000703030400000d58[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]335902[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:01[/TD]
     			[TD]337743[/TD]
     			[TD]15555[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]342735[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]344336[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]344621[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]344671[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]344717[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]344806[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]345093[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]443506[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]444746[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 313100000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 31310000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]447352[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:06[/TD]
     			[TD]450418[/TD]
     			[TD]15560[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]413157[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415190[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415595[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415633[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415676[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415703[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]415905[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]539320[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 6d4900000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 6d490000000703030400000d4e[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]542531[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:11[/TD]
     			[TD]545424[/TD]
     			[TD]15565[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]484291[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]485845[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]486052[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]486088[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]486124[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]486149[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]486387[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]639353[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 11a000000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 11a00000000703030400000d3f[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]642385[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:16[/TD]
     			[TD]645670[/TD]
     			[TD]15570[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]540762[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]542440[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]542733[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]542783[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]542830[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]542865[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]543138[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]588356[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]589142[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 35ee00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 35ee0000000703030400000c[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]590915[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:21[/TD]
     			[TD]592856[/TD]
     			[TD]15575[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]607162[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]608694[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]608977[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]609025[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]609070[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]609103[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]609433[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]699707[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: f3af00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: f3af0000000703030400000d02[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]703003[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:26[/TD]
     			[TD]706091[/TD]
     			[TD]15580[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]680160[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]681653[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]681955[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]682004[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]682054[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]682090[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]682375[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]799848[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 3d4b00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 3d4b0000000703030400000d27[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]804290[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:31[/TD]
     			[TD]807347[/TD]
     			[TD]15590[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]740413[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]741674[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]741893[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]741929[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]741971[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]741997[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]742245[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]915498[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 5b3100000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 5b310000000703030400000d52[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]918488[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:36[/TD]
     			[TD]921602[/TD]
     			[TD]15596[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]785878[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]787333[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]787616[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]787663[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]787763[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]787803[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]788080[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]865050[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]866190[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: a90f00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: a90f0000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]868681[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:41[/TD]
     			[TD]871547[/TD]
     			[TD]15601[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]850992[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854053[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854321[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854368[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854408[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854614[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]854871[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]968550[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]968909[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: cf0d00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: cf0d0000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]969602[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:46[/TD]
     			[TD]970364[/TD]
     			[TD]15609[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]910779[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912161[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912429[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912475[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912568[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912606[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:51[/TD]
     			[TD]912872[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:52[/TD]
     			[TD]079730[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: a32c00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: a32c0000000703030400000d5a[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:52[/TD]
     			[TD]083489[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:52[/TD]
     			[TD]086443[/TD]
     			[TD]15616[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]013422[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]014636[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]014846[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]014880[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]014916[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]014942[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]015141[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]114979[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Corrupt ModBus Message received[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]116537[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 53b300000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 53b30000000703030400000d[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]119229[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-16 13:06:53[/TD]
     			[TD]122227[/TD]
     			[TD]15620[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [/TABLE]
    Und E1 und E7 scheinen immer noch nicht ausgewertet zu werden.

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    Sorry... Noch ein Copy&Past Error...
    Damit sollte jetzt bei einem "Ungültigen Paket" ein Fehler geloggt werden aber keine Daten aus dem LBS kommen.
    PHP-Code:
    ###[DEF]###
    [name =     ModBus TCP Master Read]
    [e#1 trigger=         Autostart #init=1]
    [e#2 important=         Host #init=e3dc.knx.pattison.de] ModBus Slave IP or Host
    [e#3 optional=         Port #init=502] Modbus Port
    [e#4 =         Mode 0/1 #init=1] 0 UDP, 1 TCP
    [e#5 optional=         SlaveID #init=0]
    [e#6 =         Logging #init=6]
    [e#7 =        Loop #init=0]
    [e#8 =        Delay #init=1000]
    [e#9 important=         Address1 #init=40072]
    [e#10 important=     Length1 #init=1] #Word size=2bytes
    [e#11 important=     Type1 #init=0] 0=Int, 1=uInt, 2=String
    [e#12 important=        Function1 #init=3]
    [e#13 option=Address2]
    [e#14 option=Length2]
    [e#15 option=Type2]
    [e#16 option=Function2 #init=3]
    [e#17 option=Address3]
    [e#18 option=Length3]
    [e#19 option=Type3]
    [e#20 option=Function3 #init=3]
    [e#21 option=Address4]
    [e#22 option=Lengt4]
    [e#23 option=Type4]
    [e#24 option=Function4 #init=3]
    [e#25 option=Address5]
    [e#26 option=Length5]
    [e#27 option=Type5]
    [e#28 option=Function5 #init=3]

    [a#1 = Value1]
    [a#2 = Value2]
    [a#3 = Value3]
    [a#4 = Value4]
    [a#5 = Value5]
    [a#9 = Trigger Ext]
    [a#10 = Error]

    [v#1             = 0 ]
    [v#2             = 0 ]
    [v#3                   = 0 ]
    [v#4             = 0 ]
    [v#5             = 0]
    [v#100           = 0.5 ]
    [v#101           = 19001030 ]
    [v#102           = ModBusMaster Read]
    [v#103           = 0 ]
    [v#104           = 0 ]
    [v#105           = 0 ]
    ###[/DEF]###


    ###[HELP]###

    INSTALLATION:
    This LBS requires phpmodbus.php to be present on Edomi.
    You can either copy the included zip file and extract the content to /usr/local/edomi/main/include/php/ or
    download phpModbus yourself. The version included is slightly modified to reduce logging output.

    USAGE:
    This LSB allows to query up to 5 Values from a Modbus TCP Slave.
    It can either run once on a trigger or run continously.
    E2 is the IP or Hostname, E3 the Port wich should default to 502.
    E4 is TCP or UDP Connection and E5 is the Slave ID which is usually not changed.
    E6: Sets the Logging Level meinly 0 or 8 for debug. In debug mode it will write a lot so be warned!
    E7: Loop or no Loop
    E8 is the delay in ms between loops, default is 1000 which is 1s.
    E9 is mandatory address where we start to read. Be aware that addresses are counted from 0 but not all documentation take this into account.
    You might need to play with Address+-1 to get good values.
    E10 is the length of data we read in Dword! Meaning 1 is 2 bytes long. Again check the device doc.
    E11 is the data type that is returned so the LBS can convert accordingly.
    E12 is the Function to use, at the moment only F03 is implemented!
    From now it just repeats for differents inputs.
    The Result is the put to A1 to A5.
    A9 is a trigger that can be used to cascade several LBS. After each run but before the delay starts it will be triggerd with a 1.
    A10 indicates an error which usually means the LBS has stopped and need to be restarted.


    E1: Autostart, Default=1
    E2: Host or IP of Modbus Slave
    E3: Port (Currently not used)
    E4: Mode: 0=UDP, 1=TCP
    E5: Modbus Slave ID, Default=1
    E6: Logging, 0=none, 8=Debuggen
    E7: Loop, Default=0, 0=False=Run once,1=True=Run till Edomi END
    E8: Delay between runs in ms, Default=1000 (1sec)
    E9: Address1 Datapoint
    E10: Lenght to read 1, Default=1 (1=1 Dword=2 Bytes)
    E11: Type of Data returned 1, 0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String, 6=Swap Float
    E12: Function to use (Currently only FC3 Read_Multiple_Registers is implemented)
    E13: Address2 (see E9)
    E14: Length2 (see E10)
    E15: Type2 (see E11)
    E16: Function2 (see E12)
    E17: Address3 (see E9)
    E18: Length3 (see E10)
    E19: Type3 (see E11)
    E20: Function3 (see E12)
    E21: Address4 (see E9)
    E22: Length4 (see E10)
    E23: Type4 (see E11)
    E24: Function4 (see E12)
    E25: Address5 (see E9)
    E26: Length5 (see E10)
    E27: Type5 (see E11)
    E28: Function5 (see E12)

    A1: Result of Query 1
    A2: Result of Query 2
    A3: Result of Query 3
    A4: Result of Query 4
    A5: Result of Query 5
    A9: Trigger ext, Can be used to chain LBS together, will send a 1 at the end of each loop
    A10: Triggers on Daemon Error 1=Generic Error, 2=Timeout Error

    V1: Indicator whether daemon is running
    V2: PID of EXEC Daemon
    V3: Array of used Inputs
    V4: Endianness 0/1
    V5: Timout Counter
    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level
    V104: One log file per LBS instance
    V105: log ID in each log entry

    #Changelog
    v0.1 Initial version
    v0.2 small bugfix + new Datatype "Swap Float"
    v0.3 "Swap Float" fix
    v0.4 Implemented Endianess Setting in V4
    v0.5 Refactoring of EXEC part to avoid potential Memory Leak. EXEC Part is not a daemon anymore. increased Debug Output.
    v0.6 Suppress wrong data due to corrupted Modbus Message
    ###[/HELP]###

    ###[LBS]###
    <?
    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
      $E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '', $logName);
        if (logic_getVar($id, 104))
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }

    function LB_LBSID($id) {




      if ($E=logic_getInputs($id)) {
        $loop=$E[7]['value'];
        $delay=$E[8]['value'];
        if (logic_getState($id)==1 && $E[1]==0){
          logic_setState($id,0);
          LB_LBSID_logging($id, 'LBS ended');
        } else {
          setLogicElementVar($id, 103, $E[6]['value']); // set loglevel to #VAR 103
          if (logic_getState($id)==0) {
            LB_LBSID_logging($id, 'LBS started');
          }
          $activeInputs=array();
          if ($E[9]['value']!=""){
            $activeInputs[]=9;
          }
          if ($E[13]['value']!=""){
            $activeInputs[]=13;
          }
          if ($E[17]['value']!=""){
            $activeInputs[]=17;
          }
          if ($E[21]['value']!=""){
            $activeInputs[]=21;
          }
          if ($E[25]['value']!=""){
            $activeInputs[]=25;
          }

          setLogicElementVar($id,3,implode(";",$activeInputs));
          if (getLogicElementVar($id,1)!=1) {
            setLogicElementVar($id,5,1);
            setLogicElementVar($id,1,1);                        //setzt V1=1, um einen mehrfachen Start des EXEC-Scripts zu verhindern
            callLogicFunctionExec(LBSID,$id);                 //EXEC-Script starten (garantiert nur einmalig)
          } elseif (logic_getVar($id,5)>9){
            setLogicElementVar($id,5,0);
            setLogicElementVar($id,1,0);
            logic_SetOutput($id,10,2);
          } else {
            $v5=logic_getVar($id,5);
            logic_setVar($id,5,$v5+1);
          }
          if ($loop=1){
                logic_setState($id,1,$delay);
            }
        }

      }
    }
    ?>
    ###[/LBS]###
    ###[EXEC]###
    <?
    require(dirname(__FILE__)."/../../../../main/include/php/incl_lbsexec.php");
    require_once(dirname(__FILE__)."/../../../../main/include/php/ModbusMaster.php");
    set_time_limit(0);                                       //Wichtig! Script soll endlos laufen
    sql_connect();
    logging($id, "START ModbusMaster Exec",null,6);
    setLogicElementVar($id, 2, getmypid());
    $suppressModBusError='0';
    //
    // error_off() : switch off error reporting
    // error_on() : switch on error reporting
    //
    function myErrorHandler($errno, $errstr, $errfile, $errline)
    {
      global $id;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')OR($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }
    function myErrorHandlerModBus($errno, $errstr, $errfile, $errline)
    {
      global $id, $suppressModBusError;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')){
        $suppressModBusError='1';
        logging($id, "Corrupt ModBus Message received");
        return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }

    function error_off()
    {
      $error_handler = set_error_handler("myErrorHandler");
      error_reporting(0);
    }

    function error_on()
    {
      restore_error_handler();
      error_reporting(E_ALL);
    }

    function logging($id, $msg, $var = NULL, $priority = 8)
    {
      //$E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '_', $logName);
        if (logic_getVar($id, 104) == 1)
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }


    date_default_timezone_set('Europe/Berlin');

    error_off();


    if ($E=getLogicEingangDataAll($id)) {
      $endianness=getLogicElementVar($id, 4);
      $v3=getLogicElementVar($id, 3);
      $inputs=explode(";",$v3);
      $querys=array();
      logging($id,"v3:" . $v3);
      logging($id,"inputs:" , $inputs);
      $retries=0;

      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));

      //$Looping = true;
      //while (getSysInfo(1)>=1 AND $Looping){
      //logging($id,"Memory before New ModBusMaster: " . (string)memory_get_usage());
      // Create Modbus object
      $modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
      //logging($id,"Memory after New ModBusMaster: " . (string)memory_get_usage());
      for($i = 0, $groesse = count($inputs); $i < $groesse; ++$i) {
        logging($id,"i:" . $i . "; input:" . $inputs[$i] . "; address:" . $E[$inputs[$i]]['value'] . "; length:" . $E[$inputs[$i]+1]['value'] . "; type:" . $E[$inputs[$i]+2]['value']);
        //logging($id,"i:" . $i);
        //logging($id,"input:" . $inputs[$i]);
        //logging($id,"address:" . $E[$inputs[$i]]['value']);
        //$query=Array('address'=>$E[$inputs[$i]]['value'],'length'=>$E[$inputs[$i]+1]['value'],'type'=>$E[$inputs[$i]+2]['value'],'function'=>$E[$inputs[$i]+3]['value']);
        //logging($id,"Query:" , $query);
        //$querys[]=$query;

        //logging($id,"Querys:" , $querys);


        //for($i = 0, $groesse = count($querys); $i < $groesse; ++$i) {
        try {
          // FC 3
          if ($E[$inputs[$i]+3]['value']==3){
            set_error_handler("myErrorHandlerModBus");
            $suppressModBusError='0';
            $recData = $modbus->readMultipleRegisters($E[5]['value'], $E[$inputs[$i]]['value'], $E[$inputs[$i]+1]['value']);
            restore_error_handler();
            //logging($id,"Memory after Read: " . (string)memory_get_usage());
          }
        }
        catch (Exception $e) {
          // Print error information if any
          logging($id, "Modbus Error: ", $modbus,4);
          logging($id, "Modbus Error: ", $e,4);
          logging($id, "Retries:" . $retries);
          //logging($id,"Memory in error: " . (string)memory_get_usage(),4);
          if ($retries<3){
            $retries+=1;
            break;
          }else{
            setLogicLinkAusgang($id,10,1); //send error to A10
            setLogicElementVar($id,1,0);  //allow to restart
            logging($id, "Error: Retry counter reached max. Exiting!",null,4);
            exit;
          }
        }
        // Print status information
        logging($id,"Status:" . $modbus);

        // Print read data
        if (isset($recData) AND $recData!=false AND $suppressModBusError='0'){
          logging($id,"Type:" . $E[$inputs[$i]+2]['value'] . "Raw Data:",$recData);
          //0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String
          if ($E[$inputs[$i]+2]['value']==0){
            $ret=PhpType::bytes2signedInt($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==1){
            logging($id,"unsigned start");
            $ret=PhpType::bytes2unsignedInt($recData, $endianness);
            logging($id,"unsigned stop");
          }elseif ($E[$inputs[$i]+2]['value']==2){
            $ret=PhpType::bytes2float($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==3){
            $ret=$recData[0];
          }elseif ($E[$inputs[$i]+2]['value']==4){
            $ret=0;
          }elseif ($E[$inputs[$i]+2]['value']==5){
            $ret=PhpType::bytes2string($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==6){
            if (getLogicElementVar($id, 4) == 0){
              $ret = (($recData[3] & 0xFF)) |
              (($recData[2] & 0xFF)<<8) |
              (($recData[1] & 0xFF))<<16 |
              (($recData[0] & 0xFF)<<24);
            }else{
              $ret = (($recData[3] & 0xFF)<<24) |
              (($recData[2] & 0xFF)<<16) |
              (($recData[1] & 0xFF)<<8) |
              (($recData[0] & 0xFF));
            }
            $ulong = pack('L*', $ret);
            $float = unpack('f*', $ulong);
            $ret = $float[1];
          }


          logging($id,"Data:" . $ret);
          setLogicLinkAusgang($id,$i+1,$ret);
        }
      }
      //Loop
      //if ($E[7]['value']==0){
      //  $Looping=false;
      //  logging($id,"Looping:" . var_export($Looping,true));
      //}
      setLogicLinkAusgang($id,9,1);
      //Delay
      //logging($id,"Delay:" . $E[8]['value']);
      unset($modbus);
      //usleep(1000*$E[8]['value']);
      setLogicLinkAusgang($id,9,0);
      logging($id,"end of delay");
      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
    }
    //}

    setLogicElementVar($id,1,0); //allow to restart
    //logging($id,"Memory at End: " . (string)memory_get_usage());
    logging($id, "STOP ModbusMaster EXEC",null,6);
    error_on();
    sql_disconnect();
    ?>
    ###[/EXEC]###

    Einen Kommentar schreiben:


  • hx5
    antwortet
    Habe es nochmal wiederholt. Bis jetzt keine Fehlermeldungen seitens Edomi aber die Fehlermeldung bleibt:

    Code:
     [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]
    [TR]
    [TD]Zeitstempel[/TD]
     			[TD]ms[/TD]
     			[TD]PID[/TD]
     			[TD]LogLevel[/TD]
     			[TD]Meldung[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]476607[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]477749[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]477962[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]477998[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]478029[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]478055[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]478291[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]634231[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: cde000000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: cde000000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]635205[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:24:58[/TD]
     			[TD]636034[/TD]
     			[TD]23832[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]586790[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588232[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588514[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588562[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588606[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588639[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]588953[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]735815[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 323800000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 323800000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]739274[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:03[/TD]
     			[TD]742590[/TD]
     			[TD]23837[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]644635[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]645787[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]646034[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]646070[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]646101[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]646126[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]646321[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]685142[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 550c00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 550c00000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]687304[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:08[/TD]
     			[TD]689554[/TD]
     			[TD]23842[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]692500[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]693618[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]693845[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]693883[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]693917[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]693942[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]694138[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]784369[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 4e2700000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 4e2700000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]785324[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 21:25:13[/TD]
     			[TD]786237[/TD]
     			[TD]23847[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [/TABLE]
    Mach dir nur wegen mir keinen Stress. Ich kann auch versuchen die Daten vom Webportal zu lesen, dazu gibt es auch schon einen LBS.

    Einen Kommentar schreiben:


  • hx5
    antwortet
    Muss heute Abend nochmal schauen, glaube da lief was schief.

    Edomi-Error-log:
    Code:
     [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]
    [TR]
    [TD]2017-05-15 18:08:12[/TD]
     			[TD]468796[/TD]
     			[TD]?[/TD]
     			[TD]11837[/TD]
     			[TD]Datei: /usr/local/edomi/www/data/liveproject/lbs/EXE19001030.php | Fehlercode: 2 | Zeile: 27 | set_error_handler() expects the argument (myErrorHandler) to be a valid callback[/TD]
     			[TD]ERROR[/TD]
     		[/TR]
    [/TABLE]
    Modbus:
    Code:
     [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]490329[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]491604[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]491816[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]491851[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]491884[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]491909[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]492155[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]550869[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 0a4600000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 0a4600000007030304000004[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]551928[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:17[/TD]
     			[TD]552902[/TD]
     			[TD]11851[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]554802[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]555951[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]556154[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]556189[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]556221[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]556246[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]556444[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]657746[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 6c9700000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 6c9700000007030304000004e2[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]664539[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:22[/TD]
     			[TD]669143[/TD]
     			[TD]11856[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]613231[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: START ModbusMaster Exec[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614370[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: v3:9[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614578[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: inputs:[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614614[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT START ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614645[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ["9"][/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614669[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: ================ ARRAY/OBJECT END ================[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]614860[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: i:0; input:9; address:30775; length:2; type:1[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]757108[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 3b1a00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 3b1a00000007030304000004de[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]759989[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: end of delay[/TD]
     		[/TR]
    [TR]
    [TD]2017-05-15 18:08:27[/TD]
     			[TD]762612[/TD]
     			[TD]11861[/TD]
     			[TD]debug[/TD]
     			[TD]EXE19001030 [v0.5]: STOP ModbusMaster EXEC[/TD]
     		[/TR]
    [/TABLE]

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    Sorry, mein Fehler, hatte da was übersehen. ist aber nicht kritisch gewesen.
    Bitte nochmals diese Funktion ersetzten:
    PHP-Code:
    function myErrorHandlerModBus($errno$errstr$errfile$errline)
    {
      global 
    $id;
      if((
    $errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')OR($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      if((
    $errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8')){
        
    $GLOBALS["suppressModBusError"]='1';
        
    logging($id"Corrupt ModBus Message received");
        return;}

      
    logging($id"File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);

    Einen Kommentar schreiben:


  • hx5
    antwortet
    Ist leider schlimmer geworden:

    Code:
    {EDOMI,CUSTOMLOG_ModBusMaster_Read-LBS19001030.htm,15.05.2017,17:19:44,098342,8647}
    Zeitstempel    ms    PID    LogLevel    Meldung
    2017-05-15 17:19:44    098197    8647    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-15 17:19:44    099792    8647    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-15 17:19:44    100039    8647    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-15 17:19:44    100090    8647    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-15 17:19:44    100209    8647    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-15 17:19:44    100244    8647    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-15 17:19:44    100461    8647    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-15 17:19:44    101658    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 477 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    102232    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 479 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    102478    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    102742    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    102967    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 480 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    103236    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    103446    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    103646    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 484 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    103868    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    104196    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    104401    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 485 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    104595    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    104789    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    104981    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 486 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    105241    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    105443    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    105638    8647    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 487 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:44    211009    8647    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: be5d00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: be5d00000007030304000008[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-15 17:19:44    214004    8647    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-15 17:19:44    217319    8647    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-15 17:19:49    181329    8661    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-15 17:19:49    183193    8661    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-15 17:19:49    183549    8661    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-15 17:19:49    183655    8661    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-15 17:19:49    183708    8661    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-15 17:19:49    183746    8661    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-15 17:19:49    184062    8661    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-15 17:19:49    186631    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 477 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    186969    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 479 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    187303    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    187618    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    188029    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 480 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    188416    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    188934    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    189357    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 484 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    189697    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    190238    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    190558    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 485 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    190846    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    191171    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    191488    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 486 | Non-static method IecType::iecINT() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    191766    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 51 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    192090    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/IecType.php | Error: 2048 | Line: 52 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    192451    8661    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 2048 | Line: 487 | Non-static method IecType::iecBYTE() should not be called statically, assuming $this from incompatible context
    2017-05-15 17:19:49    309715    8661    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 5f8b00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 5f8b00000007030304000008[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-15 17:19:49    311914    8661    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-15 17:19:49    314014    8661    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    oder ich hab beim drag&drop was falsch gemacht....

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    Ich hab hier mal eine neue Version vom LBS angehängt der hoffentlich die Ausgabe unterdrückt...
    Wenn es klappt dann mach ich diese Version offiziell.
    PHP-Code:
    ###[DEF]###
    [name =     ModBus TCP Master Read]
    [e#1 trigger=         Autostart #init=1]
    [e#2 important=         Host #init=e3dc.knx.pattison.de] ModBus Slave IP or Host
    [e#3 optional=         Port #init=502] Modbus Port
    [e#4 =         Mode 0/1 #init=1] 0 UDP, 1 TCP
    [e#5 optional=         SlaveID #init=0]
    [e#6 =         Logging #init=6]
    [e#7 =        Loop #init=0]
    [e#8 =        Delay #init=1000]
    [e#9 important=         Address1 #init=40072]
    [e#10 important=     Length1 #init=1] #Word size=2bytes
    [e#11 important=     Type1 #init=0] 0=Int, 1=uInt, 2=String
    [e#12 important=        Function1 #init=3]
    [e#13 option=Address2]
    [e#14 option=Length2]
    [e#15 option=Type2]
    [e#16 option=Function2 #init=3]
    [e#17 option=Address3]
    [e#18 option=Length3]
    [e#19 option=Type3]
    [e#20 option=Function3 #init=3]
    [e#21 option=Address4]
    [e#22 option=Lengt4]
    [e#23 option=Type4]
    [e#24 option=Function4 #init=3]
    [e#25 option=Address5]
    [e#26 option=Length5]
    [e#27 option=Type5]
    [e#28 option=Function5 #init=3]

    [a#1 = Value1]
    [a#2 = Value2]
    [a#3 = Value3]
    [a#4 = Value4]
    [a#5 = Value5]
    [a#9 = Trigger Ext]
    [a#10 = Error]

    [v#1             = 0 ]
    [v#2             = 0 ]
    [v#3                   = 0 ]
    [v#4             = 0 ]
    [v#5             = 0]
    [v#100           = 0.5 ]
    [v#101           = 19001030 ]
    [v#102           = ModBusMaster Read]
    [v#103           = 0 ]
    [v#104           = 0 ]
    [v#105           = 0 ]
    ###[/DEF]###


    ###[HELP]###

    INSTALLATION:
    This LBS requires phpmodbus.php to be present on Edomi.
    You can either copy the included zip file and extract the content to /usr/local/edomi/main/include/php/ or
    download phpModbus yourself. The version included is slightly modified to reduce logging output.

    USAGE:
    This LSB allows to query up to 5 Values from a Modbus TCP Slave.
    It can either run once on a trigger or run continously.
    E2 is the IP or Hostname, E3 the Port wich should default to 502.
    E4 is TCP or UDP Connection and E5 is the Slave ID which is usually not changed.
    E6: Sets the Logging Level meinly 0 or 8 for debug. In debug mode it will write a lot so be warned!
    E7: Loop or no Loop
    E8 is the delay in ms between loops, default is 1000 which is 1s.
    E9 is mandatory address where we start to read. Be aware that addresses are counted from 0 but not all documentation take this into account.
    You might need to play with Address+-1 to get good values.
    E10 is the length of data we read in Dword! Meaning 1 is 2 bytes long. Again check the device doc.
    E11 is the data type that is returned so the LBS can convert accordingly.
    E12 is the Function to use, at the moment only F03 is implemented!
    From now it just repeats for differents inputs.
    The Result is the put to A1 to A5.
    A9 is a trigger that can be used to cascade several LBS. After each run but before the delay starts it will be triggerd with a 1.
    A10 indicates an error which usually means the LBS has stopped and need to be restarted.


    E1: Autostart, Default=1
    E2: Host or IP of Modbus Slave
    E3: Port (Currently not used)
    E4: Mode: 0=UDP, 1=TCP
    E5: Modbus Slave ID, Default=1
    E6: Logging, 0=none, 8=Debuggen
    E7: Loop, Default=0, 0=False=Run once,1=True=Run till Edomi END
    E8: Delay between runs in ms, Default=1000 (1sec)
    E9: Address1 Datapoint
    E10: Lenght to read 1, Default=1 (1=1 Dword=2 Bytes)
    E11: Type of Data returned 1, 0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String, 6=Swap Float
    E12: Function to use (Currently only FC3 Read_Multiple_Registers is implemented)
    E13: Address2 (see E9)
    E14: Length2 (see E10)
    E15: Type2 (see E11)
    E16: Function2 (see E12)
    E17: Address3 (see E9)
    E18: Length3 (see E10)
    E19: Type3 (see E11)
    E20: Function3 (see E12)
    E21: Address4 (see E9)
    E22: Length4 (see E10)
    E23: Type4 (see E11)
    E24: Function4 (see E12)
    E25: Address5 (see E9)
    E26: Length5 (see E10)
    E27: Type5 (see E11)
    E28: Function5 (see E12)

    A1: Result of Query 1
    A2: Result of Query 2
    A3: Result of Query 3
    A4: Result of Query 4
    A5: Result of Query 5
    A9: Trigger ext, Can be used to chain LBS together, will send a 1 at the end of each loop
    A10: Triggers on Daemon Error 1=Generic Error, 2=Timeout Error

    V1: Indicator whether daemon is running
    V2: PID of EXEC Daemon
    V3: Array of used Inputs
    V4: Endianness 0/1
    V5: Timout Counter
    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level
    V104: One log file per LBS instance
    V105: log ID in each log entry

    #Changelog
    v0.1 Initial version
    v0.2 small bugfix + new Datatype "Swap Float"
    v0.3 "Swap Float" fix
    v0.4 Implemented Endianess Setting in V4
    v0.5 Refactoring of EXEC part to avoid potential Memory Leak. EXEC Part is not a daemon anymore. increased Debug Output.
    v0.6 Suppress wrong data due to corrupted Modbus Message
    ###[/HELP]###

    ###[LBS]###
    <?
    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
      $E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '', $logName);
        if (logic_getVar($id, 104))
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }

    function LB_LBSID($id) {




      if ($E=logic_getInputs($id)) {
        $loop=$E[7]['value'];
        $delay=$E[8]['value'];
        if (logic_getState($id)==1 && $E[1]==0){
          logic_setState($id,0);
          LB_LBSID_logging($id, 'LBS ended');
        } else {
          setLogicElementVar($id, 103, $E[6]['value']); // set loglevel to #VAR 103
          if (logic_getState($id)==0) {
            LB_LBSID_logging($id, 'LBS started');
          }
          $activeInputs=array();
          if ($E[9]['value']!=""){
            $activeInputs[]=9;
          }
          if ($E[13]['value']!=""){
            $activeInputs[]=13;
          }
          if ($E[17]['value']!=""){
            $activeInputs[]=17;
          }
          if ($E[21]['value']!=""){
            $activeInputs[]=21;
          }
          if ($E[25]['value']!=""){
            $activeInputs[]=25;
          }

          setLogicElementVar($id,3,implode(";",$activeInputs));
          if (getLogicElementVar($id,1)!=1) {
            setLogicElementVar($id,5,1);
            setLogicElementVar($id,1,1);                        //setzt V1=1, um einen mehrfachen Start des EXEC-Scripts zu verhindern
            callLogicFunctionExec(LBSID,$id);                 //EXEC-Script starten (garantiert nur einmalig)
          } elseif (logic_getVar($id,5)>9){
            setLogicElementVar($id,5,0);
            setLogicElementVar($id,1,0);
            logic_SetOutput($id,10,2);
          } else {
            $v5=logic_getVar($id,5);
            logic_setVar($id,5,$v5+1);
          }
          if ($loop=1){
                logic_setState($id,1,$delay);
            }
        }

      }
    }
    ?>
    ###[/LBS]###
    ###[EXEC]###
    <?
    require(dirname(__FILE__)."/../../../../main/include/php/incl_lbsexec.php");
    require_once(dirname(__FILE__)."/../../../../main/include/php/ModbusMaster.php");
    set_time_limit(0);                                       //Wichtig! Script soll endlos laufen
    sql_connect();
    logging($id, "START ModbusMaster Exec",null,6);
    setLogicElementVar($id, 2, getmypid());
    $suppressModBusError='0';
    //
    // error_off() : switch off error reporting
    // error_on() : switch on error reporting
    //
    function myErrorHandler($errno, $errstr, $errfile, $errline)
    {
      global $id;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')OR($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }
    function myErrorHandlerModBus($errno, $errstr, $errfile, $errline)
    {
      global $id;
      if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8')){
        $GLOBALS["suppressModBusError"]='1';
        return;}

      logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4);
    }

    function error_off()
    {
      $error_handler = set_error_handler("myErrorHandler");
      error_reporting(0);
    }

    function error_on()
    {
      restore_error_handler();
      error_reporting(E_ALL);
    }

    function logging($id, $msg, $var = NULL, $priority = 8)
    {
      //$E = getLogicEingangDataAll($id);
      $logLevel = getLogicElementVar($id, 103);
      if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
        $logLevelNames = array(
          'none',
          'emerg',
          'alert',
          'crit',
          'err',
          'warning',
          'notice',
          'info',
          'debug'
        );
        $version = getLogicElementVar($id, 100);
        $lbsNo = getLogicElementVar($id, 101);
        $logName = getLogicElementVar($id, 102) . "-LBS$lbsNo";
        $logName = preg_replace('/ /', '_', $logName);
        if (logic_getVar($id, 104) == 1)
        $logName .= "-$id";
        if (logic_getVar($id, 105) == 1)
        $msg .= " ($id)";
        strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
        writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $msg);
        if (isset($var)) {
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . json_encode($var));
          writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
        }
      }
    }


    date_default_timezone_set('Europe/Berlin');

    error_off();


    if ($E=getLogicEingangDataAll($id)) {
      $endianness=getLogicElementVar($id, 4);
      $v3=getLogicElementVar($id, 3);
      $inputs=explode(";",$v3);
      $querys=array();
      logging($id,"v3:" . $v3);
      logging($id,"inputs:" , $inputs);
      $retries=0;

      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));

      //$Looping = true;
      //while (getSysInfo(1)>=1 AND $Looping){
      //logging($id,"Memory before New ModBusMaster: " . (string)memory_get_usage());
      // Create Modbus object
      $modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
      //logging($id,"Memory after New ModBusMaster: " . (string)memory_get_usage());
      for($i = 0, $groesse = count($inputs); $i < $groesse; ++$i) {
        logging($id,"i:" . $i . "; input:" . $inputs[$i] . "; address:" . $E[$inputs[$i]]['value'] . "; length:" . $E[$inputs[$i]+1]['value'] . "; type:" . $E[$inputs[$i]+2]['value']);
        //logging($id,"i:" . $i);
        //logging($id,"input:" . $inputs[$i]);
        //logging($id,"address:" . $E[$inputs[$i]]['value']);
        //$query=Array('address'=>$E[$inputs[$i]]['value'],'length'=>$E[$inputs[$i]+1]['value'],'type'=>$E[$inputs[$i]+2]['value'],'function'=>$E[$inputs[$i]+3]['value']);
        //logging($id,"Query:" , $query);
        //$querys[]=$query;

        //logging($id,"Querys:" , $querys);


        //for($i = 0, $groesse = count($querys); $i < $groesse; ++$i) {
        try {
          // FC 3
          if ($E[$inputs[$i]+3]['value']==3){
            set_error_handler("myErrorHandlerModBus");
            $suppressModBusError='0';
            $recData = $modbus->readMultipleRegisters($E[5]['value'], $E[$inputs[$i]]['value'], $E[$inputs[$i]+1]['value']);
            restore_error_handler();
            //logging($id,"Memory after Read: " . (string)memory_get_usage());
          }
        }
        catch (Exception $e) {
          // Print error information if any
          logging($id, "Modbus Error: ", $modbus,4);
          logging($id, "Modbus Error: ", $e,4);
          logging($id, "Retries:" . $retries);
          //logging($id,"Memory in error: " . (string)memory_get_usage(),4);
          if ($retries<3){
            $retries+=1;
            break;
          }else{
            setLogicLinkAusgang($id,10,1); //send error to A10
            setLogicElementVar($id,1,0);  //allow to restart
            logging($id, "Error: Retry counter reached max. Exiting!",null,4);
            exit;
          }
        }
        // Print status information
        logging($id,"Status:" . $modbus);

        // Print read data
        if (isset($recData) AND $recData!=false AND $suppressModBusError='0'){
          logging($id,"Type:" . $E[$inputs[$i]+2]['value'] . "Raw Data:",$recData);
          //0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String
          if ($E[$inputs[$i]+2]['value']==0){
            $ret=PhpType::bytes2signedInt($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==1){
            logging($id,"unsigned start");
            $ret=PhpType::bytes2unsignedInt($recData, $endianness);
            logging($id,"unsigned stop");
          }elseif ($E[$inputs[$i]+2]['value']==2){
            $ret=PhpType::bytes2float($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==3){
            $ret=$recData[0];
          }elseif ($E[$inputs[$i]+2]['value']==4){
            $ret=0;
          }elseif ($E[$inputs[$i]+2]['value']==5){
            $ret=PhpType::bytes2string($recData, $endianness);
          }elseif ($E[$inputs[$i]+2]['value']==6){
            if (getLogicElementVar($id, 4) == 0){
              $ret = (($recData[3] & 0xFF)) |
              (($recData[2] & 0xFF)<<8) |
              (($recData[1] & 0xFF))<<16 |
              (($recData[0] & 0xFF)<<24);
            }else{
              $ret = (($recData[3] & 0xFF)<<24) |
              (($recData[2] & 0xFF)<<16) |
              (($recData[1] & 0xFF)<<8) |
              (($recData[0] & 0xFF));
            }
            $ulong = pack('L*', $ret);
            $float = unpack('f*', $ulong);
            $ret = $float[1];
          }


          logging($id,"Data:" . $ret);
          setLogicLinkAusgang($id,$i+1,$ret);
        }
      }
      //Loop
      //if ($E[7]['value']==0){
      //  $Looping=false;
      //  logging($id,"Looping:" . var_export($Looping,true));
      //}
      setLogicLinkAusgang($id,9,1);
      //Delay
      //logging($id,"Delay:" . $E[8]['value']);
      unset($modbus);
      //usleep(1000*$E[8]['value']);
      setLogicLinkAusgang($id,9,0);
      logging($id,"end of delay");
      // Create Modbus object
      //$modbus = new ModbusMaster($E[2]['value'], ($E[4]['value']==0 ? "UDP" : "TCP"));
    }
    //}

    setLogicElementVar($id,1,0); //allow to restart
    //logging($id,"Memory at End: " . (string)memory_get_usage());
    logging($id, "STOP ModbusMaster EXEC",null,6);
    error_on();
    sql_disconnect();
    ?>
    ###[/EXEC]###

    Einen Kommentar schreiben:


  • hx5
    antwortet
    Zitat von gulp2k Beitrag anzeigen
    hm, das wars auch nicht.error_get_last()
    bitte mal im obigen Code in der Zweitletzten Zeile "$modbus" mit "error_get_last()" ersetzten.
    Code:
    Zeitstempel    ms    PID    LogLevel    Meldung
    2017-05-13 16:24:10    295275    24203    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-13 16:24:10    296994    24203    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-13 16:24:10    297267    24203    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-13 16:24:10    297322    24203    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:10    297374    24203    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-13 16:24:10    297410    24203    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:10    297782    24203    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017264
    2017-05-13 16:24:10    298070    24203    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018672
    2017-05-13 16:24:10    298343    24203    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-13 16:24:10    417562    24203    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-13 16:24:10    419178    24203    debug    EXE19001030 [v0.5]:    Memory after Read: 2020568
    2017-05-13 16:24:10    420111    24203    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: e76f00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: e76f00000007030304000006ac[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-13 16:24:10    421061    24203    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-13 16:24:10    421241    24203    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:10    421350    24203    debug    EXE19001030 [v0.5]:    [0,0,6,172]
    2017-05-13 16:24:10    421433    24203    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:10    422473    24203    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-13 16:24:10    423381    24203    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-13 16:24:10    424263    24203    debug    EXE19001030 [v0.5]:    Data:111935488
    2017-05-13 16:24:10    427712    24203    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-13 16:24:10    430641    24203    debug    EXE19001030 [v0.5]:    Memory at End: 2018968
    2017-05-13 16:24:10    431488    24203    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-13 16:24:15    337752    24218    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-13 16:24:15    338876    24218    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-13 16:24:15    339093    24218    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-13 16:24:15    339129    24218    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:15    339163    24218    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-13 16:24:15    339188    24218    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:15    339373    24218    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017240
    2017-05-13 16:24:15    339572    24218    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018648
    2017-05-13 16:24:15    339801    24218    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-13 16:24:15    520880    24218    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-13 16:24:15    521188    24218    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-13 16:24:15    521389    24218    debug    EXE19001030 [v0.5]:    Memory after Read: 2020544
    2017-05-13 16:24:15    521823    24218    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: bc6100000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: bc6100000007030304000009[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-13 16:24:15    522026    24218    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-13 16:24:15    522058    24218    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:15    522083    24218    debug    EXE19001030 [v0.5]:    [0,0,9,0]
    2017-05-13 16:24:15    522106    24218    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:15    522285    24218    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-13 16:24:15    522479    24218    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-13 16:24:15    522660    24218    debug    EXE19001030 [v0.5]:    Data:150994944
    2017-05-13 16:24:15    523519    24218    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-13 16:24:15    524275    24218    debug    EXE19001030 [v0.5]:    Memory at End: 2018944
    2017-05-13 16:24:15    524477    24218    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-13 16:24:20    431585    24223    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-13 16:24:20    433068    24223    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-13 16:24:20    433353    24223    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-13 16:24:20    433403    24223    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:20    433446    24223    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-13 16:24:20    433480    24223    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:20    433744    24223    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017240
    2017-05-13 16:24:20    434245    24223    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018648
    2017-05-13 16:24:20    434515    24223    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-13 16:24:20    487334    24223    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-13 16:24:20    489384    24223    debug    EXE19001030 [v0.5]:    Memory after Read: 2020544
    2017-05-13 16:24:20    490328    24223    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 11ff00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 11ff0000000703030400000af2[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-13 16:24:20    491250    24223    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-13 16:24:20    491378    24223    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:20    491553    24223    debug    EXE19001030 [v0.5]:    [0,0,10,242]
    2017-05-13 16:24:20    491647    24223    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:20    492532    24223    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-13 16:24:20    493443    24223    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-13 16:24:20    494267    24223    debug    EXE19001030 [v0.5]:    Data:183631872
    2017-05-13 16:24:20    497818    24223    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-13 16:24:20    500912    24223    debug    EXE19001030 [v0.5]:    Memory at End: 2018944
    2017-05-13 16:24:20    501791    24223    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-13 16:24:25    474471    24228    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-13 16:24:25    475846    24228    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-13 16:24:25    476167    24228    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-13 16:24:25    476217    24228    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:25    476259    24228    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-13 16:24:25    476291    24228    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:25    476530    24228    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017240
    2017-05-13 16:24:25    476789    24228    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018648
    2017-05-13 16:24:25    477168    24228    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-13 16:24:25    598062    24228    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-13 16:24:25    599448    24228    debug    EXE19001030 [v0.5]:    Memory after Read: 2020544
    2017-05-13 16:24:25    600424    24228    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 4a8a00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 4a8a0000000703030400000bd9[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-13 16:24:25    601346    24228    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-13 16:24:25    601474    24228    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:25    601571    24228    debug    EXE19001030 [v0.5]:    [0,0,11,217]
    2017-05-13 16:24:25    601654    24228    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:25    602581    24228    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-13 16:24:25    603481    24228    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-13 16:24:25    604345    24228    debug    EXE19001030 [v0.5]:    Data:198770688
    2017-05-13 16:24:25    608206    24228    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-13 16:24:25    611100    24228    debug    EXE19001030 [v0.5]:    Memory at End: 2018944
    2017-05-13 16:24:25    611831    24228    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-13 16:24:30    535890    24233    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-13 16:24:30    537396    24233    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-13 16:24:30    537734    24233    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-13 16:24:30    537787    24233    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:30    537831    24233    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-13 16:24:30    537863    24233    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:30    538155    24233    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017240
    2017-05-13 16:24:30    538429    24233    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018648
    2017-05-13 16:24:30    538686    24233    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-13 16:24:30    697354    24233    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-13 16:24:30    698293    24233    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-13 16:24:30    699265    24233    debug    EXE19001030 [v0.5]:    Memory after Read: 2020544
    2017-05-13 16:24:30    700844    24233    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 940d00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 940d0000000703030400000c[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-13 16:24:30    701636    24233    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-13 16:24:30    701756    24233    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-13 16:24:30    701853    24233    debug    EXE19001030 [v0.5]:    [0,0,12,0]
    2017-05-13 16:24:30    701930    24233    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-13 16:24:30    702622    24233    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-13 16:24:30    703376    24233    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-13 16:24:30    705740    24233    debug    EXE19001030 [v0.5]:    Data:201326592
    2017-05-13 16:24:30    710145    24233    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-13 16:24:30    714107    24233    debug    EXE19001030 [v0.5]:    Memory at End: 2018944
    2017-05-13 16:24:30    715435    24233    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    Werte sehen auch noch merkwürdig aus....

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    hm, das wars auch nicht.error_get_last()
    bitte mal im obigen Code in der Zweitletzten Zeile "$modbus" mit "error_get_last()" ersetzten.

    Einen Kommentar schreiben:


  • hx5
    antwortet
    gulp2k

    Er haut auf jeden Fall noch Fehler raus:

    Code:
    Zeitstempel    ms    PID    LogLevel    Meldung
    2017-05-12 21:13:29    699235    19419    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:29    701864    19419    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:29    702523    19419    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:29    702575    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:29    702611    19419    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:29    702636    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:29    703602    19419    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017104
    2017-05-12 21:13:29    704128    19419    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018512
    2017-05-12 21:13:29    704339    19419    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:29    778861    19419    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-12 21:13:29    779330    19419    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:29    779376    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:29    779412    19419    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: ca7500000006030378370002\nSend\nWait data ... \nData received\nPacket: ca7500000007030304800000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:29    779442    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:29    779633    19419    debug    EXE19001030 [v0.5]:    Memory after Read: 2020408
    2017-05-12 21:13:29    779860    19419    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: ca7500000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: ca7500000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:29    780056    19419    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:29    780284    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:29    780328    19419    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:29    780353    19419    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:29    780543    19419    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:29    780744    19419    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:29    780937    19419    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:29    781760    19419    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:29    782510    19419    debug    EXE19001030 [v0.5]:    Memory at End: 2018808
    2017-05-12 21:13:29    782851    19419    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-12 21:13:34    729582    19450    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:34    732779    19450    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:34    733374    19450    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:34    733453    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:34    733513    19450    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:34    733556    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:34    733990    19450    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017080
    2017-05-12 21:13:34    734894    19450    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018488
    2017-05-12 21:13:34    735490    19450    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:34    879579    19450    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-12 21:13:34    880162    19450    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:34    880337    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:34    880384    19450    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: 6f9100000006030378370002\nSend\nWait data ... \nData received\nPacket: 6f9100000007030304800000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:34    880422    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:34    880671    19450    debug    EXE19001030 [v0.5]:    Memory after Read: 2020384
    2017-05-12 21:13:34    880875    19450    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 6f9100000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 6f9100000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:34    881160    19450    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:34    881205    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:34    881233    19450    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:34    881254    19450    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:34    881437    19450    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:34    881676    19450    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:34    881865    19450    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:34    883400    19450    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:34    886311    19450    debug    EXE19001030 [v0.5]:    Memory at End: 2018784
    2017-05-12 21:13:34    886729    19450    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-12 21:13:39    808892    19459    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:39    810580    19459    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:39    810960    19459    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:39    811021    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:39    811073    19459    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:39    811111    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:39    811402    19459    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017080
    2017-05-12 21:13:39    811774    19459    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018488
    2017-05-12 21:13:39    812079    19459    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:40    004843    19459    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:40    005239    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:40    005554    19459    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: 2a4700000006030378370002\nSend\nWait data ... \nData received\nPacket: 2a470000000703030480000000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:40    005783    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:40    009174    19459    debug    EXE19001030 [v0.5]:    Memory after Read: 2020384
    2017-05-12 21:13:40    010742    19459    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 2a4700000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 2a470000000703030480000000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:40    011960    19459    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:40    012115    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:40    012221    19459    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:40    012458    19459    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:40    013453    19459    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:40    014842    19459    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:40    016335    19459    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:40    024517    19459    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:40    026587    19459    debug    EXE19001030 [v0.5]:    Memory at End: 2018784
    2017-05-12 21:13:40    027029    19459    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-12 21:13:44    837649    19465    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:44    839144    19465    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:44    839421    19465    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:44    839472    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:44    839514    19465    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:44    839545    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:44    839821    19465    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017080
    2017-05-12 21:13:44    840074    19465    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018488
    2017-05-12 21:13:44    840301    19465    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:44    948929    19465    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-12 21:13:44    949345    19465    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:44    949429    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:44    949495    19465    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: c10800000006030378370002\nSend\nWait data ... \nData received\nPacket: c10800000007030304800000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:44    949558    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:44    949997    19465    debug    EXE19001030 [v0.5]:    Memory after Read: 2020384
    2017-05-12 21:13:44    950372    19465    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: c10800000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: c10800000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:44    950727    19465    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:44    950833    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:44    950885    19465    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:44    950923    19465    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:44    951245    19465    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:44    951596    19465    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:44    952209    19465    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:44    953186    19465    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:44    953984    19465    debug    EXE19001030 [v0.5]:    Memory at End: 2018784
    2017-05-12 21:13:44    954276    19465    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-12 21:13:49    904155    19471    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:49    905405    19471    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:49    905635    19471    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:49    905670    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:49    905704    19471    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:49    905729    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:49    905919    19471    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017080
    2017-05-12 21:13:49    906117    19471    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018488
    2017-05-12 21:13:49    906302    19471    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:50    049335    19471    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-12 21:13:50    049941    19471    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:50    050085    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:50    050141    19471    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: ad7800000006030378370002\nSend\nWait data ... \nData received\nPacket: ad7800000007030304800000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:50    050201    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:50    050518    19471    debug    EXE19001030 [v0.5]:    Memory after Read: 2020384
    2017-05-12 21:13:50    050888    19471    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: ad7800000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: ad7800000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:50    051333    19471    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:50    051461    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:50    051496    19471    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:50    051522    19471    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:50    051747    19471    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:50    051964    19471    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:50    052251    19471    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:50    053476    19471    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:50    054512    19471    debug    EXE19001030 [v0.5]:    Memory at End: 2018784
    2017-05-12 21:13:50    054754    19471    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    2017-05-12 21:13:54    925112    19487    debug    EXE19001030 [v0.5]:    START ModbusMaster Exec
    2017-05-12 21:13:54    926321    19487    debug    EXE19001030 [v0.5]:    v3:9
    2017-05-12 21:13:54    926556    19487    debug    EXE19001030 [v0.5]:    inputs:
    2017-05-12 21:13:54    926656    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:54    926703    19487    debug    EXE19001030 [v0.5]:    ["9"]
    2017-05-12 21:13:54    926733    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:54    926930    19487    debug    EXE19001030 [v0.5]:    Memory before New ModBusMaster: 2017080
    2017-05-12 21:13:54    927139    19487    debug    EXE19001030 [v0.5]:    Memory after New ModBusMaster: 2018488
    2017-05-12 21:13:54    927335    19487    debug    EXE19001030 [v0.5]:    i:0; input:9; address:30775; length:2; type:1
    2017-05-12 21:13:54    999263    19487    debug    EXE19001030 [v0.5]:    File: /usr/local/edomi/main/include/php/ModbusMaster.php | Error: 8 | Line: 506 | Uninitialized string offset: 12
    2017-05-12 21:13:54    999607    19487    debug    EXE19001030 [v0.5]:    Modbus Status:
    2017-05-12 21:13:54    999669    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:54    999706    19487    debug    EXE19001030 [v0.5]:    {"host":"192.168.178.65","port":"502","client":"","client_port":"502","status":"readMultipleRegisters: START\nConnected\nPacket: 9a4e00000006030378370002\nSend\nWait data ... \nData received\nPacket: 9a4e00000007030304800000\nModbus response error code: NOERROR\nDisconnected\nreadMultipleRegisters: DONE\n","timeout_sec":5,"endianness":0,"socket_protocol":"TCP"}
    2017-05-12 21:13:54    999747    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:54    999978    19487    debug    EXE19001030 [v0.5]:    Memory after Read: 2020384
    2017-05-12 21:13:55    000169    19487    debug    EXE19001030 [v0.5]:    Status:<pre>readMultipleRegisters: START[LF]Connected[LF]Packet: 9a4e00000006030378370002[LF]Send[LF]Wait data ... [LF]Data received[LF]Packet: 9a4e00000007030304800000[LF]Modbus response error code: NOERROR[LF]Disconnected[LF]readMultipleRegisters: DONE[LF]</pre>
    2017-05-12 21:13:55    000355    19487    debug    EXE19001030 [v0.5]:    Type:1Raw Data:
    2017-05-12 21:13:55    000385    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT START ================
    2017-05-12 21:13:55    000410    19487    debug    EXE19001030 [v0.5]:    [128,0,0,0]
    2017-05-12 21:13:55    000432    19487    debug    EXE19001030 [v0.5]:    ================ ARRAY/OBJECT END ================
    2017-05-12 21:13:55    000605    19487    debug    EXE19001030 [v0.5]:    unsigned start
    2017-05-12 21:13:55    000799    19487    debug    EXE19001030 [v0.5]:    unsigned stop
    2017-05-12 21:13:55    001024    19487    debug    EXE19001030 [v0.5]:    Data:32768
    2017-05-12 21:13:55    001833    19487    debug    EXE19001030 [v0.5]:    end of delay
    2017-05-12 21:13:55    002654    19487    debug    EXE19001030 [v0.5]:    Memory at End: 2018784
    2017-05-12 21:13:55    007472    19487    debug    EXE19001030 [v0.5]:    STOP ModbusMaster EXEC
    Morgen werde ich mal gucken wie die Werte sind.

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    hx5

    Ich kann es leider bei mir nicht Testen...
    Kannst du bitte mal im LBS den "try" Block durch folgendes ersetzten und mir ein Log posten?
    PHP-Code:
      try {
          
    // FC 3
          
    if ($E[$inputs[$i]+3]['value']==3){
            
    $recData = @$modbus->readMultipleRegisters($E[5]['value'], $E[$inputs[$i]]['value'], $E[$inputs[$i]+1]['value']);

            
    logging($id"Modbus Status: "$modbus,4);
            
    logging($id,"Memory after Read: " . (string)memory_get_usage());
          }
        } 

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    Kurzes update: Ich bin noch dran aber irgendwie hab ich ein Problem den Fehler abzufangen.

    Einen Kommentar schreiben:


  • gulp2k
    antwortet
    Wie gesagt steck ich da selber nicht tief genug drin... Bei mir ist sowas noch nicht aufgetreten und ich lauf mir 5 Werten pro Sekunde stabil.
    Ich kann leider von meiner Seite nicht viel mehr machen als den Fehler zu versuchen abzufangen... und dann zu "ignorieren".

    Einen Kommentar schreiben:


  • hx5
    antwortet
    gulp2k aber ich sehe das richtig, dass die Antworten meines Wechselrichters immer die Gleichen sind und die Fehler wahrscheinlich durch die eingebunden library entstehen?

    Kommen solche Fehler nur bei mir?
    Und wenn ja, an was könnte das liegen?

    Einen Kommentar schreiben:

Lädt...
X