Remote Technologies RPC-320 manual Serial Ports, COM0 Serial Port, COM1 Serial Port

Page 15

SERIAL PORTS

DESCRIPTION

The RPC -320 has two serial ports that interface to a printer, terminal, RS-485 network, or other serial devices. This chapter describes their char acteristics and how to use th em. Fre quent ref erence s are m ade to commands listed in the BASIC-52 Programm ing Manual or RPBASIC-52 Software Supplement in this manua l. Please refer to these manuals for m ore information about these comm ands.

Serial por ts are num bered C OM 0 and CO M1. COM 0 is RS232 only and is used for progr am deve lopment. During r un time, it can be used for other functions. COM 1 is a general purpose port and is jumperable for RS-232 or RS-422/485.

Each port has a 256 character interr upt driven input and output buffer. This allows sending characters without slowing down program execution. How ever, if the PRIN T buffer fills, pr ogram execution is susp ended until all PRINT char acters are in the buffer. Both ports have a 256 character input buffer. When mor e than 256 characters are r eceived, excess ones are ignored.

CON FIG BAU D controls baud rate and RS-232/485 mode (CO M1 only).

Figure 4-1 Serial port and jumper locations

ON C OM $ is useful whe n data is sent in pac kets. This multitasking command branches to a BASIC subroutine when a sp ecific char acter or number of chara cters is received.

Another useful function is STR. Strings can be formatted, analyzed for length and content. When used in conjunction with ON COM $, networ king over RS-485 is much easier than with the original BASIC-52.

SECTION 4

COM0 SERIAL PORT

This port uses a VTC-9F serial cable to connect external serial dev ices to the por t. T he cable con sists of a 10 pin IDC connector wired one - to - one to a DB- 9 connector .

Line 10 is sim ply cut off. The pin ou t is designed so it plugs directly into the 9 pin serial port connector on a PC .

CTS is a output and is set to high on power up.

Norm ally, this tells the other device to send data. The CTS line is set high or low to hold off communication. The sending device must have a RTS input. L ine 400 sets CTS high and 500 sets it low, or to hold off.

400 LINEB 5,0,(LINEB(5,0) .AND. 247)

500 LINEB 5,0,(LINEB(5,0) .OR. 8)

COM 0 is normally used for program ming. D uring run time it ma y be used as a genera l purpose serial por t. When used for programming or with the INPUT statement, it will accept ASCII character values from 0 to 127 . When used with the GET function, it will return ASCII values from 0 to 255.

COM1 SERIAL PORT

COM 1 is either an RS-232 or RS-422/ 485 port. A VTC -9F serial cable, descr ibed above, is used for RS- 232 level communications. RS-485 is from screw terminals. COM 1 has 2 hardw are handshaking lines, CTS and RT S.

RTS is an input to the car d. W hen RT S to the car d is low, it usually indicates the sender does not want any data sent to it. The status of this port is read by the LINEB statement. The example below retur ns a status of the RTS line:

100 B = LINEB(5,1) .AND. 32

If B = 32, the sender is not requesting information and nothing further should be printed.

The CT S line may be set high or low to hold off

comm unication from a se nding device. The sender must recognize the CTS line. Line 400 sets CTS high and 500 sets it low, or to hold off.

Page 4-1 RPC -320

Image 15
Contents REV TrademarksRevision Table of Contents Sect ION 13 Multi Mode Counter Description Sect ION 11 Watchdog Timer DescriptionExternal Reset Interrupt CharacteristicsSoftware Revision History Manual Organization OverviewSection DescriptionTechnical Support Symbols and Term inologySystem layout Overview SectionOperating Precautions IntroductionEquipment Uploading and Downloading Programs Using a PCUsing a Terminal First Time OperationEditing programs and program ming hints Troubleshooting Where to GO from HereW3 autorun jumper Saving ProgramsSaving a Program EpromChanging Eprom Size AutorunningPreventing Autorun Loading a ProgramBsave CommandsAlternate Eproms BloadSerial Ports COM0 Serial PortCOM1 Serial Port Serial Ports Section RS-422/485 Operating InformationRS-422/485 Termination network Accessing Serial Buffers Two wire RS-485Multidrop Network Accessing COM0 and COM1 Disabling CONTROL-CSerial Port PIN OUT RXD CTS Changing Memory Battery BackupChecking the battery RAM MemoryStoring Variables in RAM Reserved MemoryBlock Data Transfer Assembly Language InterfaceDigital and Opto Ports Digital I/O PortsDigital Por t J3 Optically Isolated Input Digital I/O CommandsDigital Port P6 High Current Port L8High Current Output Interfacing to switches and other devices Interfacing Digital I/O to an opto-module rackDigital I/ O prog ramm ing exam ple Ls e Width Modulation PWM Conne ctor pin ou t J3 Digital and Opto Ports SectionLine B Config LineCount LineSetting Date and Time DateM E Section Connecting Displays Writing to the DisplayProgramming Example Display Types Display Connector PIN OUTProgram explanation Keypad PortKeypad Port PIN OUT J5 Overvoltage conditions Connecting Analog InputsAnalog Input InitializationDifferential Mode Examples u sing CON FIG AINAcquiring Analog Data Noise Notes Temperature MeasurementAnalog Input Section Measuring Higher Voltages Data logging on a timer tickConverting Analog Measurements AmplifiersMeasuring 4-20 mA current loops Calibration External Reset Watchdog TimerInterrupt Characteristics Optically Isolated InterruptProgram Example Optically isolated and TTL interrup ts Gate ProgrammingGND LoadCOU NT0 Further Power Reduction Power ManagementProgram Examp le Power Management SectionTechnical Information Electrical SpecificationsBank Mechanical SpecificationsMemory and I/O Bank MAP Jumper Descriptions