PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → SockertWrite
SockertWrite
Iniciado por mail, 28,ago. 2019 17:29 - 1 respuesta
Publicado el 28,agosto 2019 - 17:29
Hello,
I have to send a command chain to the printer to clear the printer buffer.
Here is the script:

IF SocketConnect("PrinterEimer", 9100, "192.168.10.52") = True THEN
SocketWrite("PrinterEimer", "<STX>041C1??<CR>" )
SocketClose("PrinterEimer")
Info("Stopsignal übertragen")
END

But unfortunately that does not work.
When I test the command: <STX>041C1??<CR> with Hercules terminal it works.

What am I doing wrong?
Please help.

Thank you for that.

KR michael
Publicado el 29,agosto 2019 - 13:34
Hi!
Check if the socked exists using
IF SocketExist("PrinterEimer") = False THEN
or block your code until

WHILE SocketExist("PrinterEimer") = False

try to connect using <Maximum Time-out>: Optional integer or optional Duration param
SocketConnect("PrinterEimer", 9100, "192.168.10.52",10000)

if doesnt work , try yo use the DNS name of the IP "192.168.10.52" if you have one.
I had same problems using addresses, but if I use string names works.


check: https://doc.windev.com/…


Tchüss.
Angeles