The text of a manual · part 8 of 19
Worth Data R/F Terminal Owner's Guide, pages 71 to 80
Pages 71 to 80 of 180
The original document is the PDF (2.1 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 Worth TriCoder LT71
Page 71
Besides data, there are other messages that the Base Station will send to the Host:
Serial Reply After a Serial command (@S) has been successfully completed, the Base Station sends to the Host the Terminal ID followed by a CR. Serial commands are typically used for attached serial printers. Serial commands cannot be combined with other commands in a message to the Base Station/Terminal. Remember, you can only send 247 characters (including the ID + @S + EOT).
SIGN ON To login to the host computer, the user presses a key on the RF Terminal at power-up to get to the SIGN ON screen. As the user SIGNs ON, the Base Station sends back the following SIGN ON message to the host: Byte position
Function
Possible values
1 2+
RF Terminal ID SIGN ON
Last
Termination message
0-F SI (ASCII 15) if 4 line display terminal or; if 6 line display terminal configured as 4 line display in firmware version 9075 or greater. SYN (ASCII 22) if 6 line display configured as a 6 line display in firmware version 9075 or greater CR (ASCII 13)
of
After a terminal SIGNS ON, the host should be prepared to acknowledge the SIGN ON and give the terminal instructions, such as: Standby for Assignment, Press ENTER to acknowledge Nothing to do, Press ENTER and See Supervisor Pick Item 1234 If there is something for the Terminal to do, the host should send instruction to the terminal (as in “Pick Item 1234” above). If there is nothing to do at the time of SIGN ON, the host should acknowledge the SIGN ON and tell the terminal to Stand By or See Supervisor (see lines 1 and 2 above). You will notice that in lines 1 & 2 above, there is a request for the operator to press the ENTER key. This is required for the message to be a valid command - remember that all messages must end with a request for data input. The host should then expect a response from the terminal of Terminal ID + DATA (none if only pressing ENTER key) + CR. SIGN ON is a good way for the terminal operator who has not received instruction from the host for several minutes to determine if he is still connected and if the host is still functioning. By SIGNing OUT and SIGNing back ON, the operator should receive a message that there is nothing to do. It is also a good idea for the 6-7
Page 72
host to keep track of elapsed time that a terminal has not had a message sent out to it. The host should then send a message periodically to re-assure the operator (remember to ask him to press ENTER) that instruction is coming or tell him to see his supervisor for re-assignment (or whatever makes sense for your application). Ideally, if the operator is leaving the area (to go to lunch or move to another building) before he is out of range of the network, he should SIGN OUT, then SIGN ON upon his return. Prior to RF Terminal version 9075, all terminals signed on using ASCII 15. As of RF Terminal version 9075, in order to distinguish between 4 line and 6 line display terminals, an additional SIGN ON character was added. A 6 line display terminal configured as a 6 line display (see Installation and Setup for LCD DISPLAY MODE) now sends ASCII 22 as its SIGN ON character. A 6 line display terminal configured as a 4 line display will transmit the ASCII 15 character for SIGN ON. All 4 line display terminals regardless of their version, will SIGN ON using the ASCII 15 character.
SIGN OUT When a RF Terminal is powered down manually or the user presses the F1 key to exit data entry mode to go to one of the other modes (SETUP or ONE WAY), the host receives the following SIGN OUT message: Byte position
Function
Possible values
1 2+ Last
RF Terminal ID SIGN OUT Termination of message
0-F SO (ASCII 14) CR (ASCII 13)
Base Station Error Feedback The following are four different unexpected feedbacks that the Base Station can send back to your program: (Be sure to look for each of them to be sure your program doesn’t blow up at an unexpected time.)
Addressing a Terminal not SIGNed ON If the host attempts to send a message to a terminal that is not SIGNed ON, the Base Station sends back the following message to the host computer: Byte position
Function
Possible values
1 2+ Last
RF Terminal ID Terminal NOT Signed In Termination of message
0-F DC1(ASCII 17) CR (ASCII 13)
The ASCII 17 character can be changed to ASCII 16 for XON/XOFF sensitive systems by changing the Base Station Setup. See Chapter 2; RF System Setup for details. 6-8
Page 73
If the Base Station receives five Addressing a Terminal not SIGNed On messages in a row, it transmits the following message to the Terminal and shuts down: (it will recognize a reinitialize command (*@EOT) from the host though) Base Shut Down Due to Host Logic Error Check your program for the sequence error before starting again. The host program will have to reinitialize the Base Station or you will have to cycle power on the Base Station and have the Terminal Sign On again in order to continue.
Sequence Error Message The one-for-one “host prompt/terminal response” protocol must be observed by the host program at all times. The host cannot send a second data entry prompt until it has received a response to the first data entry prompt. If it does, this is considered a Sequence Error. If the Base Station receives a command that is out of sequence, it sends the following message back to the host: Byte position
Function
Possible values
1 2+ Last
RF Terminal ID Sequence Error Termination of message
0-F DC2 (ASCII 18) CR (ASCII 13)
If the Base Station receives 5 Sequence Error’s in a row, it transmits the following message to the Terminal and shuts down: (the only host command that it will receive is *@EOT) Base Shut Down Due to Host Logic Error Check your program for the sequence error before starting again. You will have to reinitialize the Base Station by host program control (*@EOT) or manually cycle power on the Base Station and have the Terminal Sign On again in order to continue.
Illegal Command • When a terminal receives an illegal statement from the host, it will display the entire statement on the terminal. Once the ENTER key is pressed on the terminal, the terminal sends a “?” back to the Base Station. Byte position
Function
Possible values
1 2+ Last
RF Terminal ID Illegal Command Termination of message
0-F ? CR (ASCII 13)
6-9
Page 74
For example, if Terminal #2 received an illegal command, the Base station would transmit to the host: 2?CR • If a command is sent from the host to the base station without a valid terminal ID character, such as: @1,1,1,Scan Serial Number since the command doesn’t specify which terminal it is meant for, the base sends the following message back to the host:
*?CR Base Station Initialized Message Whenever the Base Station is powered up, it sends a message back to the host as follows: Byte position
Function
Possible values
1
BASE ID
2+ Last
Base Initialization Termination of message
* (Base ID is fixed) DC3 (ASCII 19) CR (ASCII 13)
Since ASCII 19 is XOFF, the ASCII 19 character can be changed to ASCII 20 for XON/XOFF sensitive systems by changing the Base Station Setup. See Chapter 2; RF System Setup for details. The Base Station Initialized message is provided so that the host will know that there has been a power interruption on the Base Station. When a serial device powers up, the first byte transmitted is often garbage. QBASIC handles the garbage character without incidence, but GWBASIC does not unless ON ERROR GOTO is used to trap the error. Be aware of this potential garbage-byte problem in your programming. To isolate and test for the problem, power up the Base without the serial cable connected. After you power the Base up, plug in the serial cable. You will not see the “Base Initialized” message but it should not matter when testing for the garbage data. If a terminal is signed-on to the system, and the base station is re-initialized, the following message is sent to the terminal: Base Reinitialized X Cycle Power on RF Terminal and Sign-on again to Restart_ where X is either a P (base initialization was power-related) or H (base initialization was host-related. (If your Base Station has an eprom earlier and RFX9079D, only P will show.) 6-10
Page 75
Control Keys for Possible Programming There are some keys on the RF Terminal keypad that when pressed, can transmit special ASCII characters back to the host program. This feature might be used by a programmer to allow the operator to review transactions. You can use these keys for special program functions, such as scrolling thru data, backing up steps, jumping, finishing a process, etc The keys are as follows: Key
Code transmitted to Host
UP ARROW key DOWN ARROW key LEFT ARROW key RIGHT ARROW key BEGIN key END key SEARCH key
FS (ASCII 28) GS (ASCII 29) RS (ASCII 30) US (ASCII 31) ETB (ASCII 23) CAN (ASCII 24) VT (ASCII 11)
The STATUS key is reserved to only display the Time and Date. For these codes to be transmitted, there are a few rules to follow: • They cannot be part of a multi-character data entry. In other words, they cannot be used in combination with other data. If another key has been pressed, these special keys are ignored. If you are using the SHIFTED character on one of the special keys, it is accepted as the shifted character. • For these keys to be transmitted, they must be pressed individually and exclusively and MUST be followed by the ENTER key. The ARROW keys can be used without pressing the ENTER key by using the Arrow Keys Only Terminal Setup parameter. See Chapter 2; RF System Setup for details.
6-11
Page 76
LOW Level ASCII Sequences using a DLL The DLL disk is included with every RF Terminal system. To install the program, run the INSTALL.EXE program from Windows Explorer. The program, PromptCOM comes in both 16 bit and 32 bit versions of a Windows Dynamic Link Library (DLL) that allows programmers to easily add the ability to send prompts and receive data from their RF Terminal via the RF Base Station or direct serial link. The Application Programming Interface (API) for PromptCOM consists of the following functions: InitComDLL
Initializes the PromptCOM system
CloseComDLL
Shuts down the promptCOM system and frees resources without closing the parent application.
Setup
Setup is used to configure the COM port
SendCommand
This function both sends a command to the terminal with the given ID
GetCommData
This function returns the data entered at the remote unit for that prompt
DataAvailable
Use this function to check if there is data to process before calling GetCommData
There are sample programs distributed on the diskette for Visual Basic, Access and Delphi. There is also a Visual Basic code example that does not require the DLL. Use the Help System as documentation and view the README file for the latest changes.
PromptCOM/ActiveX Drop-in components are tools that are added to your programming environment "tool kit". There are a variety of different technologies around for implementing a drop-in component such as VBX (for Visual Basic) and VCL (for Delphi and C Builder) and COM (ActiveX). Only the ActiveX variety are widely compatible with almost all development environments. PromptCOM/ActiveX is a drop in COM component that allow programmers to easily add the ability to send prompts to and receive data from their R/F Terminal via an RF Base Station. It is compatible with Visual Basic, Visual C++, Delphi, and most other 32-bit development platforms. See the help file for installation instructions.
6-12
Page 77
Programming Considerations Before making any method calls, make sure you : • Set the COM port properties (device name, baud, parity, bits, flowcontrol) as desired. Make sure the port is closed (call CloseDevice) before making changes to any of the port settings. • Call the OpenDevice method. This activates the COM port used by this instance of the WDterm control. • Set the ActiveTerminal property to identify the terminal on which you desire to operate. You can change the ActiveTerminal at any time in order to direct commands to appropriate terminals.
Test For Good Communication Implement an event handler for OnTermBaseRegister that causes a beep or displays a message when called. If communication between the host PC and the base station is good, your event handler will fire when your program is running and you power up an attached base station.
Multiple Base Stations • For installations using multiple base stations attached to a single host PC (these were called "channels" in PromptCOM/DLL) simply add a WDterm control to your application for each base station.
Terminal Tracking • Since you get one set of event handlers for each base station, you will need some scheme for keeping track of where each terminal (up to 16 per base station) is in its transaction sequence. One possible solution is to use a "state"variable for each terminal (perhaps stored in an array). Test the state variable to determine the next prompt for any given terminal. See the samples for more ideas. • It is very important to keep track of "login status" for each terminal. Every SignOut event should have an associated SignIn event and a given terminal should not be allowed to SignIn twice without an intervening SignOut. Multiple SignIns from one terminal without appropriate SignOuts indicate either: 1. A terminal going out of range and having its power cycled before returning within range OR 2. Two (or more) terminals using the same ID (terminal ID conflict).
6-13
Page 78
Concepts When you use drop-in components in your program you will follow the standard object-oriented programming paradigm that uses properties, methods, and events to implement the functionality of the drop-in component. • Properties are the various configuration variables used by the drop-in • component. An example of a property is the ComDeviceName setting. • Methods are function calls used to issue commands and access features of the drop-in component. An example of a method is sending an Input command to the terminal. • Events are function definitions placed in your application’s source code. The function definitions in your source code are called Event Handlers. The skeleton structure of the event handler’s source code is automatically generated. The code in the Event Handler is called ("fired") by the drop-in component when a specific event occurs. An example of an event is when a terminal returns data and the OnTermData event is fired. The details of how to access Properties/Methods/Events varies between development platforms. Details of how it works in some of the most popular platforms is illustrated in the samples included with the RF Utilities CD or available for download from our website at: http://www.barcodehq.com/wdterminal.exe
Properties Properties are the various configuration variables used by the WDterm control. They are directly assignable in your application (e.g. "WDterm.ActiveTerminal = 5") and can be set in your development environment’s object browser. Important: Except for ActiveTerminal and Quiet, all properties require the serial port to be "closed" before they can be changed. Use the CloseDevice method before setting properties and then call OpenDevice to re-open the serial port. Note that your development environment may show more properties for the WDterm control than are listed here. This is normal. You may ignore properties you see that are not listed here. ActiveTerminal
Valid values: Definition:
0 through 15 This is the terminal ID (0-15) to which method call instructions are directed.
6-14
Page 79
ComDeviceName
Valid values: Definition:
COM1-COM16 This is the serial port that this instance of the control will use. If you have more than one base station, drop in another WDterm control and set its ComDeviceName for your other COM port(s).
ComBaudValue
Valid values: Definition:
300, 600, 1200, 2400, 4800, 9600, 19200 This is the serial port speed setting and must match the base station setting.
ComParity
Valid values: Definition:
None, Even, Odd. This is a serial port setting and must match the base station setting. WDterm may allow other settings but those listed here are the only ones compatible with current version base stations.
ComDataBits
Valid values: Definition:
7, 8 This is a serial port setting and must match the base station setting. WDterm may allow other settings but those listed here are the only ones compatible with current version base stations.
ComStopBits
Valid values: Definition:
1, 2 This is a serial port setting and must match the base station setting. WDterm may allow other settings but those listed here are the only ones compatible with current version base stations.
FlowControl
Valid values: Definition:
None, XON/XOFF This is a serial port setting and must match the base station setting.
Quiet
Valid values: Definition:
True, False If Quiet is set to True then any status and error message generated by WDterm will be suppressed.
6-15
Page 80
Methods Methods are commands that you issue to the WDterm control. All of the "Inputxxx" commands cause the terminal to wait for operator input. Note that your development environment may show more available methods for the WDterm control than are listed here. This is normal. You may ignore methods you see that are not listed here. Important: When your application starts up, the serial port is "closed". You must call OpenDevice before other method calls will work. Except for the ReInitAll method, all methods use the ActiveTerminal property to identify the terminal to use. OpenDevice
Function:
Opens the communications (serial) port. This must be called before any of the methods described below. Make sure to set all Properties as desired before calling this method (except ActiveTerminal or Quiet).
CloseDevice
Function:
Closes the communications (serial) port. This must be called before changing any of the Property settings (except ActiveTerminal or Quiet). When your application starts up, the serial port is "closed". You must call OpenDevice before other method calls will work.
InputAny
Parameters: Function:
line, position, prompt, shifted, timestamped This instructs the ActiveTerminal to display the prompt at line and position and wait for data to be entered from either terminal keypad or scanner. If shifted is set to "true", the terminal will start in shifted mode. Timestamped appends a (hhmmss) prefix to the returned data.
InputKeyBd
Parameters: Function:
line, position, prompt, shifted, timestamped This instructs the ActiveTerminal to display the prompt at line and position and wait for data to be entered from the terminal keypad only. If shifted is set to “true”, the terminal will start in shifted mode. Timestamped appends a (hhmmss) prefix to the returned data.
InputScanner
Parameters: Function:
line, position, prompt, allowbreakout, timestamped This instructs the ActiveTerminal to display the prompt at line and position and wait for data to be entered from the terminal scanner only. Setting allowbreakout to true allow 6-16