Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 29 of 70

SLC 500 Instruction Set Reference Manual, pages 281 to 290

Pages 281 to 290 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 281

SLC Communication Instructions

12-15

Message Timeout for any SLC 5/05 channel 1 MSG cannot be modified in the Ethernet Message Setup dialog box. It is assigned by the processor and is determined by adding the Channel 1 MSG Connection Timeout to the MSG Reply Timeout, then adding five seconds. This value can be modified by changing one or both of the timeout values in the channel 1 channel configuration screen. The modified message timeout applies to all MSG instructions. • Data Table Address(1) – For a Read, this is the starting address where the data is being read from. – For a Write, this is the starting address where the data is being written to. – To enter in a PLC-5 type logical ASCII address, begin the address name with a $ and enclose the name in double quotes (example: ‘$N7:0’). To enter in a PLC-5 type symbolic address, enclose the name in double quotes (example: ‘READ_TAG’). TIP

You may use the PLC-5 type symbolic address to read/write controller tags in Logix controllers. The supported address forms are: • tag_name. • tag_name[x]. • tag_name[x,y] or tag_name[x][y]. • tag_name[x,y,z] or tag_name[x][y][z]. Use INT data type for integer files or REAL data type for floating point files.

• Data Table Offset(2) Specifies the word offset into an SLC 500 or MicroLogix Common Interface File (CIF) or byte offset into a PLC-5 or Logix PLC-2 compatibility file. Valid range is 0 to 255. • Local Node Addr (dec)/(oct)(3) (4)

(1)

500 CPU and PLC-5 Target Devices only.

(2)

485 CIF Target Devices only.

(3)

Local MSG only.

(4)

All processors except SLC 5/05 Channel 1.

Publication 1747-RM001G-EN-P - November 2008

Page 282

12-16

SLC Communication Instructions

Specifies the node number of the target device that is receiving the message. Table 12.7 Valid Range of Local Node Address, Local Bridge Address, and Remote Station Address Parameters Protocol

Decimal

Octal

DH-485

0-31

0-37

DH+

0-63

0-77

DF1

0-254

0-376

Processors running OS Series C, FRN 6 and higher, can execute a broadcast write MSG command by entering in a target device local node address of 255 (decimal) using RSLogix 500 version 5.20 or higher. A broadcast write command is executed simultaneously by every node that receives it, but no node acknowledges or responds to it. The broadcast write command is valid for DH-485 and DF1 networks only. Broadcast is not supported for read commands or any remote messages. • Ethernet (IP) Address (1) Specifies the Ethernet IP address of the target device that is receiving the message. When using OS501, Series C, FRN 5, or higher firmware and RSLogix 500 version 5.20, or higher programming software, you may optionally enter in the device name (as defined on your local network’s Domain Name System (DNS) servers), in place of the target device’s Ethernet IP address. (RSLogix 500 versions 6.30 and below place an additional restriction on the device name that it must start with an alpha character A to Z.) This device name must be no longer than 41 characters. You must have a Primary Name Server and/or Secondary Name Server defined in the Channel 1 Ethernet configuration to successfully use this device name functionality. If you have a Default Domain Name defined in the Channel 1 Ethernet configuration, then the Default Domain Name is appended to the device name when requesting the corresponding IP address from the DNS server. • MultiHop(2) Specifies whether or not the message is either routed to an EtherNet/IP device, such as a Logix controller or an Ethernet Network interface (1761-NET-ENI), or through a ControlLogix gateway (1756-ENBT). If yes, then the target device Ethernet address or MSG route must be configured in the MultiHop tab of the MSG Setup Screen. Refer to page 12-26 for more information.

Publication 1747-RM001G-EN-P - November 2008

(1)

SLC 5/05 channel 1 only; no Multihop.

(2)

SLC 5/05 channel 1 only.

Page 283

SLC Communication Instructions

12-17

• Local Bridge Addr (dec)/(oct)(1) (2) Specifies the node number of the bridge device on the local network. Refer to page 12-16 for the valid range of addresses. • Remote Bridge Addr (dec)(1) Specifies the node number of the bridge device on the bridging network, when the bridge is configured for gateway mode. Otherwise, leave at 0. • Remote Station Addr (dec)(1) Specifies the node number of the target device on the remote network. Refer to page 12-16 for the valid range of addresses. • Remote Bridge Link ID(1) Specifies the link ID of the remote network where the target device resides. Valid range is 0 to 255.

Parameters for Target Device (Modbus RTU)

(1)

Remote MSG only.

(2)

