-> Hier kostenlos registrieren
Hello,
Thank for you website
I need to connect s7plc.php to my siemens S7 1200 and it currently does not work :x
The solution that works is this one :
With this code how to write and read just one value in a DB ?
DBNAME = Data_rcv [DB11]
LINE 2 = R_No
DATA TYPE = Char
VALUE = A
Thank you and sorry I speak french in belgium
Thank for you website
I need to connect s7plc.php to my siemens S7 1200 and it currently does not work :x
The solution that works is this one :
Code:
<?php$host = "192.168.1.201";
$port = 2000;
$messages = "Hello Server";
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
// connect to server
$result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");
// send string to server
socket_write($socket, $message, strlen($message)) or die("Could not send data to server\n");
// get server response
$result = socket_read ($socket, 1024) or die("Could not read server response\n");
echo "Reply From Server :".$result;
// close socket
socket_close($socket);
?>
With this code how to write and read just one value in a DB ?
DBNAME = Data_rcv [DB11]
LINE 2 = R_No
DATA TYPE = Char
VALUE = A
Thank you and sorry I speak french in belgium