Remote-processing RPC-2350 Manuel d'utilisateur Page 21

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 83
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 20
SERIAL PORTS CHAPTER 4
4-2
Comm unication flow control
There are two methods to control transmission:
Hardware and software. Both are discussed below.
When RTS line in goes low, the RPC-2350 is held off
from transmitting out CO M2. The status of this port is
read by the BIT statement. The example below returns
the status of the RTS line:
100 B = BIT(130,5)
If B = 1, transmission is held off.
You should check this line before executing a PRINT #2
statement. If transmission is held off, the print buffer
can becom e full. PRIN T #2 com mand w ill ‘hang’ until
the buffer accepts all characters in the program line.
This may give the appearance of the program locking up
or running very slowly. This could also result in a
“deadly embrace” situation wher e the receiving device is
expecting some other condition before it will receive
characters.
The CTS line may be set high or low to control
comm unication fr om a device when using RS-232 . T his
line is also used in RS-422/485 comm unication at P3 or
J3 to control transmitter output.
When using RS-232 comm unications, you may have to
initialize the CT S output to high to allow the sender to
transmit. The examples below show how this is done.
Line 400 sets CTS low and 500 sets it high.
400 BIT 128,4,1
500 BIT 128,4,0
A low condition is supposed to hold off a device. Some
devices do not recognize CTS output so this may be a
mute point.
CTS is used for RS-422/485 communications to turn
on/off the transm itter. Use C ONF IG BAU D to not only
set the baud rate but also the type of communication
protocol. CAMBASIC takes care of the CTS line for
RS-422 and RS-485.
The CONFIG BAUD statement sets both serial ports for
baud rate and type (RS-232, RS-422, and RS-485) for
COM 2.
XON/XOFF
The so-called XON/XOFF protocol is a software scheme
to enable and disable transmitting. Sending an XOFF
character (ASCII value 13H or < Ctrl-S> ) to the RPC-
2350 will stop transmission until an XON (ASCII value
11H or < Ctrl-Q> ) is received. This does not over-ride
the RTS input line when RTS is low.
RS-232
The most common communication interface is RS-232.
Quite simply, RS-232 defines only ‘0' and ‘1' voltage
levels and transient speeds. It does not define baud rate,
start and stop bit length, parity or the protocol. RS-232
is available at J1(COM1) and J4 (COM 2).
Usually, when people speak of RS-232, they mean
something that is compatible with a PC. However, you
must make sure the baud rate, parity, and stop bits are
proper for your device. These are set in the CONFIG
BAUD com mand.
RS-232 is used in point-to-point communication. That
is, one device talks to one other device. Schemes have
been devised to network RS-232.
The maximum baud rate RS-232 supports depends upon
the distance and cable characteristics. As a rule of
thumb, 9600 baud w ill work r eliably to 50 feet.
RS-422
RS-422 is used for long distance (1000 meter s)
comm unication. It is similar to R S-232 in that it is
point-to-point and the communication “protocol” is the
same.
The RS-485 port is used for RS-422 communication.
The transmitter is always on. If, for some reason, you
want to shut the transmitter off, execute
BIT 128,4,0
in your code. To turn the transm itter back on, execute
BIT 128,4,1
in your code.
RS-485
RS-485 is a popular networking system. Technically,
RS-485 only defines electrical specifications, not
protocols. (See Multi-drop Network below. ) In RS-
485, the transm itter is turne d on only long e nough to
send a message, then it turns off. Thus, RS-485 allows
multiple units to be put on a single set of wires.
Vue de la page 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 82 83

Commentaires sur ces manuels

Pas de commentaire