Sample Program - User Communication Txd - IDEC SmartAXIS FT9Z-1A01 User Manual

Table of Contents

Advertisement

10: U
C
SER
OM M UN I CATI ON
Sample Program – User Communication TXD
This example demonstrates a program to send data to a printer using the user communication TXD2 (transmit) instruction, with the
optional RS232C communication cartridge installed on the port 2 connector of the 24-I/O type SmartAXIS.
System Setup
M
i
i n
D
I
N
C
o
n
n
e
c
o t
r
Description
Shield
NC
No Connection
NC
No Connection
TXD
Transmit Data
NC
No Connection
DSR
Data Set Ready
NC
No Connection
SG
Signal Ground
NC
No Connection
The name of BUSY terminal differs depending on printers, such as DTR. The function of this terminal is to send a signal to remote
equipment whether the printer is ready to print data or not. Since the operation of this signal may differ depending on printers,
confirm the operation before connecting the cable.
Caution
Description of Operation
The data of counter C2 and data register D30 are printed every minute. A printout
example is shown on the right.
Programming Special Data Register
Special data register D8105 is used to monitor the BUSY signal and to control the
transmission of print data.
Special DR
Value
3
D8105
(011)
The SmartAXIS monitors the DSR signal to prevent the receive buffer of the printer from overflowing. For the DSR signal, see "DSR
Input Control Signal Option D8105" on page 10-12.
10-24
I
N STR UCTI ON S
RS232C Communication
Cartridge
FT1A-KP1C
To Port 2 (RS232C)
P
n i
o
u
s t
Color
Pin
Cover
Black
1
Yellow
2
Blue
3
Green
4
Brown
5
Gray
6
Red
7
White
8
Do not connect any wiring to the NC (no connection) pins; otherwise, the SmartAXIS and the printer may not work
correctly and may be damaged.
While DSR is on (not busy), the SmartAXIS sends data.
While DSR is off (busy), the SmartAXIS stops data transmission.
If the off duration exceeds a limit (approx. 5 sec), a transmission busy
timeout error will occur, and the remaining data is not sent. The
transmit status data register stores an error code 2.
S
A XI S P
M AR T
User Communication Cable 1C
FC2A-KP1C
2.4m (7.87 ft.) long
Attach a proper connector to the open
end of the cable referring to the cable
connector pinouts shown below.
Cable Connection and Pinouts
Description
/ L
U
'
M
FT9Y-B 1378
R O
I TE
SER
S
ANUAL
To RS232C Port
D
s -
u
b
9
-
p
n i
C
o
n
n
e
c
o t
r
Pin
Description
1
NC
No Connection
2
NC
No Connection
3
DATA
Receive Data
4
NC
No Connection
5
GND
Ground
6
NC
No Connection
7
NC
No Connection
8
BUSY
Busy Signal
9
NC
No Connection
Printout Example
--- PRINT TEST ---
11H 00M
CNT2...0050
D030...3854
--- PRINT TEST ---
11H 01M
CNT2...0110
D030...2124
Printer
P
n i
o
u
s t

Advertisement

Table of Contents
loading

Table of Contents