The text of a manual · part 28 of 37
Native Terminal Emulation Programmer's Guide: Chapter 6: Terminal Commands, pages 237 to 246
Pages 237 to 246 of 340, from Native Terminal Emulation Programmer's Guide
The original document is the PDF (2.9 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 2435
Page 237
Chapter 6, Terminal Commands
WtD/ \BE (Erase Bank) WtD/\BE removes all banks, or bank numbers nn to the last bank stored. Banks from 00 to nn-1 remain in bank storage after the command executes.
Command WtD/\BEnn<cr>
DCS or Gateway Response OK<cr>
R Response tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S nn Bank number (00–99)
R Response Variables S t
Terminal number (000–126)
S z
Response code S 0=Command Executed S 4=Bad Bank Number S 9=Format Error
Example 1 W000D/\B\Hello World\Data String\13 Characters\Bank Field #3<cr> R Response: 000K\\0<cr>
Example 2 W000D/\BE01<cr> R Response: 000K\\0<cr>
Bank data including and following “Data String” is erased.
Native Terminal Emulation Programmer’s Guide
217
Page 238
Chapter 6, Terminal Commands
WtD/ \C (Set Screen Mode) WtD/\C switches the screen mode between the 16-character by 9-line and the 21-character by 15-line displays. The power-up screen appears after this command executes.
Command WtD/\Cx<cr>
DCS or Gateway Response OK<cr>
R Response tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S z
Screen mode S 0=16x9 S 1=21x15
The screen mode is set with a 6- or 12-byte string. For the 6-byte string, the first three bytes set the screen Y parameters and the last three are screen X parameters. Using the 12-byte string is the same, except the last six set alternate Y and alternate X screen parameters.
R Response Variables
218
S t
Terminal number (000–126)
S z
Response code S 0=Command Executed S 1=Bad Command S 9=Format Error
Native Terminal Emulation Programmer’s Guide
Page 239
Chapter 6, Terminal Commands
WtD/ \P (Print) WtD/\P transmits data via the terminal’s RS-232 serial port to an external device (for example, a printer). This command can control the port setup options o, consisting of P, L, H, W, D, and C variables. The WtD/\PS (Set RS-232 Port Options) command can also preset parameters. Individual hexadecimal characters can be escaped with the “^xx” extension. For more information, see “Pass-Through Hex Character” on page 197.
Command WtDo/\P\x<cr>
DCS or Gateway Response OK<cr>
R Response tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S o
RS-232 port options (see the following table)
S x
Data
| (0x7C)
Allows the Bank, Blank, and Pass-Through Hex Stream command extensions (see “Command Extensions” on page 196).
RS-232 Port Options o
Alternative
Default
C
XON/XOFF control
No flow control
D
DTR-DSR
No flow control
Hx
Time-out; RS-232 port ready in x sec
3 sec
Lx x=speed: S 0=9600 bps S 1=4800 bps S 2=2400 bps S 3=1200 bps S 4=300 bps S 5=19200 bps S 6=38400 bps
0 (9600 bps)
P
Sum of “P value” choices. For values, see the 0 (1 stop bit, 8 data bits, even parity, parity disabled) “P Values” table on the next page.
W
CTS busy
Native Terminal Emulation Programmer’s Guide
No wait for CTS
219
Page 240
Chapter 6, Terminal Commands
R Response Variables S t
Terminal number (000–126)
S z
Response code S 0=Data Printed Correctly S 9=Format Error S A=CTS time-out S B=DSR time-out S C=XON/XOFF time-out
Use the following table to find a “P value” for data bits, stop bits, parity, and baud rate. Add the assigned values to produce a unique sum (for help, see the example below). No combination of values produces the same sum as any other. P Values P Value
Alternatives
1
1=2 stop bits; 0=1 stop bit (default)
2
2=7 data bits; 0=8 data bits (default)
4
4=odd parity; 0=even parity (default)
8
8=parity enabled; 0=parity disabled (default)
Example Initialize the RS-232 port of terminal 004, and transmit the message “DATA.” Set RS-232 controls to: S 7 data bits S Even parity S Parity enabled S 1 stop bit S 4800 bps S XON flow control enabled P value: 7 data bits Even parity Parity enabled 1 stop bit P value
=2 =0 =8 =0 = 10 (P10)
L value: 4800 bps=1 (L1) C value: XON Flow Control enabled=C (C) The command is: W004DP10L1C/\P\DATA<cr>
220
Native Terminal Emulation Programmer’s Guide
Page 241
Chapter 6, Terminal Commands
WtD/ \PM (Port in Use Message) WtD/\PM defines a message the terminal displays when the RS-232 port is in use. If no message is defined, default message “RS-232 PORT IN USE PLEASE WAIT” appears. Individual hexadecimal characters can be escaped with the “^xx” extension. For more information, see “Pass-Through Hex Character” on page 197.
Command WtD/\PMx<cr>
DCS or Gateway Response OK<cr>
R Response tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S x
Host-defined message to appear during RS-232 port operation
| (0x7C)
Allows the Bank and Blank command extensions (see “Command Extensions” on page 196).
R Response Variables S t
Terminal number (000–126)
S z
Response code S 0=Good Status S 2=Port In Use (message is larger than screen size) S 3=Data Error or Buffer Overflow
If you use a user-defined message, you can reset it to the default message by issuing WtD/\PM with a message length of 0. The minimum defined character string is one character. The maximum character string depends on screen size and font size.
Example 1 Host: W000D/\PM Here is the message to appear during RS-232 port commands.<cr> Terminal response: OK<cr> Host command: R<cr> Terminal response: 000K\\0<cr> Status code “0” indicates “good status” for the command. The message, “Here is the message to appear during RS-232 port commands” appears while the RS-232 port is operating.
Native Terminal Emulation Programmer’s Guide
221
Page 242
Chapter 6, Terminal Commands
Example 2 (For use with 144-character screen) Host: W000D/\PMWaiting for Data|16|16|16|16|16|16|16Please be patient<cr>
Terminal response: OK<cr> Host command: R<cr> Terminal response: 000K\\2<cr> Status code “2” is returned because the message string is one character longer than the large character screen can handle. Switch to the 315-character screen and send the same command: Host: W000D/\PMWaiting for Data|16|16|16|16|16|16|16Please be patient<cr>
Terminal response: OK<cr> Host command: R<cr> Terminal response: 000K\\0<cr> Status code “0” indicates good status. The message “Waiting for Data” appears when the RS-232 port is operating.
Example 3 Host: W000D/\PM|991|992|993|16<cr> Terminal response: OK<cr> Host command: R<cr> Terminal response: 000K\\3<cr> Status code “3” is returned because the blank extension caused the message to exceed the screen length. Note that although the host sent only 15 characters to the terminal, the total expanded character count is 316, which exceeds the screen size.
222
Native Terminal Emulation Programmer’s Guide
Page 243
Chapter 6, Terminal Commands
WtD/ \PS (RS-232 Port Options) WtD/\PS establishes the baud rate, data bits, parity, and flow control at the terminal’s RS-232 port. This command is sent before a WtD/\yP (Print Table) command to initialize the RS-232 port. The port setup options consisting of P, L, H, W, D, and C variables (see the “RS-232 Port Options” table on page 219) control the RS-232 port.
Command WtDo/\PS<cr>
DCS or Gateway Response OK<cr>
R Response tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S o
RS-232 port options (see the “RS-232 Port Options” table on page 219)
R Response Variables S t
Terminal number (000–126)
S z
Response code S 0=Parameters Set Correctly
Example Initialize the RS-232 port with the following parameters: S 7 data bits S Even parity S Parity enabled S 1 stop bit S 4800 bps S XON flow control enabled P value: 7 data bits Even parity Parity enabled 1 stop bit P value
=2 =0 =8 =0 = 10 (P10)
L value: 4800 bps=1 (L1) C value: XON Flow Control enabled=C (C) The RS-232 Port Control syntax is: WtDP10L1C/\PS<cr>
Native Terminal Emulation Programmer’s Guide
223
Page 244
Chapter 6, Terminal Commands
WtD/ \PG (Get Data from an External Device) WtD/\PG gets continuous data from an RS-232 device, such as an intelligent printer. Use this command when the device sends a continuous data stream to the terminal.
Command WtDo/\PGi<cr>
DCS or Gateway Response OK<cr>
R Response tK\\x<cr> tK\\z<cr>
Command Variables S t
Terminal number (000–126)
S o
RS-232 port options (see the “RS-232 Port Options” table on page 219)
S i
RS-232 input options (see the following table)
WtD/\PG (Get Data from an External Device) RS-232 Input Options i
Function
Range
Eaa
Ending (delimiter) character ASCII hex code aa=ASCII code from 00-FF hex
F
Return the Start Character
No parameters
Start Character not returned
Mxx
Maximum characters to receive xx=decimal number from 00-99
99
Nxx
Number of delimiter occurrences xx=decimal number from 00-99
00
P
Return error code on any parity error
No parameters
Ignore parity errors before Start Character
Saa
Starting character ASCII hex code aa=ASCII code from 00-FF hex
Txx
Time-out (terminal waits xx sec for data)
xx=decimal number from 00-99. If xx=00, the terminal waits indefinitely for RS-232 input or a key press to terminate.
224
Default
05 sec
Native Terminal Emulation Programmer’s Guide
Page 245
Chapter 6, Terminal Commands
R Response Variables S t
Terminal number (000–126)
S x
Data
S z
External Device Response Codes S tK\\9 Syntax error S tK\\A Printer time-out on CTS S tK\\B Printer time-out on DSR S tK\\C Printer time-out XON/XOFF S tK\\E Error with E option (00 < xx < FF) S tK\\K If Txx=00 and a key is pressed, no input data is returned S tK\\M Error with M option (00 < xx < 99) S tK\\N Error with N option (00 < xx < 99) S tK\\P Data parity error on RS-232 input S tK\\S Error with S option (00 < xx < FF) S tK\\T Error with T option (00 < xx < 99) S tK\\X Time-out error waiting for input S tK\z x=RS-232 input data
Example The terminal connects to an external scale. The scale continuously sends weight readings to the terminal in the following format: 00.00 lbs,08.93 lbs,12.68 lbs,12.43 lbs,12.43 lbs, The comma is a delimiter or field separator character. Four devices available to manage incoming data are: S Maximum number of characters S Delimiter character S Start and delimiter character S Start and maximize characters The choice depends on the form taken by the data and its intended use. Following are examples of each of these devices and a brief description of how they may work with the example. S Maximum number of characters. The data in this example appears in 10 character fields. Command: W000D/\PGM10<cr> The terminal stops receiving data after 10 characters. The problem is the terminal can start receiving data at any point in the 10-character string. Data: bs,12.43 l Here the incorrect starting point makes the data meaningless. S Delimiter characters. Using delimiter characters, the terminal begins receiving data immediately and stops when a delimiter character is received. Command: W000D/\FGE2CN01<cr> Data: .43 lbs
Native Terminal Emulation Programmer’s Guide
225
Page 246
Chapter 6, Terminal Commands
S Start and Delimiter characters. Using Start and Delimiter characters, the terminal starts saving data once the start character is encountered and stops when the delimiter is read. Use the F option if the start character should be part of the response. In the example, the first character in the record is unknown because it depends on the weight reading. However, the previous character (the comma) is known and could be a start character. Command: W000D/\PGS2CE2CN01<cr> Data: 12.43 lbs, Using the F option: Command: W000D/\PGS2CE2CFN01<cr> Data: ,12.43 lbs, The start character in this example is not significant and need not be returned. S Start and Max Characters. Using Start and Max Characters, the terminal starts saving data once the start character is encountered, and stops after the maximum number of characters has been reached. Command: W000D/\PGS2CM10<cr> Data: 12.43 lbs,
226
Native Terminal Emulation Programmer’s Guide