PortNum is int
PortNum = sOpen("COM5", 200, 200, 1) // Open COM1
IF PortNum <> 0 THEN
//sParameter(PortNum, 9600, 1, 8, 0) //// Configure COM1: Rate 9600, even parity, 8 data bits, 1 stop bit
cMessage is character = "P"
nNumCarEscritos is int
nNumCarEscritos = sWrite(PortNum, cMessage) // Send a message to the output buffer of COM2
// Wait for the end of the write operation
LOOP
IF sInExitQueue(PortNum) = 0 THEN BREAK
END
Number is int
MessageRead is string
MessageRead = sRead(PortNum, 200)
Info("End of write operation", "caracteres escritos: " + nNumCarEscritos, "caracteres salida: " + Number , MessageRead)
sClose(PortNum) // Close COM1 // End of process
ELSE
Error("Error while opening COM5")
END
No hay comentarios.:
Publicar un comentario