Replies: 1 comment
-
Also, I suggest to add these two types in php-s7/phosphor7/src/s7_phphelper.php : /**
/**
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I use your library since few days and I pointed out that getS7_Int has an error
The error is in the getS7_Int() function: it uses 4 as the length in substr() instead of 2. Indeed, a Siemens S7 INT occupies 2 bytes, so the code should be:
public static function getS7_Int(string $data, int $start): int
{
return hexdec(bin2hex(substr($data, $start, 2)));
}
Kind regards,
Fabian
Beta Was this translation helpful? Give feedback.
All reactions