beautypg.com

Programming, Example 2 – Rockwell Automation 1761 MicroLogix 1000 Programmable Controllers User Manual

Page 261

background image

Programming

Using the Message Instruction

13–13

Example 2

Application example 2 involves a MicroLogix 1000 controller transmitting its first
input word to another MicroLogix 1000 controller. This is commonly referred to as
“change of state” or “report on exception” messaging. Using this type of logic
significantly reduces network traffic, which in turn significantly improves network
throughput.

MSG

READ/WRITE MESSAGE
Read/write

READ

Target Device

SLC500/ML1000

Control Block

N7:50

Control Block Length

7

END

2.0

] [

S:0

11

2.1

2.2

2.3

]/[

S:1

7

] [

S:0

11

]/[

N7:50

15

MOV

MOVE
Move

I:1.0

0

Dest

N7:10

0

] [

N7:50

13

] [

N7:50

12

( )

N7:50

15

This is the message control rung. The logic preceding the MSG instruction on this rung dictates when the MSG instruction
is processed. In this example, the MSG instruction will only be processed when the active protocol is DH-485 and when
there is no other communication. Once the MSG instruction is enabled, it locks itself into operation regardless of the
preceding logic on the rung.

This rung is used to setup the “report by exception” operation. This move command updates N7:10, by making it identical
to I:1.0. When the processor starts a new scan sequence (when rung 2.0 is scanned,) it updates (reads) the input image.
If an input has changed from the previous scan, the NEQ instruction will be true and MSG will be processed. The MSG
Enabled bit ensures that the MOV will not be processed until after the MSG is successfully completed. This minimizes the
chances that input changes are missed during MSG operation.

S:1

7

]/[

NEQ

Not Equal
Source A

I:1.0

0

Source B

N7:10

0

DH-485
Active

Comms
Active

MSG
Enabled

MSG Done

MSG Error

MSG Enabled

If the input status has
changed, enable the MSG

DH-485
Active

Comms
Active

This rung controls when the MSG instruction is unlatched or reset. The MSG instruction must be reset before it can
re-transmit new information. Either of the following two conditions will reset the MSG instruction: 1) when communication
to the target device have been completed successfully, or 2) when an error is detected in the communication sequence
(occurs after all retries have been exhausted). Using the error bit to reset the MSG is primarily used to stop the MSG
instruction from being totally locked out.

(EN)

(ER)

(DN)