Toshiba PROSEC T3 AS311 Programmable Controller User’s Manual
Below you will find brief information for Programmable Controller PROSEC T3 AS311. The AS311 is a general purpose data communication module for Toshiba’s Programmable Controller PROSEC-T3, allowing it to communicate with external devices, such as microcomputers, bar code readers, printers, and sensors. It offers two serial interface ports, one selectable between RS-232C and RS-422, and the other fixed as RS-232C. The AS311 works as a communications driver for the T3, managing the data transfer process between the controller and external devices.
Advertisement
Advertisement
UM-TS03***-E020
PROGRAMMABLE CONTROLLER
PROSEC
T3
ASCII INTERFACE MODULE
AS311
USER’S MANUAL
TOSHIBA CORPORATION
Important Information
Misuse of this equipment can result in property damage or human injury.
Because controlled system applications vary widely, you should satisfy yourself as to the acceptability of this equipment for your intended purpose.
In no event will Toshiba Corporation be responsible or liable for either indirect or consequential damage or injury that may result from the use of this equipment.
No patent liability is assumed by Toshiba Corporation with respect to use of information, illustrations, circuits, equipment or examples of application in this publication.
Toshiba Corporation reserves the right to make changes and improvements to this publication and/or related products at any time without notice. No obligation shall be incurred other than as noted in this publication.
This publication is copyrighted and contains proprietary material. No part of this book may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means
electrical, mechanical, photocopying, recording, or otherwise
without obtaining prior written permission from Toshiba Corporation.
Copyright © 1995 by Toshiba Corporation
Tokyo, Japan
All rights reserved
Publication number: UM-TS03***-E020
1st edition May 1995
Safety Precautions
Safety Precautions
•
This module (AS311) has been designed for Toshiba’s Programmable Controller
PROSEC-T3 (hereafter called T3). Use this module only on the T3’s rack.
•
Read the Safety Precautions described on the T3 User’s Manual before using the T3 and this module.
•
Follow the instructions described on this manual and on the T3 User’s Manual when installing and wiring the T3 and this module.
•
Do not touch the connector pins or components on the printed circuit board of this module.
•
The maximum number of AS311s that can be controlled by one T3 is not limited by software. However, this module consumes maximum 1 A of internal 5 Vdc power. Confirm that the total 5 Vdc consumed current per one power supply module is within the limit (7A).
Symbols Used In This Manual
Pay attention to information preceded by the following symbols.
HINT
Refers to helpful suggestions on how to operate effectively.
NOTE
Refers to information considered essential for full understanding of operation.
And refers to conditions that could damage the equipment or render it temporarily inoperative.
1
About This Manual
About This Manual
This manual explains the specifications and operations of the ASCII Interface Module
(AS311) for Programmable Controller T3. Read this manual carefully before using the
Inside This Manual
This manual consists of six sections and an appendix as follows.
Section 1 Overview
Introduces The AS311. Outline of the function, applications and the external features are provided in this section. Read this section at first to understand the general operation of the AS311. The switch settings of this module are also explained in this section.
Section 2 Specifications
Provides the functional and the transmission specifications of the AS311. Refer to this section to confirm the application limitations.
Section 3 Cable Connections
Provides the information for hardware preparations. The transmission cable connection is explained in this section.
Section 4 Register Configuration
Explains the memory contents of the AS311. This information is important to interchange data between T3 and AS311.
Section 5 Operation Procedure
Provides the information to design the T3 program for using the AS311. Some sample programs are provided in this section. Read this section carefully for programming.
Section 6 RAS Information
Provides the helpful information for RAS (Reliability, Availability and Serviceability). Also, lists the check points in case of unexpected operations.
Appendix
The specifications of READ and WRITE instructions are described. These instructions are used for interchanging data between T3 and AS311.
2
ASCII Interface Module (AS311)
About This Manual
Related Manuals
The following related manuals are available for T3. Besides this manual, read the following manuals for your better understanding.
T3 User’s Manual - Hardware
This manual covers the T3’s main body and basic I/O - their specifications, handling, maintenance and services.
T3 User’s Manual - Functions
This manual explains the functions of the T3 and how to use them. The necessary information to create user program is covered in this manual.
T-series Instruction Set
This manual provides the detailed specifications of instructions for Toshiba’s T-series
T-PDS (Ver. 1.4) Basic Operation Manual
This manual explains how to install the T-series program development system (T-PDS) into your computer and provides basic programming operations.
T-PDS (Ver. 1.4) Command Reference Manual
This manual explains the T-series program development system (T-PDS) in detail.
T-PDS (Ver. 1.6) Expanded Functions
This manual explains the expanded functions on the T-PDS version 1.6. This manual supplements the T-PDS (Ver.1.4) Command Reference Manual.
T-series Computer Link Function
This manual provides the information for a computer to communicate with T3 through the
T-series Programmable Controller’s Computer Link function.
Terminology
The following terms and abbreviations are used in this manual.
•
ASCII:
•
EIA:
•
I/O:
•
LED:
•
RS-232C:
•
RS-422:
American Standard Code for Information Interchange
Electronic Industries Association
Input/Output
Light Emitting Diode
An EIA standard for data transmission
An EIA standard for data transmission
3
Contents
Contents
About This Manual
.................................................................................. 2
2.3 Transmission specifications ............................................................. 17
4.1
4.2
I/O allocation and I/O registers ........................................................ 24
AS311 buffer memory ........................................................................ 26
4.2.1 Memory map ............................................................................... 26
4.2.2 Buffer memory access ................................................................ 27
4.2.3 Parameter area ............................................................................ 29
4.2.4 Receiving and transmitting data area .......................................... 36
5.1
5.2
Transmission message format .......................................................... 38
Received message read sequence .................................................. 39
5.2.1 Flag control timing ....................................................................... 39
5.2.2 T3 sample program for message receiving ................................... 40
5.3 Write sequence for message transmitting ....................................... 43
5.3.1 Flag control timing ....................................................................... 43
5.3.2 T3 sample program for message transmitting ................................ 44
5.4 Checking the AS311 operation status .............................................. 47
5.5
5.6
5.7
Resetting the AS311 by software ...................................................... 48
Setting the trailing code .................................................................... 49
Setting the time-out check time ........................................................ 50
4
ASCII Interface Module (AS311)
Contents
6.2 Buffer memory information ................................................................ 53
6.2.1 Module status .............................................................................. 53
6.2.2 Switch setting status ................................................................... 54
6.2.3 Error information for data receiving .............................................. 55
6.2.4 Error information for data transmitting .......................................... 56
A.1
A.2
Specification of the READ instruction ...............................................
Specification of the WRITE instruction ............................................
60
62
5
6
ASCII Interface Module (AS311)
Section 1
AS311 Overview
1.2 functions
7
1. AS311 Overview
1.1 Introduction
The ASCII interface module AS311 (hereafter called AS311) is a general purpose data communication module for Toshiba’s Programmable Controller PROSEC-T3 (hereafter called T3). By using the AS311, T3 can communicate with external devices, such as a micro computer, bar code reader, printer, display device, sensor, etc., through the serial interface RS-232C or RS-422.
The AS311 has two ports of the serial interface. One port (channel 1) can be selected either RS-232C or RS-422 by switch setting. The other port (channel 2) is RS-232C interface. These two ports can be used independently for data receiving and transmitting.
The transmission is asynchronous (start-stop system).
ASCII is used as the transmission data code.
The figure below shows the typical system configuration.
T3
AS311
Channel 1
RS-232C or RS-422
CPU module
Channel 2
RS-232C
NOTE
The maximum number of AS311 that can be controlled by one T3 is not limited by software. However, this module consumes maximum 1 A of internal 5 Vdc power.
Confirm that the total 5 Vdc consumed current per one power supply module is within the limit (7 A).
8
ASCII Interface Module (AS311)
1. AS311 Overview
1.2 AS311 functions
From the point of view of T3, the AS311 works as communications driver. The followings are the simplified explanations for T3 and AS311 functions.
When a message (one set of transmission characters) is received by AS311, the flag which indicates the receiving complete will come ON. T3 can check the flag status then read the message from the AS311 by using the READ instruction.
In case of transmitting a message (one set of transmission characters) from T3 through
AS311, T3 writes the message into the AS311 by using the WRITE instruction, then sets the flag which instruct the AS311 to start transmitting the message.
T3
Register
AS311
Buffer memory
READ Receiving area
WRITE Transmitting area
READ Receiving area
WRITE Transmitting area
Receiving buffer
Transmitting buffer
Receiving buffer
Transmitting buffer
Channel 1
Channel 2
Here, a message (one set of transmission characters) means a string of ASCII characters which is ended by specified trailing code. The default setting of the trailing code is CR (carriage return code = H0D).
Applicable message format (default trailing code):
1 2 3 4 N-1 N
CR
N: message length = 896 bytes max.
In other words, the AS311 cannot be used for the data communication in which the transmission message is ended by two or more types of trailing code.
9
1. AS311 Overview
1.3 External features
AS311
•
•
•
RUN
TX1
RX1
TX2
RX2
SW1
8
7
6
5
4
3
2
1
SW2
SW3
1
2
3
↓
ON
→
→
2
1
ON
→
8
7
6
5
4
3
RSW
1
RSW
2
RESET
CH1
CH2
10
ASCII Interface Module (AS311)
Status LEDs
Channel 1 transmission parameter setting switches
Channel 2 transmission parameter setting switches
RS-232C/RS-422 selection switches
Optional rotary switches
Hardware reset switch
Channel 1 serial port (RS-232C/RS-422)
D-Sub 25-pin female connector
Channel 2 serial port (RS-232C)
D-Sub 25-pin female connector
1. AS311 Overview
RUN: Lit when AS311 is operating normally
TX1: Lit while transmitting data from channel 1
RX1: Lit while receiving data to channel 1
TX2: Lit while transmitting data from channel 2
RX2: Lit while receiving data to channel 2
ON
→
8
7
6
5
2
1
4
3
SW1
No.8
…
No use (set always ON)
No.7
Stop bit
OFF ON
2 bit 1 bit
No.6
Data bit length
OFF ON
7 bit 8 bit
No.5
No.4
Parity
OFF ON ON
OFF/ON OFF ON
None Even Odd
No.3
No.2
No.1
OFF OFF OFF OFF ON ON ON
OFF OFF ON ON OFF OFF ON
OFF ON OFF ON OFF ON OFF
Baud rate 300 600 1200 2400 4800 9600 19200
Used to set the transmission parameters for channel 2. The functions of each switch
are the same as the SW1. Set the transmission parameters independently for
channel 1 and channel 2.
NOTE
The factory settings of the SW1 and SW2 are as shown above figure.
That is, 1 stop bit, 8 data bits, odd parity and 9600 bps.
11
1. AS311 Overview
1
2
3
ON
→
SW3
NOTE
RSW1
RSW2
8
8
C
4
C
4
Used to select the interface of the channel 1 either
RS-232C or RS-422.
No.1
Interface
OFF ON
RS-232C RS-422
Used to connect the terminating resistor (120
Ω
) between RXDA and RXDB. (Effective for RS-422)
No.2
Terminating
OFF ON
Not connect Connect
Used to connect the terminating resistor (120
Ω
) between CTSA and CTSB. (Effective for RS-422)
No.3
Terminating
OFF ON
Not connect Connect
The switches No.2 and No.3 should be set to ON when the AS311 is configured as terminal station on the RS-422 transmission line.
The factory settings of the SW3 are all OFF.
0
0
Always set the RSW1 to 4 and the RSW2 to 0.
(Other settings are for future use)
Do not set other than above, otherwise the AS311 will not work correctly.
12
ASCII Interface Module (AS311)
1. AS311 Overview
Hardware reset switch
When this switch is pressed, the AS311 will be reset. Use this switch when you
have changed the switch settings.
Channel 1 and channel 2 serial ports
Used to connect the serial transmission line (RS-232C or RS-422). D-Sub 25-pin
female connectors are provided on the AS311.
The pin assignment is as follows.
Channel 1
(RS-232C/RS-422)
1 FG
↔
2 TXD
→
3 RXD
←
for RS-232C
4 RTS
→
5 CTS
←
6
7 SG
↔
8
9 5 Vdc
→
10
←
for RS-422
12
Channel 2
(RS-232C)
1 FG
↔
2 TXD
→
3 RXD
←
4 RTS
→
5 CTS
←
6 DSR
←
7 SG
↔
8
10
11
9 5 Vdc
→
12
13
14 14
15 15
16 16
17 17
18 18
19 19
→
for RS232C
←
for RS-422
23
20 DTR
→
21
22
23
24
25 25
•
The arrow on the above figure shows the signal direction.
•
FG is connected with the T3’s frame ground internally. (both channels)
•
DTR and RTS are ON while power is on.
•
Data transmitting is available when CTS is ON. DSR has no effect for transmission.
•
Pin 9 (5 Vdc) can be used to supply 5 Vdc power. (total max. 50 mA)
13
14
ASCII Interface Module (AS311)
Section 2
Specifications
15
2. Specifications
2.1 General specifications
Power voltage 5 Vdc (supplied from back plane bus)
Current consumption 1.0 A (5 Vdc) maximum
Environmental conditions Conforms to T3 specifications
Insulation resistance
10 M
Ω
(500 Vdc)
Withstand voltage 500 Vac - 1 minute
Size T3 I/O module size (1 slot)
Note (1)
Note (2)
Note (2)
Note (1) The T3’s power supply module can supply maximum 7 A of internal 5 Vdc.
Check that the internal 5 Vdc current consumption per one power supply module does not exceed the limit.
Note (2) Between interface connector pins and internal circuit.
2.2 Functional specifications
Item Specifications
Module type
I/O allocation type
Buffer memory capacity
Transmission interface
Serial communication interface iX+Y 4W
448 words x 4
(accessed from T3 by READ/WRITE instruction)
2 channels;
Channel 1
…
RS-232C or RS-422 (selectable)
Channel 2
…
RS-232C
Connectable devices
RAS function
RUN
…
lit when operating normally
TX1
…
lit while transmitting data from channel 1
RX1
…
lit while receiving data to channel 1
TX2
…
lit while transmitting data from channel 2
RX2
…
lit while receiving data to channel 2
Computer, bar code reader, display device, sensor, printer, or other serial ASCII device
Self diagnosis, watch dog timer (200 ms), transmission error check, etc.
16
ASCII Interface Module (AS311)
2. Specifications
2.3 Transmission specifications
Item
Interface
Transmission mode
Synchronizing
Transmission speed
Frame format
Transmission code
Message length
Configuration
Transmission distance
Connector
Channel 1
RS-232C or RS-422
Full-duplex
Start-stop method (asynchronous)
300, 600, 1200, 2400, 4800, 9600, 19200 bps
Start bit
Data
Parity
Stop bit
1 bit
7 or 8 bits even / odd / none
1 or 2 bits
ASCII
Max. 896 bytes
One to one (Note)
Max. 15 m (RS-232C)
Max. 1 km (RS-422)
D-sub 25-pin female
Channel 2
RS-232C
Max. 15 m
D-sub 25-pin female
Note) In case of RS-422 interface, multiple devices can be connected to one AS311 if the connected RS-422 devices work as slave stations and support multi-point connection. That is, the connected RS-422 devices must have the transmission generators which support the passive state. Also, the RS-422 devices must support the message format which contains the selecting address. In this case, the number of the connected RS-422 devices is limited up to 10.
On the other hand, the AS311’s transmission generator does not support the passive state. Therefore the AS311 must be the master station in the one-to-N configuration.
17
18
ASCII Interface Module (AS311)
Section 3
Cable Connections
19
3. Cable Connections
3.1 RS-232C connection
The following figure shows the RS-232C connection.
AS311 Shielded cable
3
4
5
1
2
6
7
20
FG
TXD
RXD
RTS
CTS
(DSR)
SG
DTR
RS-232C device
RXD
TXD
DTR
SG
DSR
RTS
CTS
(1) DSR is supported only on the channel 2.
(2) Connect SG each other.
(3) Use shielded cable. The cable shield should be connected to FG at one end.
(4) It is recommended to use twisted cable for noise immunity.
NOTE
Do not connect or remove the connector while the AS311 is powered. Otherwise, it will cause damage to the AS311.
20
ASCII Interface Module (AS311)
3. Cable Connections
3.2 RS-422 connection
The channel 1 can be selected either RS-232C or RS-422. The following figure shows the RS-422 connection.
AS311
1
10
21
11
22
7
12
23
13
24
FG
TXDA
TXDB
RXDA
RXDB
SG
RTSA
RTSB
CTSA
CTSB
Shielded cable RS-422 device
FG
RXDA
RXDB
TXDA
TXDB
SG
CTSA
CTSB
RTSA
RTSB
R
R
(1) On the AS311, connect the built-in terminating resistors (120
Ω
) between RXDA
and RXDB and between CTSA and CTSB by setting switches.
(Set the SW3-2 and SW3-3 to ON)
(2) On the RS-422 device, connect the terminating resistors R (120
Ω
- 1/2 W)
between RXDA and RXDB and between CTSA and CTSB.
(3) Connect SG each other.
(4) Use shielded twisted-pair cable. The A (+) and B (-) of the same signal should be
paired.
(5) The cable shield should be connected to FG at one end.
NOTE
Do not connect or remove the connector while the AS311 is powered. Otherwise, it will cause damage to the AS311.
21
22
ASCII Interface Module (AS311)
Section 4
Register Configuration
4.1 I/O allocation and I/O registers
4.2 AS311 buffer memory
23
4. Register Configuration
4.1 I/O allocation and I/O registers
The AS311 has the I/O type ‘i X+Y 4W’ for I/O allocation. When the automatic I/O allocation is performed with mounting the AS311, the following I/O allocation table will be created in the T3.
(T-PDS screen example - in the case that AS311 is mounted on Slot 0 of Unit 0)
Then, 4 I/O registers, XW(n), XW(n+1), YW(n+2) and YW(n+3), are assigned to the
AS311.
In the above example, XW000, XW001, YW002 and YW003 are assigned.
Note that the I/O type has ‘i’ designation. It means that the T3 will not update the assigned I/O registers in the batch I/O processing. To read or write data through the I/O registers, the Direct I/O instruction (FUN235) or the direct I/O designation
(I/IW and O/OW instead of X/XW and Y/YW) is necessary.
The reason of that is because the reading and writing timings are important for handshaking between T3 and AS311. Refer to section 5.
24
ASCII Interface Module (AS311)
4. Register Configuration
The following table shows the functions of I/O registers assigned to the AS311.
F E D C B A 9 8 7 6 5 4 3 2 1 0
XW(n)
XW(n+1)
YW(n+2)
YW(n+3)
No use
No use
No use
No use
No use
No use
No use
No use
CH1 status
Name
F Write ready
Description
1: ready to write data (transmit) for channel 1
(CH1)
E Transmit complete 1: transmitting has been completed normally
XW(n)
D Transmit error
C - 8
−
7 Read ready
1: transmitting has been canceled by error
No use (always 0)
1: ready to read the received data
6 Receive complete 1: receiving for channel 1 has been completed
5 Receive error
4 - 0
−
F Write ready
1: receiving error has occurred
No use (always 0)
1: ready to write data (transmit) for channel 2
(CH2)
E Transmit complete 1: transmitting has been completed normally
D Transmit error
XW(n+1) C - 8
−
7 Read ready
1: transmitting has been canceled by error
No use (always 0)
1: ready to read the received data
(CH1)
6 Receive complete 1: receiving for channel 2 has been completed
5 Receive error
4 - 0
6 - 0
−
F Transmit start
YW(n+2) E - 8
−
7 Read start
−
F Transmit start
YW(n+3) E - 8
−
(CH2) 7 Read start
6 - 0
−
1: receiving error has occurred
No use (always 0)
Set to 1 to start transmitting data from channel 1
No use (set to 0)
Set to 1 to start reading data for channel 1
No use (set to 0)
Set to 1 to start transmitting data from channel 2
No use (set to 0)
Set to 1 to start reading data for channel 2
No use (set to 0)
NOTE
These bits are used for handshaking between T3 and AS311. The detailed function and timing are explained in section 5.
25
4. Register Configuration
4.2 AS311 buffer memory
As explained in the previous section, the I/O registers that are assigned to AS311 are used to control the reading and writing timings (handshake) between T3 and
AS311.
On the other hand, for exchanging the transmission data between T3 and AS311, the
AS311’s buffer memory is used.
This section explains the buffer memory contents and how to access the buffer memory.
The AS311 has the buffer memory that is used to exchange data with T3. The overall map of the buffer memory is as follows.
Address Word data
0
128
Status and command
4 Parameter
124 words - transmission parameters, etc.
Channel 1 reading (receiving) data area
4 words - same data as I/O registers
448 words
576
448 words
1024
Channel 1 writing (transmitting) data area
Channel 2 reading (receiving) data area
448 words
1472 Channel 2 writing (transmitting) data area
448 words inhibited
128 words
26
ASCII Interface Module (AS311)
4. Register Configuration
4.2.2 Buffer memory access
T3 can read the AS311’s buffer memory contents by using READ instruction (FUN237).
Also, T3 can write data into the buffer memory by using WRITE instruction (FUN238).
READ instruction (FUN237)
Expression:
[ (A) READ (B)
→
(C) ]
Operands:
(A):
(B):
I/O register (XW/YW) assigned to the AS311
Starting address of the buffer memory to be read
(B)+1: Number of words to be read (max. 256)
(C): Starting register of the destination
Example:
R0100
[ 00128 MOV D5000 ] [ 00064 MOV D5001 ]
[ XW000 READ D5000
→
D1000 ]
When R0100 is ON, 64 words of buffer memory data starting with address 128 are read from the AS311 which is allocated to XW000. And the data are stored in D1000 and after.
27
4. Register Configuration
WRITE instruction (FUN238)
Expression:
[ (A) WRITE (B)
→
(C) ]
Operands:
(A): Starting register of the source
(B): Starting address of the buffer memory to be written
(B)+1: Number of words to be written (max. 256)
(C): I/O register (XW/YW) assigned to the AS311
Example:
R0101
[ 00576 MOV D5000 ] [ 00100 MOV D5001 ]
[ D2000 WRITE D5000
→
YW002 ]
When R0101 is ON, 100 words of data starting with D2000 (D2000 to D2099) are written into the buffer memory address 576 and after of the AS311 which is allocated to YW002.
28
ASCII Interface Module (AS311)
4. Register Configuration
The parameter area of the buffer memory contains the following contents.
Address Address
1 CH2 status Status and
64
65 command 66
67
68
69
6 SW1
7 SW2
70
71 Reserved
11
13
14
15
16 CH1 receive error
17 CH1 transmit error
18 CH1 channel status
19 CH1 receive length
20
21
22
23
24 CH1 trailing code
25 CH1 time-out check CH1
75
76
77
78
79
80 CH2 receive error
81 CH2 transmit error
82 CH2 channel status
83 CH2 receive length
84
85
86
87
88 CH2 trailing code
89 CH2 time-out check CH2
27
28
29
30
31
63
Note: Blanks are for future use. (Reserved)
91
92
93
94
95
127
29
4. Register Configuration
Status and command (0 - 3)
The addresses 0 to 3 store the same data as the I/O registers that are assigned to the
AS311.
Refer to section 4.1 for details.
0 CH1 status
1 CH2 status
= XW(n)
= XW(n+1)
2 CH1 command
3 CH2 command
= YW(n+2)
= YW(n+3)
Status 1 (4)
The address 4 shows the AS311 module status. If an error has occurred in the AS311, the error code is stored here.
F E D C B A 9 8 7 6 5 4 3 2 1 0
4 RDY
Bit F RDY (Ready)
Bit E
Bit 7-0
ERR (Error)
Error code
1 = operating normally
0 = under initialization or error state
1 = error state
0 = no error (normal)
Shows the detected error item if ERR is 1.
(H00 when normal)
See section 6.2.1 for details.
RSW1/2 information (5)
The address 5 stores the rotary switches RSW1 and RSW2 setting status.
F E D C B A 9 8 7 6 5 4 3 2 1 0
5
0 0 0 0 0 0 0 0
Bit 7-4
Bit 3-0
RSW1
RSW2
RSW1 RSW2
Stores the rotary switch 1 (RSW1) setting status.
0 - F
Stores the rotary switch 2 (RSW2) setting status.
0 - F
30
ASCII Interface Module (AS311)
4. Register Configuration
SW1 information (6)
The address 6 stores the setting status of the channel 1 transmission parameter setting switches (SW1).
F E D C B A 9 8 7 6 5 4 3 2 1 0
6 0 0 0 0 0 0 0 0 SW1
SW1
OFF ON
8
7
6
5
4
3
2
1
ON: 1 OFF: 0
SW2 information (7)
The address 7 stores the setting status of the channel 2 transmission parameter setting switches (SW2).
F E D C B A 9 8 7 6 5 4 3 2 1 0
SW2
7
0 0 0 0 0 0 0 0
SW2
OFF ON
8
7
6
5
4
3
2
1
ON: 1 OFF: 0
31
4. Register Configuration
Command 1 (12)
The address 12 is used to reset the AS311 by T3 program.
Two types of reset commands are available, hot reset and cold reset.
The hot reset is used to change the trailing code and the time-out check time settings.
The cold reset is used to initialize the AS311. The trailing code and the time-out check time will be reset to the default setting. The operation of the cold reset is the same as the hard reset switch and power on initialization.
Refer to sections 5.5, 5.6 and 5.7 for these functions.
F E D C B A 9 8 7 6 5 4 3 2 1 0
12
RST
Bit F
Bit 7-0
RST (Reset)
Command number
CH1 receive error (16) and
CH2 receive error (80)
1 = reset request
0 = normal (no reset request)
HFE = hot reset
HFF = cold reset
The address 16 (for channel 1) and the address 80 (for channel 2) indicate the error contents if an error has been detected in receiving a message. This information is set during the received message read sequence.
Refer to section 6.2.3 for details.
F E D C B A 9 8 7 6 5 4 3 2 1 0
16 or 80
0 0 0 0
Bit B BRK (Break)
Bit A
Bit 9
Bit 8
Bit 7-0
1 = break detected
0 = normal
PE (Parity error) 1 = parity error
0 = normal
FE
(Framing error)
1 = framing error
0 = normal
OE
(Overrun error)
Receive error code
1 = overrun error
0 = normal
Shows the error code regarding received message.
(H00 when normal)
See section 6.2.3 for details.
32
ASCII Interface Module (AS311)
4. Register Configuration
CH1 transmit error (17) and
CH2 transmit error (81)
The address 17 (for channel 1) and the address 81 (for channel 2) indicate the error contents if an error has occurred during message transmitting. This information is set during the write sequence for message transmitting.
Refer to section 6.2.4 for details.
F E D C B A 9 8 7 6 5 4 3 2 1 0
17 or 81 0 0 0 0 0 0 0 0
Bit 7-0 Transmit error code
Shows the error code for transmitting.
(H00 when normal)
See section 6.2.4 for details.
CH1 channel status (18) and
CH2 channel status (82)
The address 18 (for channel 1) and the address 82 (for channel 2) indicate the control signal status. This information is always updated.
F E D C B A 9 8 7 6 5 4 3 2 1 0
18 or 82
0 0 0 0 0 0 0
Bit 8
Bit 7
Bit 3
IDL (Idle)
DSR
(Data set ready)
CTS
(Clear to send)
1 = transmitter is idle state
0 = transmitter is non-idle state
1 = DSR is ON
0 = DSR is OFF Note (1)
1 = CTS is ON
0 = CTS is OFF
Note: (1) The channel 1 does not support DSR. Therefore, bit 7 of the address 18 is
always 0.
(2) The bit 2 is always 1.
33
4. Register Configuration
CH1 receive length (19) and
CH2 receive length (83)
The address 19 (for channel 1) and the address 83 (for channel 2) indicate the length of the received message (number of bytes). This information is set during the received message read sequence.
F E D C B A 9 8 7 6 5 4 3 2 1 0
19 or 83
Bit F-0 Received message length
Received message length
Shows the received message length (bytes).
0 - 896
CH1 trailing code (24) and
CH2 trailing code (88)
The address 24 (for channel 1) and the address 88 (for channel 2) store the trailing codes. The default setting is H0D (CR code).
To change the trailing code, write the desired code into this address then write the hot reset command into the Command 1 (12). See section 5.6 for this procedure.
F E D C B A 9 8 7 6 5 4 3 2 1 0
24 or 88
0 0 0 0 0 0 0 0
Bit 7-0 Trailing code Stores the trailing code.
Initial value at power on is H0D (carriage return).
34
ASCII Interface Module (AS311)
4. Register Configuration
CH1 time-out check (25) and
CH2 time-out check (89)
The address 25 (for channel 1) and the address 89 (for channel 2) store the time-out check times. If the time between each receiving character exceeds the specified time-out check time, it becomes the receiving time-out error. The default setting is 1 second.
To change the setting, write the desired data into this address then write the hot reset command into the Command 1 (12). See section 5.7 for this procedure.
F E D C B A 9 8 7 6 5 4 3 2 1 0
Time-out check time
25 or 89
Bit F-0 Time-out check time
Stores the time-out check time (0.1 s units).
Valid data range is 1 to 600 (0.1 to 60 s). If 0 or more than 600 is specified, the time-out check will not work.
Initial value at power on is 10 (1 s).
35
4. Register Configuration
4.2.4 Receiving and transmitting data area
The receiving and transmitting data area is provided to exchange the communication characters between T3 and AS311. The address ranges in the AS311 buffer memory are as follows.
Address Word data
128 Channel 1 reading (receiving) data area
576 Channel 1 writing (transmitting) data area
1024
1472
Channel 2 reading (receiving) data area
Channel 2 writing (transmitting) data area
448 words
448 words
448 words
448 words
When AS311 receives a message (one set of transmission characters), AS311 sets the characters into the receiving data area starting with the address 128 or 1024. Then T3 can read these characters from the receiving data area by using READ instruction.
When T3 attempts to send a message via AS311, T3 writes the characters into the transmitting data area starting with the address 576 or 1472 by using WRITE instruction, and instructs AS311 to start transmitting. AS311 recognizes from the character stored in the starting address (576 or 1472) to the trailing code character as the one set of transmitting message.
Refer to section 5 for message receiving/transmitting procedure.
36
ASCII Interface Module (AS311)
Section 5
Operation Procedure
5.1 Transmission message format
5.2 Received message read sequence
5.3 Write sequence for message transmitting
5.4 Checking the AS311 operation status
5.5 Resetting the AS311 by software
5.6 Setting the trailing code
5.7 Setting the time-out check time
37
5. Operation Procedure
5.1 Transmission message format
The transmission message is composed by ASCII characters and a specified trailing code. The default setting of the trailing code is CR (carriage return code = H0D).
Refer to section 5.6 for setting the trailing code other than CR.
The maximum length of a message is 896 bytes. An example of the message is
1 2 3 4 5 6 7 8 9
″
0
″ ″
1
″ ″
2
″ ″
A
″ ″
B
″ ″
7
″ ″
8
″ ″
9
″
CR
In the above figure,
″ x
″
means an ASCII character. For example,
″
0
″
is H30.
When the above message is received or transmitted, the data arrangements in the
T3 registers are as follows.
Register F 8 7 0
n
n+1
n+2
n+3
″
1
″
″
A
″
″
7
″
″
9
″
″
″
″
″
0
2
B
8
″
″
″
″
n+4 CR
Transmission message
″
0
″
″
1
″
″
2
″
″
A
″
″
B
″
″
7
″
″
8
″
″
9
″
CR
38
ASCII Interface Module (AS311)
5. Operation Procedure
5.2 Received message read sequence
5.2.1 Flag control timing
In case of receiving a message, the following flags are used for handshaking between
T3 and AS311. These flags are the bits of the I/O registers assigned to the AS311.
Refer to section 4.1.
Read ready
Bit 7 of XW(n) for channel 1 or XW(n+1) for channel 2
Receive complete
Bit 6 of XW(n) for channel 1 or XW(n+1) for channel 2
Receive error
Bit 5 of XW(n) for channel 1 or XW(n+1) for channel 2
Read start
Normal receiving
Bit 7 of YW(n+2) for channel 1 or YW(n+3) for channel 2
The message receiving procedure is as follows. It is called “received message read sequence”.
AS311 receives a message
AS311 sets the message into buffer memory (receiving data area), and sets the received message length into buffer memory (parameter area)
T3 reads the message form buffer memory (receiving data area) by READ instruction
T3 Read start to OFF
Receiving error
AS311 sets the error information into buffer memory (parameter area)
AS311 sets Receive error to ON, and resets Receive complete to OFF
T3 reads the error information from buffer memory (parameter area) by READ instruction
T3 resets Read start to OFF
AS311 resets Receive error to OFF
39
5. Operation Procedure
5.2.2 T3 sample program for message receiving
A sample program for the “received message read sequence” is shown below.
This sample program is for the channel 1 of the AS311 that is allocated to XW000 -
YW003.
Operation for normal received message
Operation for receiving error
(Subroutine No. 0)
40
ASCII Interface Module (AS311)
5. Operation Procedure
In this sample program, the following devices/registers are used.
R0100 AS311 status (ON when ready) - Refer to section 5.4
R0200 Receiving normal complete (comes ON when receiving is complete normally)
R0300 Receiving error complete (comes ON when receiving error has occurred)
X0006 Receive complete flag
X0007 Read ready flag
X0005 Receive error flag
Y0027 Read start flag
D0000 - D0063 Received message is stored here
D3000 Receiving error information is stored here
D4000 - D4001 Parameters for READ instruction
This sample program works as follows.
Main program
- Rung 1: Calls Subroutine No. 0 when the AS311 is normal and both R0200 and
R0300 are OFF.
- Rung 2: When R0200 comes ON (normal receiving), performs the necessary
operation for the received message, then resets R0200 to OFF.
- Rung 3: When R0300 comes ON (receiving error has occurred), performs the error
processing, then resets R0300 to OFF.
Subroutine No. 0
- Rung 1: Indicates the entry of Subroutine No. 0.
- Rung 2: Reads XW000 and XW001 from the AS311 by direct I/O instruction.
- Rung 3: Sets Y0027 (Read start flag) to ON if X0006 (Receive complete flag) is ON.
- Rung 4: When X0007 (Read ready flag) comes ON, reads the received message from
the AS311’s buffer memory, 64 words starting with address 128, by READ instruction,
and stores it into D0000 and after. Then resets Y0027 (Read start flag) to OFF, and
sets R0200 to ON.
When X0005 (Receive error flag) comes ON, reads the error information from the
AS311’s buffer memory, 1 word of address 16, by READ instruction, and stores it into
D3000. Then resets Y0027 (Read start flag) to OFF, and sets R0300 to ON.
- Rung 5: Writes YW002 and YW003 into the AS311 by direct I/O instruction.
- Rung 6: Indicates the return of Subroutine No. 0.
41
5. Operation Procedure
Explanation for this sample program:
(1) The “received message read sequence” is programmed on Subroutine No. 0.
(2) The Subroutine No. 0 is called from Main program with resetting R0200 and R0300
(3) When a message is received normally, R0200 will come ON and the message
(ASCII characters) will be stored in D0000 to D0063. In this sample program, the received message length information (buffer memory address 19) is not used. The maximum length of a message is 128 bytes (64 words) because the number of read words of the READ instruction is programmed as 64 words.
(4) When an error has occurred in receiving the message, R0300 will come ON and the error information will be stored in D3000. For details of the error information, refer to section 6.2.3.
42
ASCII Interface Module (AS311)
5. Operation Procedure
5.3 Write sequence for message transmitting
5.3.1 Flag control timing
In case of transmitting a message, the following flags are used for handshaking between T3 and AS311. These flags are the bits of the I/O registers assigned to the
AS311. Refer to section 4.1.
Write ready
Bit F of XW(n) for channel 1 or XW(n+1) for channel 2
Transmit complete
Bit E of XW(n) for channel 1 or XW(n+1) for channel 2
Transmit error
Bit D of XW(n) for channel 1 or XW(n+1) for channel 2
Transmit start
Normal transmitting
Bit F of YW(n+2) for channel 1 or YW(n+3) for channel 2
The message transmitting procedure is as follows. It is called “write sequence for
T3 writes a message into buffer memory (transmitting data area) by WRITE instruction
AS311 sends out the message and
OFF, and sets Write ready to ON
Transmitting error
AS311 sets the error information into buffer memory (parameter area) and
T3 reads the error information from buffer memory (parameter area) by READ instruction, and resets
Transmit start to OFF
43
5. Operation Procedure
5.3.2 T3 sample program for message transmitting
A sample program for the “write sequence for message transmitting” is shown below.
This sample program is for the channel 1 of the AS311 that is allocated to XW000 -
YW003.
Set the transmission message into
D0200 - D0263, and set R0110 to ON
Operation for transmitting error
(Subroutine No. 1)
44
ASCII Interface Module (AS311)
5. Operation Procedure
In this sample program, the following devices/registers are used.
R0100 AS311 status (ON when ready) - Refer to section 5.4
R0110 Internal flag to start transmitting
R0201 Transmitting normal complete (comes ON when transmitting is complete normally)
R0301 Transmitting error complete (comes ON when transmitting error has occurred)
X000F Write ready flag
X000E Transmit complete flag
X000D Transmit error flag
Y002F Transmit start flag
D0200 - D0263 Transmitting message is set here
D3010 Transmitting error information is stored here
D4010 - D4011 Parameters for WRITE instruction
D4000 - D4001 Parameters for READ instruction
This sample program works as follows.
Main program
- Rung 1: Prepares a transmission message and sets it into D0200 and after (maximum
64 words in this sample). Then sets R0110 to ON.
- Rung 2: Calls Subroutine No. 1 when the AS311 is normal and R0110 is ON.
- Rung 3: When R0201 comes ON (normal transmitting), resets R0110 and R0201 to
OFF.
- Rung 4: When R0301 comes ON (transmitting error has occurred), performs the error
processing, then resets R0110 and R0301 to OFF.
Subroutine No. 1
- Rung 1: Indicates the entry of Subroutine No. 1.
- Rung 2: Reads XW000 and XW001 from the AS311 by direct I/O instruction.
- Rung 3: When X000F (Write ready flag) is ON, writes the message that is stored in
D0200 to D0263 into the AS311’s buffer memory, 64 words starting with address 576,
by WRITE instruction, and sets Y002F (Transmit start flag) to ON.
- Rung 4: When X000E (Transmit complete flag) comes ON, resets Y002F (Transmit
start flag) to OFF, and sets R0201 to ON.
When X000D (Transmit error flag) comes ON, reads the error information from the
AS311’s buffer memory, 1 word of address 17, by READ instruction, and stores it into
D3010. Then resets Y002F (Transmit start flag) to OFF, and sets R0301 to ON.
- Rung 5: Writes YW002 and YW003 into the AS311 by direct I/O instruction.
- Rung 6: Indicates the return of Subroutine No. 1.
45
5. Operation Procedure
Explanation for this sample program:
(1) The “write sequence for message transmitting” is programmed on Subroutine
(2) To start transmitting, set the message (ASCII characters) into D0200 and after.
Then set R0110 to ON.
The message length is maximum 128 bytes (64 words) in this sample program.
(3) When R0110 is set to ON while the AS311 is ready, the Subroutine No. 1 will be called and the message transmitting will be started.
(4) When the message is transmitted normally, R0201 will come ON. Then R0110 will be reset to OFF.
(5) When an error has occurred in transmitting the message, R0301 will come ON and the error information will be stored in D3010. For details of the error information, refer to section 6.2.4.
46
ASCII Interface Module (AS311)
5. Operation Procedure
5.4 Checking the AS311 operation status
AS311 operation status information is stored in the AS311’s buffer memory address 4
(Status 1). T3 can read this information by using READ instruction.
A sample program is shown below. This sample program is for the AS311 that is allocated to XW000 - YW003.
The above sample program works as follows.
- Rung 1: Resets S0051 (Instruction error flag) to OFF, and sets parameters for the
READ instruction.
- Rung 2: Reads the operation status information from the AS311’s buffer memory
address 4 (Status 1).
- Rung 3: When S0051 (Instruction error flag) is OFF and R050F (Ready) is ON, turns
R0100 to ON.
It means that the AS311 is operating normally when R0100 is ON.
If R050E (Error) is ON, the AS311 is in error state. In that case, the error code is stored in the lower 8 bits of RW050. For the error code, refer to section 6.2.1.
If S0051 (Instruction error flag) is ON, it means that an error has occurred during the
READ instruction execution.
47
5. Operation Procedure
5.5 Resetting the AS311 by software
AS311 can be reset by T3 program. Two types of resetting are available, cold reset and hot reset.
The cold reset is used to reset the AS311 error state. When the cold reset is executed, the AS311 will be initialized. The trailing code and the time-out check time are also reset to the default settings. This function is the same as pressing the hardware reset switch and power on initialization.
On the other hand, the hot reset is used to change the trailing code and/or the time-out
For executing these functions, write the following data into the AS311’s buffer memory address 12 (Command 1). The data writing into this address must be one-shot.
The written data will be cleared to 0 by AS311 when the operation is completed.
A sample program for the cold reset is shown below. This sample program is for the
AS311 that is allocated to XW000 - YW003.
In this sample program, the cold reset operation will be started by setting R0120 to ON.
(Subroutine No. 2)
(H80FF)
For the hot reset, refer to sections 5.6 and 5.7.
48
ASCII Interface Module (AS311)
5. Operation Procedure
5.6 Setting the trailing code
The default setting of the trailing code is CR (carriage return code = H0D). The trailing code can be changed by T3 program.
To do this, write desired trailing code into the AS311’s buffer memory address 24 (CH1 trailing code) and/or address 88 (CH2 trailing code), and execute the hot reset (refer to
A sample program is shown below. This sample program is for the AS311 that is allocated to XW000 - YW003.
In this sample program, the trailing code changing routine will be executed once when the AS311 status is changed to ready (R0100 comes ON - refer to section 5.4), and the channel 1 trailing code will be changed to H03.
If the channel 2 trailing code and/or the time-out check time are also changed, write these data on the Main program Rung 2 before calling Subroutine No. 3 in the same manner.
(H0003)
(Subroutine No. 3)
(H80FE)
49
5. Operation Procedure
5.7 Setting the time-out check time
The default setting of the time-out check time is 1 second. The time-out check time can be changed by T3 program. The valid setting range is 0.1 to 60.0 seconds in 0.1 second units. Refer to section 4.2.3.
To change the time-out check time, write desired value into the AS311’s buffer memory address 25 (CH1 time-out check) and/or address 89 (CH2 time-out check), and execute the hot reset (refer to section 5.5).
T3 program for this purpose is almost same as that for setting the trailing code (refer to section 5.6). Only the difference is writing the time-out check time instead of the trailing code. See Rung 2 of the following sample. In this sample, the channel 1 time-out check time is changed to 5 seconds.
If the channel 2 time-out check time and/or the trailing code are also changed, write these data on the Main program Rung 2 before calling Subroutine No. 3 in the same manner.
50
ASCII Interface Module (AS311)
Section 6
RAS Information
6.2 Buffer memory information
51
6. RAS Information
6.1 LED indication
On the AS311, five status LEDs are provided as follows. These LEDs are useful to check the AS311 operation status and the communication status.
RUN
TX1
RX1
TX2
RX2
TX1
RX1
TX2
RX2
RUN Indicates the AS311 operation status.
Lit when the AS311 is in ready state.
Not lit when the AS311 is in error or under initialization.
Indicates the channel 1 communication status.
Lit while some data is transmitting from the AS311.
Indicates the channel 1 communication status.
Lit while some data is receiving into the AS311.
Indicates the channel 2 communication status.
Lit while some data is transmitting from the AS311.
Indicates the channel 2 communication status.
Lit while some data is receiving into the AS311.
52
ASCII Interface Module (AS311)
6. RAS Information
6.2 Buffer memory information
Various RAS information are stored in the AS311’s buffer memory. These information can be read by READ instruction. When some abnormality has occurred, check these information.
Address 4 of the buffer memory stores the AS311 module status.
F E D C B A 9 8 7 6 5 4 3 2 1 0
4
RDY
Bit F
Bit E
Bit 7-0
RDY (Ready)
ERR (Error)
Error code
1 = operating normally
0 = under initialization or error state
1 = error state
0 = no error (normal)
Shows the detected error item if ERR is 1.
See the table below (H00 when normal)
Error code
Type of error
H01 CPU error
Description
H02
H03
ROM error
RAM error error
CPU error has been detected during initialization.
ROM error has been detected during initialization.
Work RAM error has been detected during initialization. memory Buffer memory error has been detected during initialization. abnormal
H10 Watchdog timer error
Switch setting abnormality has been detected during initialization.
Watchdog timer error has occurred during operation. error
Trap interrupt has occurred by detecting illegal instruction during operation. memory Buffer memory time-out has time-out error occurred during operation.
Status
Operation is stopped.
Operation is stopped.
Operation is stopped.
Operation is stopped.
Operation is stopped.
Operation is stopped.
Cold reset will be effective.
Operation is stopped.
Cold reset will be effective.
Operation is stopped.
Cold reset will be effective.
53
6. RAS Information
6.2.2 Switch setting status
Addresses 5, 6 and 7 of the buffer memory store the switches setting status. Check that the information agrees with the physical setting status if some abnormality has occurred.
F E D C B A 9 8 7 6 5 4 3 2 1 0
5
0 0 0 0 0 0 0 0 RSW1 RSW2
Bit 7-4
Bit 3-0
RSW1
RSW2
Stores the rotary switch 1 (RSW1) setting status.
0 - F
Stores the rotary switch 2 (RSW2) setting status.
0 - F
F E D C B A 9 8 7 6 5 4 3 2 1 0
6
0 0 0 0 0 0 0 0 SW1
SW1
OFF ON
8
7
6
5
4
3
2
1
ON: 1 OFF: 0
F E D C B A 9 8 7 6 5 4 3 2 1 0
SW2
7
0 0 0 0 0 0 0 0
SW2
OFF ON
8
7
6
5
4
3
2
1
ON: 1 OFF: 0
54
ASCII Interface Module (AS311)
6. RAS Information
6.2.3 Error information for data receiving
Address 16 for channel 1 and address 80 for channel 2 store the error information for data receiving.
F E D C B A 9 8 7 6 5 4 3 2 1 0
16 or 80
0 0 0 0
Bit B
Bit A
Bit 9
Bit 8
Bit 7-0
BRK (Break) 1 = break detected
0 = normal
When break has been detected, receive buffer is cleared. The next message can be received.
PE (Parity error) 1 = parity error
0 = normal
When parity error has occurred, the message is disabled. The next message can be received.
FE
(Framing error)
1 = framing error
0 = normal
When framing error has occurred, the message is disabled. The next message can be received.
OE
(Overrun error)
Receive error code
1 = overrun error
0 = normal
When overrun error has occurred, the message is disabled. The next message can be received.
Shows the error code regarding received message.
See the table below. (H00 when normal)
Error code
Type of error Description out error
H02 Message length error
Specified time-out check time has elapsed between characters.
The message length has exceeded the limit. (896 bytes) overflow buffer Receive buffer overflow has occurred.
Status
The rest of the message will be received as the next.
The message is disabled.
The next message can be received.
The message is disabled.
The next message can be received.
55
6. RAS Information
6.2.4 Error information for data transmitting
Address 17 for channel 1 and address 81 for channel 2 store the error information for
F E D C B A 9 8 7 6 5 4 3 2 1 0
17 or 81
0 0 0 0 0 0 0 0
Bit 7-0 Transmit error code
Shows the error code for transmitting.
See the table below. (H00 when normal)
Error code
Type of error Description Status missing
The trailing code has not been written into the buffer memory.
The message is disabled.
The next message can be transmitted.
56
ASCII Interface Module (AS311)
6. RAS Information
6.3 Trouble shooting
When AS311 does not work properly, check the following points.
When AS311’s RUN
LED does not light;
When RX1/RX2 LED
does not light while the connected device is transmitting a message;
When the received data cannot be read properly;
When a data cannot be
transmitted from the
AS311 (TX1/TX2 LED does not light);
Does the POWER LED on the T3 power supply module
Is the AS311 mounted securely on the base ?
Are the transmission signals (RXD, SG, etc.) connected properly ?
Does the receive error occur ?
Is the T3 program working
Does the transmit error occur ?
Is the CTS signal connected properly ?
If no, check the power voltage/connection.
If no, check the internal
5 Vdc current consumption.
Remove the AS311, and mount again securely.
Check the cable connection.
Check the transmission parameters (baudrate,
Check the cable connection.
Confirm the receive
Check the T3 program.
Confirm the transmit error information.
Check the T3 program.
Check the cable connection.
If CTS signal is OFF,
57
58
ASCII Interface Module (AS311)
Appendix
A.1 Specification of the READ instruction
A.2 Specification of the WRITE instruction
59
Appendix
A.1 Specification of the READ instruction
FUN 237 Special module data read (READ)
Reads designated range of data from the special module.
Input Execution output
[ A READ B
→
C ]
Function
•
This instruction reads data from the buffer memory of the special module that is designated by operand A, and stores them in T3’s registers starting with operand C.
•
The transfer source address (buffer memory
Input Action Output address) is designated by operand B.
•
The transfer size (number of words) is
OFF
ON designated by operand B+1.
Error (see Note 2) ON ON
Operand
Index
Constant
Device Register
Opr Name
X Y S L R Z T. C. I O
A Special
I J K
W
√ √ √ √ module
B Transfer
√ √ √ √ √ √ √ √ √ √ parameter
√ √ √ √ √ √ √ √ √ √ of destination
Program example
R0000
[ XW000 READ RW010
→
D0100 ]
•
When R0000 is ON, the buffer memory data of the size indicated by RW011, starting with the address indicated by RW010 of the special module allocated to XW000, are read and stored in
D0100 and after.
•
The maximum number of words to be read is 256 words.
XW000 special module T3
Buffer memory
RW010 20
RW011 16
20 1234
35 5678
READ
16 words
D0100 1234
D0115 5678
60
ASCII Interface Module (AS311)
Appendix
Note 1) The special module can be designated not only by the assigned register, but also by the mounting position. The mounting position is designated by a constant data for the operand A as follows. number)
+
(Slot number)
H
Unit number Hexadecimal Slot number
0 H00
Hexadecimal
0 H00
1 H01
2 H02
3 H03
1 H01
2 H02
3 H03
4 H04
5 H05
6 H06
7 H07
8 H08
9 H09
10 H0A
For example, if a special module is mounted on Slot-4, Unit-0 (basic unit) and allocated to XW008 - YW011, the following two READ instructions function the same.
[ XW008 READ RW010
→
D0100 ]
[ H0004 READ RW010
→
D0100 ]
Note 2) The READ instruction is not executed as error in the following cases. In these cases, ERF (instruction error flag = S0051) is set to ON.
•
When the operand A is other than a valid constant (see Note 1) or XW/YW register.
•
When the designated special module has been disconnected.
•
When no answer error occurs with the designated special module.
•
When the number of words transferred exceeds 256 words.
•
When the source table of transfer is out of the valid range.
•
When the destination table of transfer is out of the valid range.
61
Appendix
A.2 Specification of the WRITE instruction
FUN 238 Special module data write (WRITE)
Writes designated range of data into the special module.
Input Execution output
[ A WRITE B
→
C ]
Function
•
This instruction transfers data stored in T3’s registers starting with operand A into the buffer memory of the special module that is designated by operand C.
•
The destination address (buffer memory
Input Action Output address) is designated by operand B.
•
The transfer size (number of words) is
OFF
ON designated by operand B+1.
Error (see Note 2) ON ON
Operand
Index
Constant
Device Register
Opr Name
X Y S L R Z T. C. I O I J K
W
√ √ √ √ √ √ √ √ √ √ √ of source
B Transfer
√ √ √ √ √ √ √ √ √ √ parameter
C Special
√ √ √ √ module
Program example
R0000
[ D0100 WRITE RW010
→
YW002 ]
•
When R0000 is ON, the register data of the size indicated by RW011, starting with D0100, are transferred to the buffer memory starting with the address indicated by RW010 of the special module allocated to YW002.
•
The maximum number of words to be transferred is 256 words.
T3 YW002 special module
RW010 320
RW011 150 Buffer memory
D0100 1234
D0249 5678
WRITE
150 words
320 1234
469 5678
62
ASCII Interface Module (AS311)
Appendix
Note 1) The special module can be designated not only by the assigned register, but also by the mounting position. The mounting position is designated by a constant data for the operand C as follows. number)
+
(Slot number)
H
Unit number Hexadecimal Slot number
0 H00
Hexadecimal
0 H00
1 H01
2 H02
3 H03
1 H01
2 H02
3 H03
4 H04
5 H05
6 H06
7 H07
8 H08
9 H09
10 H0A
For example, if a special module is mounted on Slot-2, Unit-1 (expansion unit #1) and allocated to XW020 - YW023, the following two WRITE instructions function the same.
[ D0100 WRITE RW010
→
XW020 ]
[ D0100 WRITE RW010
→
H0102 ]
Note 2) The WRITE instruction is not executed as error in the following cases. In these cases, ERF (instruction error flag = S0051) is set to ON.
•
When the operand C is other than a valid constant (see Note 1) or XW/YW register.
•
When the designated special module has been disconnected.
•
When no answer error occurs with the designated special module.
•
When the number of words transferred exceeds 256 words.
•
When the source table of transfer is out of the valid range.
•
When the destination table of transfer is out of the valid range.
63
TOSHIBA CORPORATION
Industrial Equipment Department
1-1, Shibaura 1-chome, Minato-ku
Tokyo 105-8001, JAPAN
Tel: 03-3457-4900 Fax: 03-5444-9268
Advertisement
Key features
- RS-232C or RS-422 interface
- Two independent communication channels
- Asynchronous data transmission
- Data exchange using ASCII code
- Buffer memory for message storage
- Status LEDs for monitoring operation
- Self-diagnosis and error checking
- Hot and cold reset options
- Trailing code customization
- Time-out check for reliable reception