User guide

eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 156
In order to know if the connection is established, the user has 2 options:
• Check the scheduled action status by checking the PRG,ACTIONSTAT (See GETSYS, SETSYS on page 141).
• Read the file with GET: as long as the file is not actually opened, the function returns #CLOSED#.
When the function stops sending #CLOSED# the file can be read and written for socket operations.
Example:
9.2.57.3.3 COM port open Syntax [command]
OPEN S1 FOR BINARY INPUT|OUTPUT AS E1
Note:
This command works only with BINARY
S1 will be as follows:
"com:n,b,dpsh"
• where n is 1 to 4 (the port number, 1 is Front panel serial port, 2 is Modem Port)
• where b is the baud rate
• where d is the number of bits "7" or "8"
• where p is the parity: "e","o" or "n"
• where s is the number of stop bit "1" or "2"
• where h is the handshaking "h": half duplex, "r": yes Rts/Cts, "n": No
This command will open the serial port to port 1 or 2 with the given line parameters.
The configuration can be accessed using GETSYS SYS & SETSYS SYS to update the serial configuration and to enable/disable Modbus if
needed.
E1 is the file number. After the OPEN operation, the file is referenced by its file number and not by its file name.
There are 8 file numbers available. Once a file number is assigned to a file it is allocated to that file until the CLOSE command is issued.
REM: Attempting to USE a serial port used by an IO server is not allowed and returns an error.
Example Comment
OPEN "tcp:10.0.0.1:25" FOR BINARY OUTPUT AS 1
PUT 1,CHR$(13)+CHR$(10)
A$=GET 1
CLOSE 1
Opens socket to 10.0.0.1 port 25
for read access.
Write CRLF then read response.