The text of a manual · part 28 of 70
SLC 500 Instruction Set Reference Manual, pages 271 to 280
Pages 271 to 280 of 694
The original document is the PDF (7.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1747-L514
Page 271
SLC Communication Instructions
The message instruction is an output instruction that lets you read or write data from one processor to another processor via the communication channel(s). The SLC 5/02 processor can service one message instruction at any given time. The SLC 5/03 and higher processors can service up to four message instructions per channel at a time, for a maximum of eight message instructions at any given time. Only one message instruction is serviced at a time for Modbus RTU Master protocol.
Message Instruction Overview
MSG READ/WRITE MESSAGE Read/write Target Device Control Block Control Block Length Setup Screen
12-5
To invoke the MSG instruction, toggle the MSG instruction rung from false-to-true. Do not toggle the rung again until the MSG instruction has successfully or unsuccessfully completed the previous message, indicated by the processor setting either the DN or ER bit.
(EN) (DN) (ER) 7
SLC 5/02 MSG READ/WRITE MESSAGE Type Read/write Target Device Local/Remote Control Block Control Block Length Setup Screen
MSG Instruction Operation
(EN) (DN) (ER)
SLC 5/02 - Although only one message instruction can be serviced at a time, the processor may hold several messages enabled and waiting (control block status bits EN and EW set). Waiting messages are serviced one at a time in sequential order.
14
SLC 5/03 and higher
Fixed SLC SLC SLC SLC SLC 5/01 5/02 5/03 5/04 5/05 •
•
Output Instruction
•
•
Ladder logic should be included with every SLC 5/02 MSG instruction to time out the message in the event that the MSG starts transmitting successfully (MSG control block ST bit set), but the response is not received back in a reasonable amount of time. See Figure 12.1 and Figure 12.2 on how to use the MSG control block TO bit to accomplish this.
Publication 1747-RM001G-EN-P - November 2008
Page 272
12-6
SLC Communication Instructions
Figure 12.1 SLC 5/02 Messaging Example with MSG Timeout
MSG_TRIGGER B3:0 0000 0
MSG_ST_BIT N9:0 0001 14
SLC_502_MSG MSG Read/Write Message Read/Write Target Device Control Block Control Block Length Setup Screen
MSG_TIMEOUT TON Timer On Delay Timer Time Base Preset Accum MSG_TIMEOUT/DN T4:0 DN
MSG_DN_BIT N9:0 0002 13
0003
Publication 1747-RM001G-EN-P - November 2008
EN Read 500CPU N9:0 7
EN T4:0 1.0 5< 0<
DN
MSG_TO_BIT N9:0 L 8
MSG_TRIGGER B3:0 U 0
MSG_ER_BIT N9:0
MSG_TO_BIT N9:0
12
8 END
MSG_TO_BIT N9:0 U 8
DN ER
Page 273
SLC Communication Instructions
12-7
Figure 12.2 SLC 5/02 Repeating Messaging Example with MSG Timeout
SLC_502_MSG MSG Read/Write Message Read/Write Target Device Control Block Control Block Length Setup Screen
0000
MSG_ST_BIT N9:0 0001 14
MSG_TIMEOUT TON Timer On Delay Timer Time Base Preset Accum
MSG_TIMEOUT/DN T4:0 DN
DN ER
EN
T4:0 1.0 5< 0<
DN
MSG_TO_BIT N9:0 L 8 MSG_EN_BIT N9:0 U 15
MSG_DN_BIT N9:0 0002 13
0003
EN
Read 500CPU N9:0 7
MSG_ER_BIT N9:0
MSG_TO_BIT N9:0
12
8
MSG_TO_BIT N9:0 U 8
END
SLC 5/03 and higher - If a MSG instruction has entered one of the four channel dependent transmission buffers and is waiting to be transmitted, its control block will have status bits EN and EW set. If more than four MSG instructions for that channel are enabled at one time, a channel dependent overflow queue is used to store the MSG instruction header blocks (not the data for a MSG write) from the fifth instruction to the fourteenth. If the channel is configured for Modbus RTU Master, the second through the eleventh instructions will be added to a channel-dependent overflow queue. These instructions, queued in a FIFO order, will only have control block status bit EN set. If more than 14 (11 for Modbus RTU Master) MSG instructions are enabled at one time for any one channel, only control block status bit WQ is set, as there is no room available to currently queue the instruction. This instruction must be re-scanned with true rung conditions until space exists in the overflow queue.
Publication 1747-RM001G-EN-P - November 2008
Page 274
12-8
SLC Communication Instructions
TIP
If you consistently enable more MSG instructions than the buffers and queues can accommodate, the order in which MSG instructions enter the queue is determined by the order in which they are scanned. This means MSG instructions closest to the beginning of the program enter the queue regularly and MSG instructions later in the program may not ever enter the queue.
You can use the timeout control similar to the SLC 5/02 MSG instruction or use the built in timeout control (recommended). If the timeout value is set to 0, the functionality is similar to the SLC 5/02 MSG instruction. It differs in that once the TO bit is set, it will be reset automatically along with the ER bit on the next MSG rung false-to-true transition. We highly recommend setting the internal timeout value to something other than zero. Figure 12.3 SLC 5/03, SLC 5/04, and SLC 5/05 Non-repeating MSG_TRIGGER B3:0 0000 0
MSG_DN_BIT N9:0 0001 13
SLC_503_504_505_MSG MSG Read/Write Message Type Read/Write Target Device Local/Remote Control Block Control Block Length Setup Screen
EN Peer-To-Peer Read 500CPU Local N9:0 14
DN ER
MSG_TRIGGER B3:0 U 0
MSG_ER_BIT N9:0 12 0002
Publication 1747-RM001G-EN-P - November 2008
END
Page 275
SLC Communication Instructions
12-9
Figure 12.4 SLC 5/03, SLC 5/04, and SLC 5/05 Repeating Messaging Example SLC_503_504_505_MSG MSG Read/Write Message Type Read/Write Target Device Local/Remote Control Block Control Block Length Setup Screen
0000
MSG_DN_BIT N9:0 0001 13
EN Peer-To-Peer Read 500CPU Local N9:0 14
DN ER
MSG_EN_BIT N9:0 U 15
MSG_ER_BIT N9:0 12 0002
END
For the SLC 5/05 Channel 1 Ethernet, TCP/IP protocol is used to establish Ethernet connections, in order to send the MSG commands. Connections can be initiated by either a client program (INTERCHANGE or RSLinx application) or a processor. The client program or processor must first establish a connection to the SLC 5/05 to enable the SLC 5/05 to receive solicited messages from a client program or another processor (incoming connection). The client program must also establish a connection to the SLC 5/05 to enable the SLC 5/05 to send unsolicited messages to a client program (outgoing connection). To send a peer message, the SLC 5/05 must first establish a connection with the destination node at a specified IP address on the Ethernet network. A connection is established when a MSG instruction executes and no previous connection to the same device exists. When a MSG instruction executes, the SLC 5/05 checks to see whether a connection has been established with the destination node. If a connection has not been established, the SLC 5/05 attempts to establish a connection of the peer type.
Publication 1747-RM001G-EN-P - November 2008
Page 276
12-10
SLC Communication Instructions
Table 12.3 Dedicated Connections Number of Connections(1)
Dedicated to:
4 peer messages (outgoing)
4 client messages (incoming)
8(2), 16(3), 24(4), 40(5), 56(6)
either peer or client messages
(1)
Connections established by an INTERCHANGE client, RSLinx client, and peers are all included when counting the number of connections
(2)
All series A/B 16 K (1747-L551) processors and series A/B 32 K (1747-L552) and 64 K (1747-L553) processors with OS 501, series C, FRN 4 and lower firmware.
(3)
Series A/B 32 K (1747-L552) and 64 K (1747L553) processors with OS 501, series C, FRN 5 and higher firmware.
(4)
Series C 16 K (1747-L551) processors.
(5)
Series C 32 K (1747-L552) processors.
(6)
Series C 64 K (1747-L553) processors.
IMPORTANT
Publication 1747-RM001G-EN-P - November 2008
For peer connections, no more than one connection per destination node is established. If multiple MSG instructions use the same destination node, they share the same connection.
Page 277
SLC Communication Instructions
12-11
MSG Instruction Configuration Options The following configuration options are available on all SLC 5/02 and higher processors. • Peer-to-peer Read/Write on a local network to another SLC 500 processor • Peer-to-peer Read/Write on a local network to a 485CIF device (PLC-2 emulation) In addition, the following configuration options are available on all SLC 5/03 and higher processors. • Peer-to-peer Read/Write on a local network to a PLC-5 processor • Peer-to-peer Read/Write on a remote network to another SLC 500 processor • Peer-to-peer Read/Write on a remote network to a 485CIF device (PLC-2 emulation) • Peer-to-peer Read/Write on a remote network to a PLC-5 processor • Peer-to-peer Read/Write on a local network to Modbus slave devices In addition, the following configuration option is available on SLC 5/05 processors. • Peer-to-peer Read/Write Multihop from Ethernet to a Logix processor (ControlLogix, FlexLogix, and CompactLogix), or other EtherNet/IP device, or through ControlLogix gateway to ControlNet, DH+, or DH-485.
MSG Instruction Parameters Enter the following parameters when programming this instruction. • Read/Write - Read indicates the local processor (processor in which the instruction is located) is receiving data; write indicates the local processor is sending data. • Target Device identifies the type of device which responds to the MSG command. Valid options are: – 500CPU, if the target device is another SLC processor – 485CIF, if the target device is a PLC-2 emulator device – PLC-5, if the target device accepts PLC-5 commands(1) – Modbus, if the target device is configured as Modbus RTU Slave
(1)
SLC 5/03 and higher only.
Publication 1747-RM001G-EN-P - November 2008
Page 278
12-12
SLC Communication Instructions
• Local or Remote identifies if the message is sent to a device on a local network, or to a remote device on another network through a bridge. Valid options are: – Local, if the target device is on the local network – Remote, if the target device is on a remote network(1) • Control Block is an integer file address that you select. It is a block of words, containing the status bits, target file address, and other data associated with the message instruction. • Control Block Length is a display-only field that indicates how many integer file words are being used by the control block. See Table 12.4 for possible control block lengths.
The MSG control block length increases from 7 to at least 14 words when changing from an SLC 5/02 to an SLC 5/03, SLC 5/04, or SLC 5/05 processor program. For ease of program portability between SLC processors, dedicate an integer file to each MSG instruction control block.
TIP
Table 12.4 MSG Instruction Control Block Lengths 485 CIF
500 CPU
PLC-5
PLC-5 with Logical ASCII/Symbolic Addressing
Modbus RTU Master
SLC 5/02
7
7
Not Applicable
Not Applicable
Not Applicable
SLC 5/03
14
14
14
56(1)
14(3) (Channel 0 only)
SLC 5/04
14
14
14
56(2)
14(3) (Channel 0 only)
SLC 5/05 Channel 0
14
14
14
56
14(3)
SLC 5/05 Channel 1
51
51
51
93
Not Applicable
(1)
OS302, Series C, FRN 5 or higher with RSLogix 500 version 4.5 or higher.
(2)
OS401, Series C, FRN 5 or higher with RSLogix 500 version 4.5 or higher.
(3)
Series C, FRN 11 or higher with RSLogix 500 version 8.10 or higher.
Publication 1747-RM001G-EN-P - November 2008
Page 279
SLC Communication Instructions
12-13
MSG Instruction Setup Screen Parameters Parameters for This Controller • Data Table Address – For a Read, this is the starting address which receives the data that is read from the target device. – For a Write, this is the starting address of the data which is written to the target device. – For Modbus RTU Master, this is the starting address to receive or send data. • Size in Elements – Specifies the length of the message in elements. The maximum number of elements that are transferred via a MSG instruction is determined by the size of the destination data type. – For a Read, the data type in the local processor determines the maximum number of elements. – For a Write, the data type in the target device determines the maximum number of elements. The maximum number of elements that are transferred may be further limited based on the processor type.
Table 12.5 MSG Instruction Maximum Number of Elements (except Modbus RTU) File Types
SLC 500, SLC 5/01, SLC 5/02
SLC 5/03, SLC 5/04, SLC 5/05 Channel 0
SLC 5/05 Channel 1 Non-Multihop
Multihop to SLC
Multihop to PLC-5
O, I, B, N
41
103
256
119
115
T
13
34(1)
256(3)
39
38(4)
C, R
13
34
256
39
38
F
Not Applicable
51
256
59
57
St
Not Applicable
2(2)
25
2
1
A
Not Applicable
103
256
119
115
(1)
PLC-5 type timer element maximum is 20.
(2)
PLC-5 type string element maximum is 1.
(3)
PLC-5 type timer element maximum is 208.
(4)
PLC-5 type timer element maximum is 23.
Publication 1747-RM001G-EN-P - November 2008
Page 280
12-14
SLC Communication Instructions
Table 12.6 MSG Instruction Maximum Number of Elements for Modbus RTU Master File Types
Channel 0 on SLC 5/03, SLC 5/04, SLC 5/05
B
1856 bits
N
116 words
F
58 registers (32-bit)
• Channel(1) Specifies the communication channel that is used to transmit the message request. – SLC 5/03 - (Channel 0, RS-232) or (Channel 1, DH-485) – SLC 5/04 - (Channel 0, RS-232) or (Channel 1, DH+) – SLC 5/05 - (Channel 0, RS-232) or (Channel 1, Ethernet)
Parameters for Target Device (except Modbus RTU) • Message Timeout(2) Specifies the length of the message timer in seconds. A timeout of 0 seconds means that there is no timer and a message that has been acknowledged waits indefinitely for a reply. Valid range is 0, 1 to 255. Message Timeout for a channel 0 DF1 Full-duplex MSG instruction should be configured greater than the channel 0 [ACK Timeout x (ENQ Retries + 1)] in seconds. Message Timeout for a channel 0 DF1 Half-duplex Master MSG instruction with polling mode set to ‘message based’ should be configured greater than the channel 0 [ACK Timeout x (2 x Message Retires + 1)] in seconds. Message Timeout for a channel 0 DF1 Half-duplex Master MSG with polling mode set to standard should be configured greater than the channel 0 [ACK Timeout x (Message Retires + 1) x number of slave stations] in seconds. Message Timeout for a channel 0 DF1 Half-duplex Slave MSG should be configured greater than the Master’s channel 0 [2 x ACK Timeout x (message retries + 1) x number of slave stations] in seconds.
Publication 1747-RM001G-EN-P - November 2008
(1)
SLC 5/03 and higher only.
(2)
SLC 5/03 and higher only.