Hi,
Danke. werde ich mir mal anschauen und so testen..
Gruß
Danke. werde ich mir mal anschauen und so testen..
Gruß
[TABLE="border: 0, cellpadding: 0, cellspacing: 0"] [TR] [TD] Fehlercode: 2 | Zeile: 41 | socket_read(): unable to read from socket [107]: Transport endpoint is not connected[/TD] [TD]ERROR[/TD] [/TR] [/TABLE]
###[LBS]### <? function LB_LBSID($id) { $E=getLogicEingangDataAll($id); $ip = $E[2]['value']; if (getLogicElementVar($id,1)!=1) { setLogicElementVar($id,1,1); if ($E=getLogicEingangDataAll($id)) if (!filter_var($ip, FILTER_VALIDATE_IP) === false) callLogicFunctionExec(LBSID,$id); } else setLogicLinkAusgang($id,1,1); } ?> ###[/LBS]### ###[EXEC]### <? require(dirname(__FILE__)."/../../../../main/include/php/incl_lbsexec.php"); set_time_limit(0); //Script soll maximal 2 Sekunden laufen sql_connect(); $E=getLogicEingangDataAll($id); $ip = $E[2]['value']; $port = $E[3]['value']; $myip = global_serverIP; $SEND_NORM = 'hh@B'; $CONF_ACK = 'hh '; $NDAT = 'hhs'; $NDAT2 = 'h>>hs'; $NDAT3 = 'hhs'; $NDAT4 = 'h,,hs'; // connection $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $bind = socket_bind($sock,$myip ); socket_connect($sock, $ip, $port); socket_set_nonblock($sock); socket_set_option($sock,SOL_SOCKET,SO_KEEPALIVE,1); function send($sock, $cmd) { $result = socket_write($sock,$cmd); return $result; } // read loop while (1) { $buf = socket_read($sock,2048); // read data from socket if ($buf!='') { setLogicLinkAusgang($id,6,$buf); switch ($buf){ case 'hh@B': send($sock,'hh '); setLogicLinkAusgang($id,1,$buf); // weiterer Code was nach einem SEND_NORM noch gemacht werden soll break; case 'hhs': send($sock,'hh '); setLogicLinkAusgang($id,2,$buf); // weiterer Code was nach einem NDAT noch gemacht werden soll break; case 'h>>hs': send($sock,'hh '); setLogicLinkAusgang($id,3,$buf); // weiterer Code was nach einem NDAT2 noch gemacht werden soll beak; case 'hhs': send($sock,'hh '); setLogicLinkAusgang($id,4,$buf); // weiterer Code was nach einem NDAT3 noch gemacht werden soll break; case 'h,,hs': send($sock,'hh '); setLogicLinkAusgang($id,5,$buf); // weiterer Code was nach einem NDAT4 noch gemacht werden soll break; default: break; } } usleep(100000); } sql_disconnect(); ?> ###[/EXEC]###
Port 01 | |
Port alias | |
Serial Parameters | |
Baud rate | 9600 |
Data bits | 8 |
Stop bits | 1 |
Parity | None |
Flow control | None |
FIFO | X Enable O Disable |
Interface | RS-232 Only |
Port 01 | |
Operation mode | TCP Server Mode |
TCP alive check time | 7 (0 - 99 min) |
Inactivity time | 0 (0 - 65535 ms) |
Max connection | 4 |
Ignore jammed IP | X No O Yes |
Allow driver control | X No O Yes |
Data Packing | |
Packing length | 0 (0 - 1024) |
Delimiter 1 | 16 (Hex) X Enable |
Delimiter 2 | 0 (Hex) O Enable |
Delimiter process | Do Nothing (Processed only when Packing length is 0) |
Force transmit | 0 (0 - 65535 ms) |
TCP Server Mode | |
Local TCP port | 4200 |
Command port | 966 |
Wir verarbeiten personenbezogene Daten über die Nutzer unserer Website mithilfe von Cookies und anderen Technologien, um unsere Dienste bereitzustellen. Weitere Informationen findest Du in unserer Datenschutzerklärung.
Indem Du unten auf "ICH stimme zu" klickst, stimmst Du unserer Datenschutzerklärung und unseren persönlichen Datenverarbeitungs- und Cookie-Praktiken zu, wie darin beschrieben. Du erkennst außerdem an, dass dieses Forum möglicherweise außerhalb Deines Landes gehostet wird und bist damit einverstanden, dass Deine Daten in dem Land, in dem dieses Forum gehostet wird, gesammelt, gespeichert und verarbeitet werden.
Kommentar