10: U SER C OMMUNICATION I NSTRUCTIONS10-38 FC5A MICROS MART USER’ S MANUAL FC9Y-B1268Sample Program – User Communication TXDThis example demonstrates a program to send data to a printer using the user communication TXD2 (transmit) instruc-tion, with the optional RS232C communication adapter installed on the port 2 connector of the 24-I/O type CPU module.System SetupTo RS232C PortD-sub 9-pin Connector PinoutsPin Description1 NC No Connection2 NC No Connection3 DATA Receive Data4 NC No Connection5 GND Ground6 NC No Connection7 NC No Connection8 BUSY Busy Signal9 NC No ConnectionPrinterMini DIN Connector PinoutsDescription Color PinShield — CoverNC No Connection Black 1NC No Connection Yellow 2TXD Transmit Data Blue 3NC No Connection Green 4DSR Data Set Ready Brown 5NC No Connection Gray 6SG Signal Ground Red 7NC No Connection White 8User Communication Cable 1CFC2A-KP1C2.4m (7.87 ft.) longAttach a proper connector to the open end ofthe cable referring to the cable connector pin-outs shown below.Cable Connection and PinoutsTo Port 2 (RS232C)RS232C Communication AdapterFC4A-PC1The name of BUSY terminal differs depending on printers, such as DTR. The function of this terminal is to send a signal toremote equipment whether the printer is ready to print data or not. Since the operation of this signal may differ depend-ing on printers, confirm the operation before connecting the cable.Caution Do not connect any wiring to the NC (no connection) pins; otherwise, the MicroSmart and theprinter may not work correctly and may be damaged.Description of Operation--- PRINT TEST ---11H 00MCNT2...0050D030...3854--- PRINT TEST ---11H 01MCNT2...0110D030...2124Printout ExampleThe data of counter C2 and data register D30 are printed every minute. A printoutexample is shown on the right.Programming Special Data RegisterSpecial data register D8105 is used to monitor the BUSY signal and to control thetransmission of print data.Special DR Value DescriptionD8105 3(011)While DSR is on (not busy), the CPU sends data.While DSR is off (busy), the CPU stops data transmission.If the off duration exceeds a limit (approx. 5 sec), a transmis-sion busy timeout error will occur, and the remaining data isnot sent. The transmit status data register stores an error code.See pages 10-11 and 10-32.The MicroSmart monitors the DSR signal to prevent the receive buffer of the printer from overflowing. For the DSR signal,see page 10-36.Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com