Closed JosepFarreLlados closed 1 year ago
I think we have a classic big/little endian issue here... Can you post the var_dump($buffer), the output you get and the expected value? Thanks
BTW... does a logo support AreaDB 0x84
?? I have no recent experience with LOGO's but the old ones certainly didn't. Maybe the 8 series have this because PHP7.4 could read it as @JosepFarreLlados said.
Using "read_db.php" code as follows:
*using PHP7.4, the var_dump($buffer) output is: /Test.php:12: string(8) "00000005"
*using PHP8, the var_dump($buffer) output is: /Test.php:12: string(0) ""
The expected value is "00000005", according with PHP7.4. I'm using LOGO OBA8 version: 6ED1 052-1FB00-0BA8. With PHP7.4 I can use examples "read_db" and "write_db" correctly.
Thanks, I was wrong, the problem lies deeper. From PHP7 to 8 PHP changed a lot of recources to Objects: https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object
we need to change
is_resource($this->FSocket)
to
is_resource($this->FSocket) || $this->FSocket instanceof Socket
I am already working on this. @FabrizioC or @chaosben expect a pull request in the coming days. I don't have access to a LOGO! 8 but i have S7-300 and a 1200 available to test stuff. if this works, a LOGO should work as well. I think @JosepFarreLlados can confirm this if it works.
Connecting with Siemens LOGO OBA8 and PHP7.4, read and write examples works (/phosphor7/examples/ ). Using PHP8.0 DBRead function return wrong values. Any feedback with PHP8?