Skip to content

Response String is Null  #6

Description

@Ramasundaram62

We are using the above code to read data from a PLC .

  1. We are able Initialize & Open port and send the query but we are getting NULL response..

  2. Finally, and in desperation are directly passing the following query where we are trying to read Holding Register 4237

$modbus->sendQuery(1,3,"108D",1);

( Is the query correct ? )
Still the response is Null.

  1. We came to the following breakpoint which we found was not executing :

// Read serial port buffer (with three seconds timeout)
$responseString='';
while( ($byte = $this->serial->ReadPort()) && ((microtime(true)-$startTime)<3.0))
{
$byte = $this->serial->ReadPort();
$responseString=$responseString.$byte;
sleep(3);
}

$responseString is NULL .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions