The text of a manual · part 30 of 70
SLC 500 Instruction Set Reference Manual, pages 291 to 300
Pages 291 to 300 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 291
SLC Communication Instructions
12-25 capable of exchanging data with the device. Supported Modbus commands include:
Modbus Command Types Modbus Command
Used For
01 Read Coil Status reading bits
02 Read Input Status reading bits
03 Read Holding Registers reading words
04 Read Input Registers reading words
05 Write Single Coil writing 1 bit
06 Write Single Register writing 1 word
15 Write Multiple Coil writing multiple bits
16 Write Multiple Registers writing multiple words
Publication 1747-RM001G-EN-P - November 2008
Page 292
12-26
SLC Communication Instructions
Configure MultiHop Tab To message to an Ethernet Network Interface (ENI) or MicroLogix 1100, enter the target device’s IP address in the first row ‘To Address’ field. To message to a CompactLogix, ControlLogix, or FlexLogix controller, enter the controller’s Ethernet interface IP address in the first row ‘To Address’ field, press the keyboard insert key to add a hop (which appends a second row labeled ControlLogix Backplane) and enter the controller’s backplane slot number (0 to 16 for ControlLogix, always 0 for CompactLogix and FlexLogix) in the second row ‘To Address’ field. To message through a ControlLogix gateway to ControlNet, DH+, or DH-485, enter the slot number of the desired network interface module in the second row ‘To Address’ field, press the keyboard insert key to add another hop (which appends a third row), select the appropriate ‘From Device’ and ‘From Port’ (if applicable) and enter the node address in ‘To Address’ field. Some message routes may require adding additional hops. Not all message routes entered with the software are valid. The software validates the construct of the message route when the rung is verified.
Publication 1747-RM001G-EN-P - November 2008
Page 293
SLC Communication Instructions
12-27
MSG Instruction Setup Screen Status Bits The column in the table below lists the various status bits associated with the SLC 500 MSG instruction as displayed in the RSLogix 500 MSG instruction setup screen. Table 12.9 MSG Instruction Setup Screen Status Bits Bit Definition
Bit Mnemonic
Bit Address
Ignore if timed out
TO
08
To be retried
NR
09
Awaiting execution
EW
10
Continuous run
CO
11
Error
ER
12
Message done
DN
13
Message transmitting
ST
14
Message enabled
EN
15
Waiting for queue space
WQ
07
• Timeout Bit TO (word 0, bit 8):Set this bit in your application to remove an active message instruction from processor control. You must use your own timeout control routine for the SLC 5/02 MSG instruction (See Figure 12.1 on page 12-6). You may use the internal timeout control for SLC 5/03 and higher processors. For these processors, we recommend using the built-in timeout control because it simplifies the user program. Default values are 5 seconds for SLC 5/03, SLC 5/04, and SLC 5/05 channel 0, and 23 seconds for SLC 5/05 channel 1. To utilize the internal timeout control, a value greater than 0 must be entered for the MSG instruction timeout parameter. A timeout value of 0 means no timeout value. In other words, if communication is interrupted, the processor will wait forever for a reply. If an acknowledgement is received (as indicated by the ST bit being set), but the reply is not received, the MSG instruction will appear to be locked up, although it is merely waiting for the reply. When a value greater than 0 is entered for the MSG timeout parameter and communication is interrupted, the MSG instruction will timeout and error after the time expires, allowing the user program to retry the same message if desired.
Publication 1747-RM001G-EN-P - November 2008
Page 294
12-28
SLC Communication Instructions
With an SLC 5/02 MSG instruction, the ladder logic must reset the Timeout Bit before triggering the MSG instruction. TIP
When programming timeout control in SLC 5/03 and higher processors, omit the Timeout Bit manual reset rung.
• No Response Bit NR (bit 9) is set if the target processor responds to the MSG instruction that it cannot process the message at the current time (for DH-485 and DH+ protocols only). This means that the MSG should be retried. The NR bit is reset the next time the MSG instruction gets scanned. Do not set or reset this bit. It is informational only. • Enabled and Waiting Bit EW (bit 10) is set after the enable bit is set and the message is physically placed in one of the four available transmit buffers. The EW bit is reset when either the ST or ER bit is set. Do not set or reset this bit. It is informational only. • Continuous Operation CO (bit 11)(1) Set this bit if you wish to continually resend the MSG instruction. We recommend that internal timeout control be used for this option and the rung be unconditionally true. Use this bit to turn the mode on and off. A MSG instruction occupies one of the four channel transmission buffers when its CO bit is set. Therefore, a maximum of four MSG instructions per channel may have their CO bit set. This mode will continuously operate provided that the rung is continually scanned. If the instruction errors prior to the MSG timeout, it will automatically retry until it is successful. If the instruction errors due to a MSG timeout, the MSG stops triggering. The EN bit must be toggled off and back on to resume operation.
TIP
If your program contains four message instructions assigned to the same channel with the Continuous Operation (CO) bit set, no other message instructions can be executed out that same channel, including message instructions which may be in the fault routine.
• Error Bit ER (bit 12) is set when message transmission has failed. The ER bit is reset the next time the associated rung goes from false to true. Do not set or reset this bit. It is informational only. • Done Bit DN (bit 13) is set when the message is transmitted successfully. The DN bit is reset the next time the associated rung goes from false to true. Do not set or reset this bit. It is informational only.
(1)
Publication 1747-RM001G-EN-P - November 2008
SLC 5/03 and higher processors only.
Page 295
SLC Communication Instructions
12-29
• Start Bit ST (bit 14) is set when the processor receives acknowledgment (ACK) from the target device. The ST bit is reset when the DN, ER, or TO bit is set. Do not set or reset this bit. It is informational only. For SLC 5/05 Ethernet (channel 1) communications, the ST bit indicates internally that the Ethernet daughterboard has received a command and it is acceptable for a transmission attempt. The command has not yet been transmitted. For all broadcast message writes, and for DF1 Radio Modem communications, the ST bit only indicates that the command has been successfully transmitted. • Enable Bit EN (bit 15) is set when rung conditions go true and there is space available in either the MSG buffer or MSG queue. It remains set until message transmission is completed and the rung goes false. You may reset this bit once either the ER or DN bit is set in order to retrigger a MSG instruction with true rung conditions on the next scan. Do not set this bit. • Waiting for Queue Space Bit WQ (Word 7, bit 0)(1) is set when the queue is full. This bit is cleared when space is available in the active queue. Do not set or reset this bit. It is informational only.
For a MSG write instruction, when the WQ bit is set, or when only the EN bit is set, your source data is unbuffered. If your application requires buffered (or snapshot) data, wait until the EW bit is set before overwriting your source data.
TIP
Table 12.10 Setting Bits for Buffered Data WQ
EN
EW
Description
1
0
0
MSG not queued or buffered
0
1
0
MSG is queued, source data not buffered
0
1
1
MSG and source data is buffered
(1)
SLC 5/03 and higher processors only.
Publication 1747-RM001G-EN-P - November 2008
Page 296
12-30
SLC Communication Instructions
MSG Instruction Control Block Limitations for Manipulating the Control Block Bits Do not manipulate the MSG instruction control block values except as noted below. For example, do not clear the first word of the control block, do not unlatch the time-out control bit (except in an SLC 5/02 MSG instruction), and so on. The only MSG instruction control bits that may be manipulated by the ladder program without adversely affecting the operation of the instruction are the CO, EN, and TO bits. The enable bit (EN = bit 15) may be unlatched, but only when the done bit (DN = bit 13) or error bit (ER = bit 12) has been set, indicating the successful or unsuccessful completion of the previous message. In addition, when a MSG is in progress and the ladder program wishes to terminate it for any reason, this may be done by enabling the time-out bit (TO = bit 8). The next time the processor scans the MSG instruction with the TO bit set, it will error the MSG (ER = 1). The MSG instruction may then be re-enabled with a false-to-true transition on the next program scan.
Publication 1747-RM001G-EN-P - November 2008
Page 297
SLC Communication Instructions
12-31
Control Block Layouts The control block layout is shown below for 500CPU or PLC-5 controller as the target device.
Table 12.11 Read or Write, Local or Remote(1) to a 500 CPU or PLC-5(1) (Without Logical ASCII/Symbolic Addressing) 15
14
13
12
11
10
09
08
07
Word 0
EN
ST
DN
ER
CO(1)
EW
NR
TO
Error Code
Word 1
Reserved
Word 2
Number of Elements
Word 3
File Number
Word 4
File Type (S, B, T, C, R, N) (O, I, F, ST, A)(1)
Word 5
Element Number
Word 6
Not Used
Word 7(1)
Remote Bridge Address (Remote only)
Reserved (Internal Messaging Bits)
Word 8(1)
Reserved (Internal Messaging Bits)
Message Timer Preset
Word 9(1)
Message Timer Scaled Zero
Word 10(1)
Message Timer Accumulator
Word 11(1)
Reserved (Internal Messaging Bits)
Word 12(1)
AO=0 Reserved (Internal Messaging Bits)
Word 13(1)
Reserved (Internal Messaging Bits)
(1)
06
05
04
03
02
01
0
Target Node Address (Local)/Remote Station Address (Remote)
WQ
SLC 5/03 and higher processors only.
Publication 1747-RM001G-EN-P - November 2008
Page 298
12-32
SLC Communication Instructions
The control block layout is shown below for 485CIF as the target device.
Table 12.12 Read or Write, Local or Remote(1) to a 485 CIF
(1)
15
14
13
12
11
10
09
08
07
Word 0
EN
ST
DN
ER
CO(1)
EW
NR
TO
Error Code
Word 1
Not Used
Word 2
Number of Words
Word 3
Offset in Words
Word 4
Not Used
Word 5
Not Used
Word 6
Not Used
Word 7(1)
Remote Bridge Address (Remote only)
Reserved (Internal Messaging Bits)
Word 8(1)
Reserved (Internal Messaging Bits)
Message Timer Preset
Word 9(1)
Message Timer Scaled Zero
Word 10(1)
Message Timer Accumulator
Word 11(1)
Reserved (Internal Messaging Bits)
Word 12(1)
Reserved (Internal Messaging Bits)
Word 13(1)
Reserved (Internal Messaging Bits)
SLC 5/03 and higher processors only.
Publication 1747-RM001G-EN-P - November 2008
06
05
04
03
02
01
0
Target Node Address (Local)/Remote Station Address (Remote)
WQ
Page 299
SLC Communication Instructions
12-33
Table 12.13 Read or Write, Local or Remote to a PLC-5 (with Logical ASCII/Symbolic Addressing)(1) (2) (3) 15
14
13
12
11
10
09
08
07
06
05
04
03
02
Word 0
EN
ST
DN
ER
CO
EW
NR
TO
Error Code
Word 1
Not Used
Word 2
Number of Elements
Word 3
Not Used
Word 4
File Type (based on local source or destination address)
Word 5
Not Used
Word 6
Not Used
Word 7
Remote Bridge Address (Remote only)
Reserved (Internal Messaging Bits)
Word 8
Reserved (Internal Messaging Bits)
Message Timer Preset
Word 9
Message Timer Scaled Zero
Word 10
Message Timer Accumulator
Word 11
Reserved (Internal Messaging Bits)
Word 12
AO=1
Word 13
Reserved (Internal Messaging Bits)
Word 14
Logical ASCII Address String Length including NULL Termination Character (bytes)
Word 15
First Byte of Address String
Second Byte of Address String
Word 16
Third Byte of Address String
...
...
...
...
...
...
...
Word 55
Eighty-first Byte of ASCII Address String
NULL Byte of Longest ASCII Address String
01
0
Target Node Address (Local)/Remote Station Address (Remote)
WQ
Reserved (Internal Messaging Bits)
(1)
SLC 5/05 Channel 0.
(2)
SLC 5/04 OS401, Series C, FRN 5 or higher with RSLogix 500 version 4.5 or higher.
(3)
SLC 5/03 OS302, Series C, FRN 5 or higher with RSLogix 500 version 4.5 or higher.
Lower byte internal use.
Publication 1747-RM001G-EN-P - November 2008
Page 300
12-34
SLC Communication Instructions
Table 12.14 SLC 5/05 Channel 1 Read or Write, Local or Remote to an SLC 500 CPU or PLC-5 (without Logical ASCII/Symbolic Addressing) 15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
Word 0
EN
ST
DN
ER
CO
EW
NR
TO
Error Codes
Word 1
Reserved
Word 2
Number of Elements
Word 3
File Number
Word 4
File Type (based on local source or destination address)
Word 5
Element Number
Word 6
Not Used
Word 7
Remote Bridge Address (Remote Only)
Reserved (Internal Messaging Bits)
Word 8
Reserved (Internal Messaging Bits)
Message Timer Preset
Word 9
Message Timer Scaled Zero
Word 10
Message Timer Accumulator
Word 11
Reserved (Internal Messaging Bits)
Word 12
AO= 0
Word 13
Reserved (Internal Messaging Bits)
Word 14
First Byte of IP Address String(1)
Second Byte of IP Address String
Word 15
Third Byte of IP Address String
...
...
...
...
...
...
...
Word 34
Forty-First Byte of IP Address String
NULL Byte of Longest IP Address String
Word 35(3)
Not Used
Ethernet Message Type = 0(2), 10h(3), or 11h(3)
Word 36(3)
ASA Service
Internal Object Identifier (IOI) Size in Words (1 to 5)
Words 37 - 41(3)
ASA Internal Object Identifier (IOI)
Word 42(3)
Not Used
Words 43 - 50(3)
Connection Path
00
Remote Station Address (Remote only)
WQ
Reserved (Internal Messaging Bits)
Connection Path Size in Words (1 to 8)
(1)
The IP Address format is up to 42 ASCII characters including a terminating NULL character. The first byte in the array is the left most character in the string as written. For example: If the IP Address is 423.156.78.012, the first byte is the ASCII character “4”. If the MSG destination is an INTERCHANGE client on a host computer, the destination is specified as “client” and stored as a NULL terminated string.
(2)
Not MultiHop MSG.
(3)
MultiHop MSG.
Publication 1747-RM001G-EN-P - November 2008