Worth Data 701 RF Owner's Manual Page 35

  • Download
  • Add to my manuals
  • Print
  • Page
    / 87
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 34
31
Chapter 6:
Programming
Before you begin programming…
The RF Terminal operates in two basic ways:
One-Way communication, where all data transfer is initiated by the RF Terminal. This is not very useful, because it has no edit-
ing or prompting. The Base Station itself simply acknowledges the receipt of the data by echoing it back to the Terminal. The host
computer has no dialog whatsoever with the Base Station or Terminal; it is simply used to take the data coming from the Base
through the serial port and do something with it.
Two-Way communication, where messages from the host user program are sent to the Base Station (via the serial port), then
from the Base Station to the RF Terminal. The Terminal responds back to the Base with data and its Terminal ID. The data is then
transmitted from the Base to the host computer where it is processed and the next command is sent out. Each RF Terminal has a
unique Terminal ID, allowing a single Base Station to handle up to 64 Terminals.
Two-way dialog is established when a Terminal SIGNS ON to the RF network. The host computer application waits until a Terminal
SIGNS ON, then begins its processing by sending the first prompt out to the Terminal via the Base Station. If the Terminal does not
receive a prompt from the host, it goes into “sleep” mode, “waking up” and checking with the Base periodically (see Chapter 3; Op-
erational Theory for details) to see if it has any messages waiting. This conserves battery power and reduces radio traffic.
Two-Way mode requires programming to communicate with the Terminal where One-Way mode does not. We have tried to
make it easy for the programmer to communicate with the Base Station; no protocol or handshaking is required. This type of
communication is fine when the Base is located only a few feet from the serial port it is connected to. If you are locating your
Base Station farther away, use shielded, grounded (bare wire Pin 1 touching shield) cable, lower baud rates and possibly, line
drivers for very noisy environments. (Do not use Cat 5 wire for a serial cable).
Before you begin programming, there are some factors you should take into consideration during the planning process.
Plan for system failures. This includes hardware failures, software failures and operator failures. In order to create an efficient
application, you must put some thought into what you will do when different parts of the system fail.
Look for All Errors. Be sure your program is trapping all possible error conditions that the Base Station may return to you.
The list includes:
Sequence Errors detected
Illegal Command detected
Base Station Initialized
Addressing a Terminal Not Signed In
Command without an ID
All of these error conditions are detailed in the next chapter. Don’t forget to program for them; this is a common
mistake. Failure to trap them will give create very strange, unpredictable results.
Even though you don’t think your code will ever make a mistake, take advantage of feedback that the Base Station
provides. Failure to do so is a common mistake that eventually results in serious program failure, sometimes due to
hardware problems that go undetected.
Parse the Returned Strings thoroughly. Don’t assume anything about the next response from the Base to your program and
look only for the partial string such as the ID only; parse the string returned completely and be sure you are examining every
possibility. Failure to do so is a common mistake.
Plan for expansion. You may start small (1 base/1 Terminal) but try to create an application that will allow for easy expansion
and addition - especially of Terminals.
Use the Demo Programs. The demo programs can at least allow you to see how the system functions and whether you can an-
ticipate any system-wide problems. The demo programs should also be used as a response-time benchmark.
Page view 34
1 2 ... 30 31 32 33 34 35 36 37 38 39 40 ... 86 87

Comments to this Manuals

No comments