We are using the above code to read data from a PLC .
-
We are able Initialize & Open port and send the query but we are getting NULL response..
-
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.
- 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 .
We are using the above code to read data from a PLC .
We are able Initialize & Open port and send the query but we are getting NULL response..
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.
// 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 .