Skip to content

Not Reading the Input Registers #2

Description

@V3NK47

This is the code I'm trying to retrieve data from the register.

require 'PhpSerialModbus.php';

$modbus = new PhpSerialModbus;

$modbus->deviceInit('COM3',19200,'none',8,1,'none');

$modbus->deviceOpen();

$startaddress = 3371;

while($startaddress!=3380)
{
$modbus->debug = true;
echo $hex_addr = strval(dechex($startaddress));
echo "
";
echo $startaddress;
echo "
";
$result=$modbus->sendQuery(11,3,$hex_addr,2);
if(print_r($result)){
echo "
";
$startaddress++;
}

}

Output : I receive null output.

The datasheet of the device I'm trying to connect.

I'm not sure what I'm missing. There are not a lot of community on internet to research about.

Kindly help me through. Thanks in advance.

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