diff --git a/Phpmodbus/IecType.php b/Phpmodbus/IecType.php index dd23ccc..74c1314 100644 --- a/Phpmodbus/IecType.php +++ b/Phpmodbus/IecType.php @@ -1,12 +1,12 @@ status .= "Bound\n"; } } + // Socket settings + socket_set_option($this->sock, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 1, 'usec' => 0)); // Connect the socket $result = @socket_connect($this->sock, $this->host, $this->port); if ($result === false) { diff --git a/license.txt b/license.txt index edea02a..4a2550a 100644 --- a/license.txt +++ b/license.txt @@ -1,10 +1,10 @@ The Phpmodbus License, Version 1 ============================ -Copyright (c) 2004, 2011 Jan Krakora, Wago (http://www.wago.com) +Copyright (c) 2004, 2013 Jan Krakora All rights reserved. -This license is a legal agreement between you and Jan Krakora, Wago (the "Author") +This license is a legal agreement between you and Jan Krakora (the "Author") for the use of Phpmodbus (the "Software"). By obtaining, using and/or copying the Software, you agree that you have read, understood, and will comply with the terms and conditions of this license. diff --git a/tests/Codesys/DEFAULT.DFR b/tests/Codesys/DEFAULT.DFR deleted file mode 100644 index 656e9fe..0000000 Binary files a/tests/Codesys/DEFAULT.DFR and /dev/null differ diff --git a/tests/Codesys/test.SDB b/tests/Codesys/test.SDB deleted file mode 100644 index 7a1a08b..0000000 Binary files a/tests/Codesys/test.SDB and /dev/null differ diff --git a/tests/Codesys/test.SYM b/tests/Codesys/test.SYM deleted file mode 100644 index 7ed349a..0000000 --- a/tests/Codesys/test.SYM +++ /dev/null @@ -1,4 +0,0 @@ -;Version=2 -;ProjectId=114942 -;Checksum=0 -;Filesize=0 diff --git a/tests/Codesys/test00002ed2r.ci b/tests/Codesys/test00002ed2r.ci deleted file mode 100644 index 062ad60..0000000 Binary files a/tests/Codesys/test00002ed2r.ci and /dev/null differ diff --git a/tests/Codesys/test00002ed2r.ri b/tests/Codesys/test00002ed2r.ri deleted file mode 100644 index 453fbbc..0000000 Binary files a/tests/Codesys/test00002ed2r.ri and /dev/null differ diff --git a/tests/IecType/output/test.iecByte.php.html b/tests/IecType/output/test.iecByte.php.html deleted file mode 100644 index dc6e8a7..0000000 --- a/tests/IecType/output/test.iecByte.php.html +++ /dev/null @@ -1 +0,0 @@ -125
98
0
0
0
0
0
0
0
0
0
0
255
255
255
255
158
88
97
168
\ No newline at end of file diff --git a/tests/IecType/output/test.iecDInt.php.html b/tests/IecType/output/test.iecDInt.php.html deleted file mode 100644 index 1abf31b..0000000 --- a/tests/IecType/output/test.iecDInt.php.html +++ /dev/null @@ -1 +0,0 @@ -Endianing off
0 --> Packet: 0000_0000_
1 --> Packet: 0001_0000_
-1 --> Packet: ffff_ffff_
2147483647 --> Packet: ffff_7fff_
-2147483648 --> Packet: 0000_8000_
Endianing on
0 --> Packet: 0000_0000_
1 --> Packet: 0000_0001_
-1 --> Packet: ffff_ffff_
2147483647 --> Packet: 7fff_ffff_
-2147483648 --> Packet: 8000_0000_
\ No newline at end of file diff --git a/tests/IecType/output/test.iecInt.php.html b/tests/IecType/output/test.iecInt.php.html deleted file mode 100644 index 583ad9b..0000000 --- a/tests/IecType/output/test.iecInt.php.html +++ /dev/null @@ -1 +0,0 @@ -Endianing off
0 --> Packet: 0000_
1 --> Packet: 0001_
-1 --> Packet: ffff_
32767 --> Packet: 7fff_
-32768 --> Packet: 8000_
Endianing on
0 --> Packet: 0000_
1 --> Packet: 0001_
-1 --> Packet: ffff_
32767 --> Packet: 7fff_
-32768 --> Packet: 8000_
\ No newline at end of file diff --git a/tests/IecType/output/test.iecReal.php.html b/tests/IecType/output/test.iecReal.php.html deleted file mode 100644 index a195b00..0000000 --- a/tests/IecType/output/test.iecReal.php.html +++ /dev/null @@ -1,12 +0,0 @@ -Endianing off
-0 --> Packet: 0000_0000_
-1 --> Packet: 0000_3f80_
--2 --> Packet: 0000_c000_
-0.333333333333 --> Packet: aaab_3eaa_
-25 --> Packet: 0000_41c8_
-Endianing on
-0 --> Packet: 0000_0000_
-1 --> Packet: 3f80_0000_
--2 --> Packet: c000_0000_
-0.333333333333 --> Packet: 3eaa_aaab_
-25 --> Packet: 41c8_0000_
diff --git a/tests/ModbusMaster/output/test.tcp.fc16fc3.php.html b/tests/ModbusMaster/output/test.tcp.fc16fc3.php.html deleted file mode 100644 index 00dd046..0000000 --- a/tests/ModbusMaster/output/test.tcp.fc16fc3.php.html +++ /dev/null @@ -1,72 +0,0 @@ -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 255 - [8] => 0 - [9] => 255 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 255 - [5] => 255 - [6] => 127 - [7] => 255 - [8] => 128 - [9] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 0 - [8] => 255 - [9] => 255 - [10] => 255 - [11] => 255 - [12] => 255 - [13] => 255 - [14] => 127 - [15] => 255 - [16] => 0 - [17] => 0 - [18] => 128 - [19] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 0 - [6] => 63 - [7] => 128 - [8] => 0 - [9] => 0 - [10] => 192 - [11] => 0 - [12] => 170 - [13] => 171 - [14] => 62 - [15] => 170 - [16] => 0 - [17] => 0 - [18] => 65 - [19] => 200 -) diff --git a/tests/ModbusMaster/output/test.tcp.fc26.php.html b/tests/ModbusMaster/output/test.tcp.fc26.php.html deleted file mode 100644 index 7991aa8..0000000 --- a/tests/ModbusMaster/output/test.tcp.fc26.php.html +++ /dev/null @@ -1 +0,0 @@ -writeMultipleRegister (FC26): DONE \ No newline at end of file diff --git a/tests/ModbusMaster/output/test.tcp.socket_protocol_mismatch.php.html b/tests/ModbusMaster/output/test.tcp.socket_protocol_mismatch.php.html deleted file mode 100644 index b25cfe4..0000000 --- a/tests/ModbusMaster/output/test.tcp.socket_protocol_mismatch.php.html +++ /dev/null @@ -1 +0,0 @@ -Caught exception: Unknown socket protocol, should be 'TCP' or 'UDP' diff --git a/tests/ModbusMaster/output/test.udp.fc16fc3.php.html b/tests/ModbusMaster/output/test.udp.fc16fc3.php.html deleted file mode 100644 index 00dd046..0000000 --- a/tests/ModbusMaster/output/test.udp.fc16fc3.php.html +++ /dev/null @@ -1,72 +0,0 @@ -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 255 - [8] => 0 - [9] => 255 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 255 - [5] => 255 - [6] => 127 - [7] => 255 - [8] => 128 - [9] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 0 - [8] => 255 - [9] => 255 - [10] => 255 - [11] => 255 - [12] => 255 - [13] => 255 - [14] => 127 - [15] => 255 - [16] => 0 - [17] => 0 - [18] => 128 - [19] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 0 - [6] => 63 - [7] => 128 - [8] => 0 - [9] => 0 - [10] => 192 - [11] => 0 - [12] => 170 - [13] => 171 - [14] => 62 - [15] => 170 - [16] => 0 - [17] => 0 - [18] => 65 - [19] => 200 -) diff --git a/tests/ModbusMaster/output/test.udp.fc26.php.html b/tests/ModbusMaster/output/test.udp.fc26.php.html deleted file mode 100644 index 7991aa8..0000000 --- a/tests/ModbusMaster/output/test.udp.fc26.php.html +++ /dev/null @@ -1 +0,0 @@ -writeMultipleRegister (FC26): DONE \ No newline at end of file diff --git a/tests/ModbusMasterTcp/output/test.fc16fc3.php.html b/tests/ModbusMasterTcp/output/test.fc16fc3.php.html deleted file mode 100644 index 00dd046..0000000 --- a/tests/ModbusMasterTcp/output/test.fc16fc3.php.html +++ /dev/null @@ -1,72 +0,0 @@ -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 255 - [8] => 0 - [9] => 255 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 255 - [5] => 255 - [6] => 127 - [7] => 255 - [8] => 128 - [9] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 0 - [8] => 255 - [9] => 255 - [10] => 255 - [11] => 255 - [12] => 255 - [13] => 255 - [14] => 127 - [15] => 255 - [16] => 0 - [17] => 0 - [18] => 128 - [19] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 0 - [6] => 63 - [7] => 128 - [8] => 0 - [9] => 0 - [10] => 192 - [11] => 0 - [12] => 170 - [13] => 171 - [14] => 62 - [15] => 170 - [16] => 0 - [17] => 0 - [18] => 65 - [19] => 200 -) diff --git a/tests/ModbusMasterTcp/output/test.fc26.php.html b/tests/ModbusMasterTcp/output/test.fc26.php.html deleted file mode 100644 index 7991aa8..0000000 --- a/tests/ModbusMasterTcp/output/test.fc26.php.html +++ /dev/null @@ -1 +0,0 @@ -writeMultipleRegister (FC26): DONE \ No newline at end of file diff --git a/tests/ModbusMasterUdp/output/test.fc15fc1.php.html b/tests/ModbusMasterUdp/output/test.fc15fc1.php.html deleted file mode 100644 index 55a3de0..0000000 --- a/tests/ModbusMasterUdp/output/test.fc15fc1.php.html +++ /dev/null @@ -1,66 +0,0 @@ -array(32) { - [0]=> - bool(true) - [1]=> - bool(false) - [2]=> - bool(true) - [3]=> - bool(true) - [4]=> - bool(false) - [5]=> - bool(true) - [6]=> - bool(true) - [7]=> - bool(true) - [8]=> - bool(true) - [9]=> - bool(true) - [10]=> - bool(true) - [11]=> - bool(true) - [12]=> - bool(false) - [13]=> - bool(false) - [14]=> - bool(false) - [15]=> - bool(false) - [16]=> - bool(false) - [17]=> - bool(false) - [18]=> - bool(false) - [19]=> - bool(false) - [20]=> - bool(true) - [21]=> - bool(true) - [22]=> - bool(true) - [23]=> - bool(true) - [24]=> - bool(true) - [25]=> - bool(true) - [26]=> - bool(true) - [27]=> - bool(true) - [28]=> - bool(true) - [29]=> - bool(true) - [30]=> - bool(true) - [31]=> - bool(true) -} diff --git a/tests/ModbusMasterUdp/output/test.fc16fc3.php.html b/tests/ModbusMasterUdp/output/test.fc16fc3.php.html deleted file mode 100644 index 00dd046..0000000 --- a/tests/ModbusMasterUdp/output/test.fc16fc3.php.html +++ /dev/null @@ -1,72 +0,0 @@ -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 255 - [8] => 0 - [9] => 255 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 255 - [5] => 255 - [6] => 127 - [7] => 255 - [8] => 128 - [9] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 0 - [8] => 255 - [9] => 255 - [10] => 255 - [11] => 255 - [12] => 255 - [13] => 255 - [14] => 127 - [15] => 255 - [16] => 0 - [17] => 0 - [18] => 128 - [19] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 0 - [6] => 63 - [7] => 128 - [8] => 0 - [9] => 0 - [10] => 192 - [11] => 0 - [12] => 170 - [13] => 171 - [14] => 62 - [15] => 170 - [16] => 0 - [17] => 0 - [18] => 65 - [19] => 200 -) diff --git a/tests/ModbusMasterUdp/output/test.fc16fc3bind.php.html b/tests/ModbusMasterUdp/output/test.fc16fc3bind.php.html deleted file mode 100644 index 00dd046..0000000 --- a/tests/ModbusMasterUdp/output/test.fc16fc3bind.php.html +++ /dev/null @@ -1,72 +0,0 @@ -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 255 - [8] => 0 - [9] => 255 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 1 - [4] => 255 - [5] => 255 - [6] => 127 - [7] => 255 - [8] => 128 - [9] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 1 - [6] => 0 - [7] => 0 - [8] => 255 - [9] => 255 - [10] => 255 - [11] => 255 - [12] => 255 - [13] => 255 - [14] => 127 - [15] => 255 - [16] => 0 - [17] => 0 - [18] => 128 - [19] => 0 -) -Array -( - [0] => 0 - [1] => 0 - [2] => 0 - [3] => 0 - [4] => 0 - [5] => 0 - [6] => 63 - [7] => 128 - [8] => 0 - [9] => 0 - [10] => 192 - [11] => 0 - [12] => 170 - [13] => 171 - [14] => 62 - [15] => 170 - [16] => 0 - [17] => 0 - [18] => 65 - [19] => 200 -) diff --git a/tests/ModbusMasterUdp/output/test.fc2.php.html b/tests/ModbusMasterUdp/output/test.fc2.php.html deleted file mode 100644 index 5baae72..0000000 --- a/tests/ModbusMasterUdp/output/test.fc2.php.html +++ /dev/null @@ -1,7 +0,0 @@ -Test should pass when %IX0.0==FALSE and %IX0.1==TRUE -array(2) { - [0]=> - bool(false) - [1]=> - bool(true) -} diff --git a/tests/ModbusMasterUdp/output/test.fc26.php.html b/tests/ModbusMasterUdp/output/test.fc26.php.html deleted file mode 100644 index 7991aa8..0000000 --- a/tests/ModbusMasterUdp/output/test.fc26.php.html +++ /dev/null @@ -1 +0,0 @@ -writeMultipleRegister (FC26): DONE \ No newline at end of file diff --git a/tests/ModbusMasterUdp/output/test.fc26bind.php.html b/tests/ModbusMasterUdp/output/test.fc26bind.php.html deleted file mode 100644 index 7991aa8..0000000 --- a/tests/ModbusMasterUdp/output/test.fc26bind.php.html +++ /dev/null @@ -1 +0,0 @@ -writeMultipleRegister (FC26): DONE \ No newline at end of file diff --git a/tests/ModbusMasterUdp/output/test.fc6fc3.php.html b/tests/ModbusMasterUdp/output/test.fc6fc3.php.html deleted file mode 100644 index 6102dcd..0000000 --- a/tests/ModbusMasterUdp/output/test.fc6fc3.php.html +++ /dev/null @@ -1,5 +0,0 @@ -Array -( - [0] => 207 - [1] => 199 -) diff --git a/tests/PhpType/output/test.bytes2mixed.php.html b/tests/PhpType/output/test.bytes2mixed.php.html deleted file mode 100644 index 952bc9d..0000000 --- a/tests/PhpType/output/test.bytes2mixed.php.html +++ /dev/null @@ -1 +0,0 @@ -32098
0
0
-1
-25000
25000
\ No newline at end of file diff --git a/tests/PhpType/output/test.bytes2real.php.html b/tests/PhpType/output/test.bytes2real.php.html deleted file mode 100644 index 7d44edb..0000000 --- a/tests/PhpType/output/test.bytes2real.php.html +++ /dev/null @@ -1 +0,0 @@ -1000
2000
1.25
\ No newline at end of file diff --git a/tests/PhpType/output/test.bytes2signedint.php.html b/tests/PhpType/output/test.bytes2signedint.php.html deleted file mode 100644 index a2b10ea..0000000 --- a/tests/PhpType/output/test.bytes2signedint.php.html +++ /dev/null @@ -1 +0,0 @@ --1
0
1
-2147483648
2147483647
diff --git a/tests/PhpType/output/test.bytes2string.php.html b/tests/PhpType/output/test.bytes2string.php.html deleted file mode 100644 index 31bbf09..0000000 --- a/tests/PhpType/output/test.bytes2string.php.html +++ /dev/null @@ -1 +0,0 @@ -eHll oowlr!da
Hello world!
\ No newline at end of file diff --git a/tests/PhpType/output/test.bytes2unsignedint.php.html b/tests/PhpType/output/test.bytes2unsignedint.php.html deleted file mode 100644 index 29be8ee..0000000 --- a/tests/PhpType/output/test.bytes2unsignedint.php.html +++ /dev/null @@ -1,6 +0,0 @@ -float(4294967295) -
int(0) -
int(1) -
float(2147483648) -
int(2147483647) -
diff --git a/tests/PhpType/output/test.strangearray.size.php.html b/tests/PhpType/output/test.strangearray.size.php.html deleted file mode 100644 index d0e619d..0000000 --- a/tests/PhpType/output/test.strangearray.size.php.html +++ /dev/null @@ -1 +0,0 @@ -Exception 'Data are not in array 2 or 4 bytes'
25602
Exception 'Data are not in array 2 or 4 bytes'
25602
Exception 'Data are not in array 2 or 4 bytes'
\ No newline at end of file diff --git a/tests/PhpType/output/test.strangearray.textarray.php.html b/tests/PhpType/output/test.strangearray.textarray.php.html deleted file mode 100644 index 734d099..0000000 --- a/tests/PhpType/output/test.strangearray.textarray.php.html +++ /dev/null @@ -1 +0,0 @@ -Exception 'Data are not numeric' \ No newline at end of file