Replies: 2 comments
-
|
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
-
|
Hi @flanguy Thank you for your input! You are very welcome to do a Pull request! I will look in to your suggestions but it might take a while. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
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