Token Programming
Defined Tokens
7-16
Stratagy I&M 06/02
S( )
Serial port access—the S( ) token gives Stratagy access to serial ports. By communicating over
serial ports, Stratagy can access other computers and store and/or retrieve information from remote
databases.
Once an S( ) token has been executed, the serial port is locked for exclusive access by the current
User ID. The lock is removed only when Stratagy finishes executing the User ID's Extension field.
This enables several related S( ) tokens to be executed while the port is locked.
To properly use this token, the physical serial port must have certain configuration parameters
defined. These parameters are grouped together under “Serial Port Descriptions” of the Stratagy
System Configuration options (
Chapter 4 – Configure Stratagy
Syntax
S(port,S,%Sn,termination,length,timeout)
where:
port
Logical serial port (1 or 2) mapped onto a physical port number by the Stratagy System
Configuration parameter serial_port1 for logical port 1 or serial_port2 for logical port 2
(
Chapter 4 – Configure Stratagy
).
S
String sent out on the specified port. It may contain any alphanumeric characters, %S
variables, and the following special characters:
\A
Attention (bell sound), or Ctrl+G
\N
Newline, or Ctrl+J
\R
Return, or Ctrl+M
\T
Tab, or Ctrl+I
\\
Backslash, the actual \ character
%Sn
One of the %S storage variables (range: 0~19), which stores any response from the
serial port. If omitted, Stratagy does not wait for a response.
length
Maximum number of characters to expect as input on the serial port. If the maximum
number of characters is received, processing continues immediately with whatever
characters that were received in the %Sn variable. If this option is omitted, it defaults to
the maximum length of %Sn (128 characters).
termination
List of characters that defines when Stratagy should stop reading from the serial port for
storing in the specified %Sn variable. If omitted, defaults to “\N\R” as specified under
“S”. The terminating character, if any, is not part of %Sn.
timeout
Maximum time (tenths of seconds) Stratagy waits for input on the serial port when
reading into the %Sn variable. When the timeout expires, Stratagy continues
processing with the next token. Whatever characters, if any, received up to that point
are placed in the %Sn variable. If this option is omitted, the default is the value of the
Stratagy System Configuration parameter tmo_serial (
Chapter 4 – Configure Stratagy
Example
S(1,”GET INFO”,%S1,”\N”,80,40)
where:
1
Logical serial port.
”GET INFO” String sent out of port by Stratagy.
%S1
Store response in %S1 variable.
\N
Newline (Line feed)
80
Maximum number of characters expected as input from serial port.
40
Four-second time out waiting for input from serial port.
Table 7-3
Defined Tokens (continued)
Token
Description
Содержание Stratagy Flash
Страница 20: ...Contents Index viii Stratagy I M 06 02 ...
Страница 24: ...Introduction Related Documents Media xii Stratagy I M 06 02 ...
Страница 52: ...Installation Step 16 Optional Back up Database Mailbox Names and Greetings 2 18 Stratagy I M 06 02 ...
Страница 102: ...Configure Stratagy SMDI Serial Integration 4 38 Stratagy I M 06 02 ...
Страница 204: ...Customization Examples Auto Menu Examples 8 28 Stratagy I M 06 02 ...
Страница 214: ...AMIS Networking AmisNodeList 9 10 Stratagy I M 06 02 ...
Страница 222: ...System Reports Report Menu Field Descriptions 10 8 Stratagy I M 06 02 ...
Страница 250: ...Special Greeting User ID Mailboxes Operator Mailbox Greeting B 6 Stratagy I M 06 02 ...