Author: Clive Whitear
Date: December 21st 1998
Version: ER5 release
Comms
0x10000087
Comms: Quick start
terminal emulation online offline
Comms provides terminal emulation and file transfer to and from other computers.
To exchange files with another computer, the other computer must have communications software that supports terminal emulation, that can transmit and receive ASCII files, or that is capable of XMODEM or YMODEM file transfer.
“Scripts” can also be created to automate dialling, logging on and file transfer.
Further information about Comms can be obtained from the Comms documentation, available from xxxxxxx.
Using Comms
link cable off-line on-line on line off line online offline
If you have EPOC CONNECT use the link cable supplied to connect the EPOC machine to the serial port of the other computer. Set up the EPOC machine's port to have the same settings as the port on the computer you are connected to using Set up on the Toolbar.
The EPOC machine can also be connected to a remote computer via a modem, e.g. to access electronic mail or a bulletin board. In this case you need a modem adaptor. See your supplier for details.
When Comms is started the terminal emulation screen is displayed. The status bar at the bottom of the screen shows if you are online or offline. Each character typed in will be transmitted via the serial port. When a character is received it is displayed on the screen.
•	If the desktop link is on then Comms will be offline when opened. To go on-line, go to the System screen and switch the link off, using Link to desktop on the Tools menu. Then go back to Comms and select Port active on the Transfer menu.
Scripts & names (Comms)
Use Comms to create "Scripts" to automate dialling, logging on and file transfer, by using the commands on the Scripts menu.
Set up script variables (or "names"), e.g. for log-on details, and password protect them using the commands on the Names menu.
To copy sample scripts to a selected folder, select Create standard files on the Tools menu. The sample scripts can then be used directly, or edited to suit your needs.
Setting up (Comms)
handshaking flow control stop bits parity teletype VT100
Select Communication settings on the Tools menu.
•	Set the Use comms port line to 'Serial port 0’ if you're using a docking cable and adaptor connection to a modem or 'Infrared’ to use infrared communications.
•	Set the Baud rate line to the data communication speed. It should match the speed setting on the remote machine, and should not exceed the maximum speed of the modem being used.
•	Modern modems can sense and adjust to the transmission speed. With older modems, it may be necessary to specify the exact speed of the connection.
•	Set the Data bits, Stop bits and Parity lines to the same settings as the remote machine.
•	Use the tick boxes on the Handshaking page to select the flow control required.For a modem connection, XON/XOFF, DSR/DTR and RTS/CTS should normally be set, but this depends on the remote setup and the modem manufacturer’s guidelines. For ‘Hardware’ flow control, tick the ‘RTS/CTS’ box.
Comms is initially set to emulate a VT100 terminal. To select a teletype terminal, select Terminal emulation on the Tools menu and set the Terminal to emulate line to 'TTY'. Set the screen width and height as the number of characters.
Comms is initially set to add a “line feed” character to incoming and outgoing “carriage returns”. To change this select Translate codes on the Tools menu, then use the Add LF to incoming CR and Add LF to outgoing CR lines.
Connecting to another machine (Comms)
To communicate between the EPOC machine and, say, a PC:
1.	Connect the serial linkcable to the serial port and to a COM port on the PC.
2.	Make sure neither machine is running software that uses the communications ports (e.g. EPOC CONNECT on the PC). Make sure the EPOC machine has the Link to desktop switched off, and is not trying to carry out an infrared transfer.
3.	Start Comms on the EPOC machine, and run a Terminal application on the PC. If using Windows 95, this may be HyperTerminal.
4.	Set both pieces of software to use the appropriate ports, and to use identical settings for Baud rate, Data bits, Stop bits, Parity and Handshaking. The two machines are now ready to exchange characters and files.
Connecting via a modem (Comms)
pause pausing
To communicate using a modem:
1.	Connect the EPOC machine to the modem using the Docking cable and a modem adaptor lead. Connect the modem to a telephone socket.
2.	Use Link to desktop on the Tools menu in the System screen and set the Link line to 'Off'.
•	When you want to turn the link back on again later, you should close Comms first.
3.	Set the communication settings appropriate to the modem’s maximum speed, and identical to the remote machine’s settings. Check that the Baud rate used does not exceed the maximum for the two machines.
4.	To start communications with the modem, type "AT" and press Enter.
The modem will return ‘OK’, in the Terminal emulation screen. If it doesn’t, make sure all cables are connected correctly and the communication settings are appropriate to the modem according to the manufacturer’s instructions.
5.	Type the modem initialisation string appropriate to the modem. This may be ‘ATZ’ or ‘AT&F’; check the modem manual for details.
6.	Type ‘ATDT’ followed by the telephone number (including any dial-out prefix required) of the remote modem. When the other modem answers, ‘CONNECT’ will be displayed in the Terminal window, and you can begin to log in. This may require pressing the Enter key a few times to get a “prompt” (a line of text sent by the remote machine, such as ‘username:’ which waits for a command or a response).
•	If characters from a remote host are received too quickly to read, use Pause on the Transfer menu to temporarily stop incoming information. Use Pause again to resume the transfer.
•	If handshaking cannot be used, data may be lost if the EPOC machine is paused while the other machine is sending information. To avoid this, set a lower Baud rate.
Connecting via infrared (Comms)
To communicate with another EPOC machine, an infrared-enabled PC or an infrared-enabled modem:
1.	Select Communication settings on the Tools menu and set the comms port to ‘Infrared’.
2.	When the other machine is ready to communicate with the EPOC machine via infrared, continue as you would normally using the serial link cable.
•	Use Comms to transfer multiple files between two EPOC machines using YModem (batch) protocol (multiple files can't be transferred using normal infrared transfer).
Sending & receiving files (Comms)
capture to file transferring files
Before files can be transferred, you must establish a connection to the remote machine.
To send a file:
1.	Select Send file on the Transfer menu, or tap Send file on the Toolbar.
2.	Select the transfer protocol in the Send file dialog. Make sure it is one the remote machine supports and is prepared to receive.
3.	Use the Name, Folder and Disk lines to locate the file to be sent.
4.	Press OK on the EPOC machine and prepare the other machine to receive a file. If possible, perform these actions simultaneously.
To send more than one file:
1.	Create a folder specifically for the files to be sent, place all the relevant files in it and select Send file on the Transfer menu.
2.	Select the ‘YModem (batch)’ protocol, then select the folder containing the files to be sent in the Folder line.
3.	Press the Tab key in the Name line, hold down Shift while using the down arrow key to select all the files in the folder, then press Enter. Press OK and prepare the remote machine to receive a file.
To receive files:
1.	Select Receive file on the Transfer menu, or tap Receive file on the Toolbar.
2.	Select the transfer protocol in the Receive file dialog. Make sure it is the one the remote machine will use to send the file. Use Ymodem (batch) protocol for multiple files.
3.	Choose a folder for the file to be saved in. If a file is being received using either the ASCII or XModem protocol, specify a filename (YModem transfers take the filename from the sending machine).
•	Remember to include filename extensions where appropriate.
4.	Press OK on the EPOC machine and instruct the remote machine to send the file. If possible, perform these actions simultaneously.
•	To stop transfer at any time, tap the Cancel button in the file transfer dialog.
Receiving information with no protocol:
If information is being received as plain ASCII characters, e.g. e-mail from a server, it can be "captured" to a file. To do this:
1.	Select Capture to file on the Transfer menu and type filename.
•	For the new information to be added to the end of an existing file, enter the name of the existing file and tick the Append box.
•	For incoming control characters to be recorded in angled brackets, e.g. ‘<13>’ for a carriage return, tick the Debug box.
2.	To end the capture, deselect the Capture to file menu option.
Captures are stored as plain text files. A plain text file can be viewed in Word, by using the More|Import text file command on the File menu.
If problems are encountered when transferring information with no protocol, try setting both computers to use a lower Baud rate.
Creating & running scripts (Comms)
run script create standard files edit script stop script
Use a "Scripts" to automate dialling, logging on and file transfer, by using the commands on the Scripts menu.
1.	Select Create new script from the Scripts menu. Enter a name and location for the script and press OK.
•	Script names must have a ‘.scr’ extension. When a script is saved, Comms will add ‘.scr’ to the end of its name.
2.	Comms will move to the script editor and you can type in the script.
3.	Tap Save to return to the main Comms view.
•	When creating a new script for, e.g., a connection to a BBS system, it can be useful to first record the logging in process using Capture to file on the Transfer menu. This records the prompts sent from the remote machine when connecting, and can be used as the starting point for your script.
To access the EPOC machine's example script, select Create standard files on the Tools menu. Select a folder for Comms to place the example script in, and press OK.
To edit the example script or one of your own, select Open on the Scripts menu, and choose the script to be worked on. Press OK.
To check a script, select Syntax check on the Scripts menu and specify the script to be checked.
To run a script:
Select Start Script from the Scripts menu, and choose the appropriate script in the Start script dialog.
The name of the running script is displayed at the bottom of the Terminal emulation screen.
To stop a script:
Select Stop script from the Scripts menu.
Script commands (Comms)
Here is a summary of commands for the Script language.
& see Send
//
ALERT <string exp>[,<string exp>]
AND
AS see Open
ASC (<string exp>)
BEEP <value>,<value>
BREAK
CALL <filename>
CAPTURE <filename>,[APPEND[,DEBUG]]
CAPTURE OFF
CATCH [INCLUDE/EXCLUDE] ,<string>, <variable>, <timeout>, <maxlength> GOTO <label>
CHAIN <filename>
CLOSE see Open
CLS
COLLATE (<string exp>)
CONNECT <value> GOTO <label>
CONTINUE
COPY <filename>,<filename>
DELETE <filename>
DIR (<string exp>)
DO see While
DOWNLOAD <filename>,<string>
DRAIN
EOF see Open
EXISTS <filename>
EXIT
FALSE
FOLD <string exp>
FOR see Open
FORGET
GOTO <label>
HANGUP
IF <exp>THEN<command>[[ELSE]<command>[ELSEIF<exp>THEN<command>]] ENDIF
INFO <string exp>
INPUT see Open
LEFT (<string exp>,<value>)
RIGHT (<string exp>,<value>)
LEN <string exp>
LOADNAMES <filename>
SAVENAMES <filename>
LOWER <string exp>
MENU <string exp>
	<string exp> GOTO <label>
	<string exp> GOTO <label>
	…
ENDMENU
MID (<string exp>,<value>[,<value>])
MOVE <filename>,<string exp>
NOT
ON ERROR GOTO <label>
ON ERROR OFF
OPEN <filename> FOR [INPUT/OUTPUT/APPEND] AS <handle>
	READ <length>,<variable>,<handle>
	WRITE <handle>,<string>
	EOF <handle>
CLOSE <handle>
OR
OUTPUT see Open
QUERY <string exp>
	<string exp>,<variable>
	<string exp>,<variable>
ENDQUERY
READ see Open
RENAME <filename>,<filename>
REPEAT
	<command>
UNTIL <expression>
RESET
RIGHT see Left
SAVENAMES see Loadnames
SEND <string exp> [;] [& <string exp>]
SENDBREAK
SENDWAIT <value> <string exp>,<string exp> GOTO <label>
SET <variable>=<value>
SETUP
	BAUD [rate]
	PORT [COMM::0][IRCOMM::0]
	DATA [5][6][7][8]
	FAIL [DSR][DCD][PARITY]
	HANDSHAKE [DCD][RTSCTS][DSR][XONXOFF][NONE]
	PARITY [NONE][ODD][EVEN]
	STOP [1][2]
	TIMEOUT [timeout]
ENDSETUP
STATUS <string exp>
TRUE
UNTIL see Repeat
UPLOAD <filename>,<string>
UPPER <string exp>
VERSION
WAIT <value>
	<string exp> GOTO <label>
	<string exp> GOTO <label>
	…
ENDWAIT
WHILE <exp> DO
	…
ENDWHILE
WRITE see Open