Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 891

Table of Contents

Advertisement

Example Programming
When CIO 0.00 is ON, A202.03 (the Communications Port Enabled Flag) is ON, and CIO 1559.05 (the
TXDU Instruction Executing Flag for port 1) is OFF in the following example, TXDU(256) outputs data
through serial port 1 of the Serial Communications Unit with unit number 2. The 5 bytes of output data
are read from the DM Area beginning at the rightmost byte of D100 and output through logical port 3 to
a general-purpose device such as a printer.
A202.03
0.00
Communications Port
Enabled Flag
C+0: D200
C+1: D201
CS/CJ/NSJ Series Instructions Reference Manual (W474)
1559.05
TXDU
D100
S
TXDU Instruction
Executing Flag
D200
C
N
15
12
11
8
7
4 3
0
0
0
RS and ER signal control
0: No RS and ER signal control
Always 00
15
12
11
8
7
4 3
3
1
1
Serial port number
1: Port 1
Port number specifier
3: Logical port 3
Note:
The serial port's unit address can be specified directly by setting the serial port number to 0 and
setting the Serial Communications Unit's unit address to the serial port's unit address.
(Set the unit address to 80 hex + 4
15
12
11
8
7
4 3
0
C+1:
3
0
8
8
Serial Communications Unit's unit address
88 hex = 80 hex + 4 x unit number
Serial port number
0: Specify port directly.
Port number specifier
3: Logical port 3
Most signifi-
Least signif-
cant bytes
icant bytes
15
8
7
S: D100
3
4
1
D101
C
D
A
D102
E
Example allocated DM Setup Area settings:
Start code and end code values
15
12
11
8
7
4 3
D30204
0
2
0
Start code
(02 hex)
Start code and end code specifiers
15
12
11
8
7
4 3
D30205:
1
1
End code specifier
(1: Use end code.)
Start code specifier
(1: Use start code.)
&5
0
1
Byte order
1: Least significant bytes first
0
2
Serial Communications Unit's unit address (Unit
address as CPU Bus Unit)
12 hex = Unit number + 10 hex
unit number for port 1 or 81 hex + 4
0
2
B
F
Transfer order
1 2 3 4 A B C D E F
5 bytes
In this example, a start and end code have been
specified in the allocated DM Setup Area.
0
3
ST
12
34
AB CD EF ED
End code
ST: Start code (e.g., 02 hex)
(03 hex)
ED: End code (e.g., 03 hex)
Data sent.
0
3. Instructions
unit number for port 2.)
855
3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CJ - REFERENCE MANUAL 02-2010 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents