Cicode Programming Reference > Cicode Function Categories > Communication Functions > SerialKey

SerialKey

Redirects all serial characters from a port to the keyboard. If using a keyboard attached to a serial port, you should call this function at startup, so that Citect SCADA copies all characters (read from the port) to the keyboard. The Port needs to be defined in the Ports database.

If the port is not on an I/O server, you need to create a dummy I/O server record (for example, name the server DServer1). Complete the Boards and Ports records. Set the following parameters in the CITECT.INI file:

[IOServer]Name to the server name (for example, DServer1)
[IOServer]Server to 0

This method enables the port without making the computer an I/O server. (If the I/O server is enabled (and not required as an I/O server), extra overhead and memory are used.)

This function can only be called from an I/O server.

Syntax

SerialKey(sPort)

sPort:

The name of the port connected to the serial keyboard.

Return Value

0 (zero) if successful, otherwise an error code is returned.

Related Functions

ComOpen

Example

SerialKey("Port1"); ! enable the serial keyboard

See Also

Communication Functions

Published June 2018