All processors except SLC 5/05 Channel 1.

Publication 1747-RM001G-EN-P - November 2008

Page 284

12-18

SLC Communication Instructions

• Data Table Address This variable defines the starting address in the local controller. Valid file types for the Data Table Address are shown below: Table 12.8 Valid File Types for Data Table Address Message Read

Message Write

Bit (B)

Bit (B)

Integer (N)

Integer (N)

Floating Point (F)

Floating Point (F)

Only Bit (B) and Integer (N) file types are valid for Modbus Command messages. Starting data table address for coil/input bit commands (1, 2, 5, and 15) require a bit address. Starting data table addresses for register commands (3, 4, 6, and 16) require a word address. Floating Point (F) file type is valid for Modbus Command messages for Holding Registers (commands 03, 06 and 16) when data is configured for 32 bits. • Size in Elements This variable defines the amount of data (in elements) to exchange with the target device. The maximum amount of data that can be transferred via an MSG instruction is 116 words for Modbus commands and is determined by the destination data type. The destination data type is defined by the type of message: read or write. When a read message is used, the destination file is the data file in the local or originating processor. When a write message is used, the destination file is the data file in the target processor. TIP

Input, output, string, and RTC file types are not valid for read messages.

The mazimum number of elements that can be transmitted or received are shown in the following table. TIP

Publication 1747-RM001G-EN-P - November 2008

The table is not intended to illustrate file compatibility. It only illustrates the maximum number of elements that can be exchanged in each case.

Page 285

SLC Communication Instructions

12-19

Message Type

File Type

Element Size

Maximum Number of Elements per Message

Modbus Commands

B, N (command 5)

1-bit

1

B, N, F (command 6)

1-word or 32-bit register (float file type)

1

B, N (commands 1, 2, and 15)

1-bit

1856 Modbus bit elements (116 words) Commands 1 and 2 are read-only, command 15 is write-only.)

B, N, F (commands 3 and 16) B, N (command 4)

multi-register

116 16-bit Modbus register elements (or 58 32-bit Modbus register elements)

Modbus RTU Master protocol is implemented with support for 32-bit registers. When Modbus command 3, 4, 6 or 16 is selected, a selector for register size appears. There are two different word orders for 32-bit registers. For example, a value of aabbccdd h may be represented as: – aabb ccdd h, or – ccdd aabb h To support different processors and file types, the word-swap option for 32-bit registers is made available. TIP

When reading and writing with 32-bit registers, verify with RSLogix 500 if the value appears as intended after the transfer. Toggle word-swap if necessary. Word-swap is required when reading and writing to Float file type with another MicroLogix processor.

Publication 1747-RM001G-EN-P - November 2008

Page 286

12-20

SLC Communication Instructions

Here are two examples of Read Register commands. Example 1: A 32-bit Read Request for an Integer (N) command RSLogix 500 Data View (dec)

SLC Processor (hex)

MLX Processor (hex)

RSLogix 500 Data View (dec)

Read no swap

8192 error

18417

18417

8192

2000 47F1

2000 47F1 47F1 2000

Rea d

8192

18417 ap d-sw r o w

Example 2: A 32-bit Read Request for an Float (F) command RSLogix 500 Data View (dec)

SLC Processor (hex)

MLX Processor (hex)

RSLogix 500 Data View (dec)

Read no swap error

1.086583e-19 123456

123456

2000 47F1

2000 47F1 or dw Rea

47F1 2000 d-sw ap

Note the format differences between Float File and Integer File. – If the destination is Floating File (Example 1), word-swap may be necessary. – If the destination is Integer File (Example 2), word-swap may not be necessary. Here, it is assumed the peer device has not already swapped the word order in the reply. You need to validate the word order by checking the received value in RSLogix 500, prior to implementation on the network. Here are two examples of Write Register commands. Example 3: A 32-bit Write Request for an Integer (N) command RSLogix 500 Data View (dec)

SLC Processor (hex)

MLX Processor (hex)

RSLogix 500 Data View (dec)

Write no swap

8192

18417

2000 47F1 Writ e wo rd-sw ap

Publication 1747-RM001G-EN-P - November 2008

2000 47F1

8192

18417

47F1 2000

18417

8192 error

Page 287

SLC Communication Instructions

12-21

Example 4: A 32-bit Write Request for a Float (F) command RSLogix 500 Data View (dec)

SLC Processor (hex)

MLX Processor (hex)

RSLogix 500 Data View (dec)

Write no swap

123456

47F1 2000 Writ e wo rd-sw ap

47F1 2000

