0.3 Release
This commit is contained in:
@@ -0,0 +1 @@
|
||||
eHll oowlr!da<br>Hello world!<br>
|
||||
@@ -0,0 +1 @@
|
||||
Exception 'Data are not in array 2 or 4 bytes'<br>25602<br>Exception 'Data are not in array 2 or 4 bytes'<br>25602<br>Exception 'Data are not in array 2 or 4 bytes'<br>
|
||||
@@ -0,0 +1 @@
|
||||
Exception 'Data are not numeric'
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../Phpmodbus/ModbusMasterUdp.php';
|
||||
|
||||
// Received bytes interpreting 3 REAL values (6 words)
|
||||
$data = array( // String "Hello word!"
|
||||
0x48, //H
|
||||
0x65, //e
|
||||
0x6c, //l
|
||||
0x6c, //l
|
||||
0x6f, //o
|
||||
0x20, //
|
||||
0x77, //w
|
||||
0x6f, //o
|
||||
0x72, //r
|
||||
0x6c, //l
|
||||
0x64, //d
|
||||
0x21, //!
|
||||
0x00, //\0
|
||||
0x61, //a
|
||||
0x61 //a
|
||||
);
|
||||
|
||||
// Print string interpretation of the values
|
||||
echo PhpType::bytes2string($data) . "<br>";
|
||||
echo PhpType::bytes2string($data, true) . "<br>";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
require_once dirname(__FILE__) . '/../../Phpmodbus/ModbusMasterUdp.php';
|
||||
|
||||
// Received bytes interpreting Mixed values
|
||||
$data = Array (
|
||||
"0" => 100, // 32098 (DINT)
|
||||
"1" => 2,
|
||||
"2" => 0,
|
||||
"3" => 0,
|
||||
"4" => 100, // 32098 (DINT)
|
||||
"5" => 2
|
||||
);
|
||||
|
||||
// Print mixed values
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 1)) . "<br>";
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not in array 2 or 4 bytes'". "<br>";
|
||||
}
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 2)). "<br>";
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not in array 2 or 4 bytes'". "<br>";
|
||||
}
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 3)). "<br>";
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not in array 2 or 4 bytes'". "<br>";
|
||||
}
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 4)). "<br>";
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not in array 2 or 4 bytes'". "<br>";
|
||||
}
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 5)). "<br>";
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not in array 2 or 4 bytes'". "<br>";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
require_once dirname(__FILE__) . '/../../Phpmodbus/ModbusMasterUdp.php';
|
||||
|
||||
// Received bytes interpreting Mixed values
|
||||
$data = Array (
|
||||
"0" => 100, // 32098 (DINT)
|
||||
"1" => "e",
|
||||
"2" => 0,
|
||||
"3" => 0
|
||||
);
|
||||
|
||||
// Print mixed values
|
||||
try {
|
||||
echo PhpType::bytes2unsignedInt(array_slice($data, 0, 4));
|
||||
} catch(Exception $e) {
|
||||
echo "Exception 'Data are not numeric'";
|
||||
}
|
||||
?>
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
set php=C:\Programme\xampplite\php\php.exe
|
||||
set php=c:\Program_Files\xampplite\php\php.exe
|
||||
rem set php=C:\PHP\versions\php-5.2.6-Win32\php.exe -d auto_prepend_file=C:\PHP\locale.php
|
||||
set diff="C:\Program Files\Octave\msys\bin\diff.exe"
|
||||
set testUri=http://localHost/nette/_trunk/tests
|
||||
set wget=wget.exe
|
||||
set diff="diff.exe"
|
||||
rem set testUri=http://localHost/nette/_trunk/tests
|
||||
rem set wget=wget.exe
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<?php
|
||||
$testip = "192.168.1.15";
|
||||
$testip = "192.192.15.51";
|
||||
?>
|
||||
Reference in New Issue
Block a user