1.086583e-19

2000 47F1

123456 error

Similar to the Read Register command, – If the source file is a Floating file (Example 3), word-swap is recommended. – If the source file is an Integer file (Example 4), word-swap is unnecessary. Here, it is assumed the peer device does not swap received word order. You need to validate the word order prior to implemention on the network. IMPORTANT

Since a 32-bit register is not defined in the Modbus protocol specification, you are advised to first test if the word order is decoded correctly. Some devices may require word-swap and others may not. RSLogix and SLC firmware do not determine word order based on element file type. You need to specify if a 32-bit word-swap is desired.

• Channel FRN 11 of SLC 5/03, SLC 5/04, and SLC 5/05 supports Modbus RTU Master on Channel 0 only. Channel 0 is the RS-232 port. • Message Timeout This value defines how long, in seconds, the message instruction has to complete its operation once it has started. Timing begins when the false-to-true rung transition occurs, enabling the message. If the timeout period expires, the message instruction will generate a specific error (see MSG Instruction Error Codes on page 12-41). The amount of time that is acceptable should be based on application requirements and network capacity and loading. The default value is 2 seconds for Modbus commands. The maximum timeout value is 255 seconds.

Publication 1747-RM001G-EN-P - November 2008

Page 288

12-22

SLC Communication Instructions

If the message timeout is set to zero, the message instruction will never timeout. Set the Time Out bit (TO = 1) to flush a message instruction from its buffer if the destination device does not respond to the communications request. • Modbus - MB Data Address (1-65536) Modbus addressing is limited to 16 bits per memory group, each with a range of 1 to 65,536. There are four memory groups, one for each function: – coils (generally addressed as 0xxxx) – contacts (1xxxx) – input registers (3xxxx) – holding registers (4xxxx) Coils and contacts are addressed at the bit level. Coils are outputs and can be read and written. Contacts are inputs and are read-only. Input registers and holding registers are addressed at the word level. Input registers are generally used for internally storing input values. They are read-only. Holding registers are general purpose and can be both read and written. The most significant digit of the address is considered a prefix, and does not get entered into the MB Data Address field when configuring the message instruction. When the message is sent, the address is decremented by 1 and converted into a 4-character hex number to be transmitted via the network (with a range of 0-FFFFh); the slave increments the address by 1, and selects the appropriate memory group based on the Modbus function. TIP

Modbus protocol may not be consistently implemented in all devices. The Modbus specification calls for the addressing range to start at 1; however, some devices start addressing at 0. The Modbus Data Address in the Message Setup Screen may need to be incremented by one to properly access a Modbus slave’s memory, depending on that slave’s implementation of memory addressing.

• Slave Node Address This is the destination device's node number if the devices are on a Modbus network.

Publication 1747-RM001G-EN-P - November 2008

Page 289

SLC Communication Instructions

12-23

The default Slave Node Address is 1. The range is 0 to 247. Zero is the Modbus broadcast address and is only valid for Modbus write commands (5, 6, 15 and 16). TIP

To initiate a broadcast message on a Modbus network, set the slave node address to 0. Do not initiate more than one Modbus broadcast message at a time. When sequentially triggering multiple Modbus broadcast messages, insert at least 10 msec. delay in between each message.

• Modbus Address This is the translated Modbus address from the MB Data Address.

Configure a Modbus Message This section describes how to configure a local message using the Modbus communication commands. Since configuration options are dependent on which channel is selected, the programming software has been designed to only show the options available for the selected channel. Before configuring the MSG instruction, open the Channel Configuration screen and set the Driver to Modbus RTU Master. For more information on Channel Configuration, see Configuring a Channel for Modbus RTU Master on page 13-91. Figure 12.1 Message Setup Screen

Rung 0 shows a standard RSLogix 500 message (MSG) instruction preceded by conditional logic. 1. Double-click Setup Screen to access the message setup screen. 2. The RSLogix 500 Message Setup Screen appears. This screen is used to setup or monitor message parameters for “This Controller”, “Target Device”, and “Control Bits”. Descriptions of each of these sections follow.

Publication 1747-RM001G-EN-P - November 2008

Page 290

12-24

SLC Communication Instructions

Figure 12.2 “This Controller” Parameters

Modbus Command Modbus command is configured at rung setup. If a Channel configured for Modbus Master is selected in the Channel field of the Message Setup Screen, the following Modbus Command options will become available.

The controller supports eight Modbus commands. If the target device supports any of these Modbus command types, the controller should be

Publication 1747-RM001G-EN-P - November 2008