Topic: DMD0300

PEERLINK - Share Data w/PLCs


The Share Data w/PLCs (PEERLINK) instruction is used to join a data sharing network that consists of other Do-more controllers or DirectLOGIC PLC system using ECOM100 modules.

 

Each member of the data sharing network receives data from all of the other Do-more controllers and ECOM100s on that data sharing network. Each member can optionally send data to the other members of the data sharing network by electing to "publish" one or more blocks of PEERLINK (PL) memory.

 

Setting up a PEERLINK data sharing network does not require any of the traditional TCP/IP network configuration because the PEERLINK instruction uses TCP/IP broadcast packets to publish the blocks of data to the network. One caveat with the use of broadcast packets is that it does limit the scope of the shared data network to the local broadcast domain.

 

There can only be one PEERLINK instruction in a Do-more Designer project - and it must be in the $Main code-block. This means that a single Do-more controller can only be part of one data sharing network.

 

The PEERLINK instruction works with a pre-defined section of memory named PL. The PL memory contains 256 locations named PL0 through PL255. These 256 locations are divided into 16 blocks. Each of these 16 data blocks consists of 16-Bit unsigned registers. Theses blocks provide the local storage for the data that is sent and received over the data-sharing network.

 

In addition to the data blocks, PL memory contains entries for some BITs and WORDs that are available for use in a ladder program to monitor the runtime status of the PEERLINK network, and to optionally control the updates to individual PEERLINK blocks.

 

When the input logic to the PEERLINK instruction is ON (the instruction is enabled), at a rate of 10 times per second, the instruction will publish all of the blocks that it is configured to publish, and will process any PEERLINK data blocks that it receives. When the input logic is OFF, (the instruction is disabled), it DOES NOT publish any of its blocks and DOES NOT process any PEERLINK data blocks that it receives.

 


Publishing and Subscribing:

The Share Data w/PLCs (PEERLINK) instruction uses the verbs 'publishing' and 'subscribing' to describe how the controller's data is exchanged with other controllers and/or ECOM100s on the data sharing network.

 

Publishing is analogous to sending data, and is done only if the PEERLINK instruction is configured to 'publish' one or more of its own data blocks. If so configured, the Do-more controller will broadcast a packet that contains the data from the selected PL memory blocks. There are sixteen unique data blocks, and each data block can only be published by one controller. This means there can be a maximum of sixteen unique controllers configured to publish blocks of data. A single Do-more controller or ECOM100 can be configured so that it publishes none of the blocks, one block, some of the blocks, or even all 16 of the blocks.

 

Subscribing is analogous to receiving data, and is accomplished by 'subscribing to' the data blocks of all the other controllers on the data sharing network. Once the PEERLINK instruction is enabled, it listens to the network for PEERLINK broadcasts messages from other Do-more controllers or ECOM100s, and when it receives one, it takes the data from that packet and stores it in the designated block in the controller's local PL memory.

 

Subscribing to the shared data network is a passive operation in that it only receives data from the network. Simply placing a PEERLINK instruction in the project will cause it to subscribe to all of the data blocks from all of the controllers on the shared data network. Because the subscribing process always needs to run, the PEERLINK instruction must be placed in the $Main code-block (which is guaranteed to be running any time the Do-more controller is in RUN mode).

 

Unlike publishing in which you select which specific blocks to publish, you cannot subscribe to individual data blocks. Because subscribing is a passive operation there can be a virtually unlimited number of Do-more controllers and/or ECOM100s subscribing to the shared data blocks.

 

In the following graphic, the four Do-more systems are using PEERLINK instructions to participate in a data sharing network.

 

  • Node #1 is publishing Blocks 0 through 3, and subscribing to Blocks 4 through 15
     

  • Node #2 is publishing Blocks 4 through 7, and subscribing to Blocks 0 through 3 and Blocks 8 through 15
     

  • Node #3 is publishing Blocks 8 through 11, and subscribing to Blocks 0 through 7 and Blocks 12 through 15
     

  • Node #4 is publishing Blocks 12 through 15, and subscribing to Blocks 0 through 11

 

When the network is running all 16 blocks of PL memory in all four of the Do-more system will be synchronized.

 

 


Status Information:

The red triangle in the upper left corner indicates this is a Fully Asynchronous instruction.

 

The status information that is displayed in the PEERLINK instruction depends on the state of the input logic.

 

  • Offline - indicates the input logic is OFF, or the controller is in Program mode.

 

 

  • Subscribe Only - indicates the instruction is configured to only receive data, it is NOT publishing any data

 

 

  • Connecting ... - indicates the input logic is transitioning from OFF to ON, the PEERLINK instruction is gathering the status data for all the nodes which typically takes one to two seconds.

 

 

  • Disconnecting ... - indicates the input logic is transitioning from ON to OFF, the PEERLINK instruction is closing the connections to the other nodes, this typically takes one to two seconds.

 

 

Once the PEERLINK instruction is enabled and the network is functioning, each controller will be sending and receiving data at an approximate rate of ten packets per second, so the transfer rate of a normally operating network should be in the range of 9 to 11 transfers per second.

 

The status display uses the following background colors to quickly relate the quality (rate) of the communication between Controllers:

 

Green Background - indicates normal communication speed (receiving eight or more packets per second). In the example above Blocks 0, 1, 3, 5, 6 & 15 are communicating normally.
 

Yellow Background - indicates slower than normal communication rate, (receiving four to seven packets per second). In the example above Block 2 is communicating slowly.
 

Red Background - indicates very slow communication rate, (receiving fewer than three packets per second). In the example above Block 4 is communicating very slowly or not at all.
 

Normal Box Background (with Grayed Numeral) - indicates that no controller on the network is publishing that particular block. In the example above Blocks 7, 9, 10, 11, 12, 13, and 14 are not being published.

 

The PEERLINK instruction also uses combinations of the following attributes to display important status information for each of the blocks:

 

  • Bold Box Outline - indicates 'My Blocks', that is, the blocks that this controller is publishing. In the example above Block 0 is being published by this PC.
     

  • Green, Yellow, or Red background with Grayed Numeral - indicates that updates to the block have been inhibited, in the example above Blocks 3 and 5 have their updates inhibited. The inhibit bits for the blocks allow both the publisher and the subscribers to control updates to the controller's PEERLINK memory.
     

    • In the controller that is publishing the block, setting the inhibit bit prevents that block from being published.
       

    • In the controller that is subscribing to a block, setting the inhibit bit prevents that block from being updated in the controller.
       

  • Red Circle with a Slash - indicates a configuration error meaning there is a more than one controller configured to publish this block. In the example above Block 8 has a configuration error.

 


Map of PEERLINK (PL) Memory:

The following table contains entries for all of the BITs and WORDs that are available for use in a ladder program to monitor the runtime status of the PEERLINK network and to optionally control the updates to individual PEERLINK blocks.

 

Memory Location

Data Type

Name

Description

PL.B0Act

...

PL.B15Act

BIT

Block Active

  • ON means either the block is being published or the block is receiving data.
     

  • OFF can mean one of three things:
     

    • the block is not being published by any controller on the network
       

    • the block is being published but offline because the PEERLINK instruction is disabled
       

    • the block is being published but offline because the controller is in Program mode
       

PL.Active

WORD

Blocks Active

Contains the 16 Active bits in a single Word location.

 

 

 

 

 

PL.B0Err

...

PL.B15Err

BIT

Configuration Error

  • ON means the block has a configuration error, specifically, there is more than one controller with a PEERLINK instruction configured to publish the same block.
     

  • OFF means there is no configuration error (publishing conflict) for this block.
     

PL.Error

WORD

Connection Errors

Contains the 16 Error bits in a single Word location.
 

 

 

 

 

PL.B0Updated

...

PL.B15Updated

BIT

Block Updated

  • ON means that new data has arrived in one or more of locations in the designated data block during the last scan.
     

  • OFF means that the data in the designated block has not changed since the last scan.
     

PL.Updated

WORD

Blocks Updated

Contains the 16 Updated bits in a single Word location.
 

 

 

 

 

PL.B0Inh

...

PL.B15Inh

BIT

Block Inhibit

  • ON prevents the updating of the data block.
     

  • OFF allows updating of the data block.
     

PL.Inhibit

WORD

Blocks Inhibit

Contains the 16 Inhibit bits in a single Word location.
 

 

 

 

 

PL.MyBlocks

WORD

Publishing Blocks

A Word location that contains a bit for each of the 16 data blocks
 

  • a value of 1 in a bit location indicates the corresponding block is being published
     

  • a value of 0 in a bit location indicates the corresponding block is not being published
     

PL.B0Rate

...

PL.B15Rate

WORD

Transfer Rate

This range of registers store the number of data transfers per second for each corresponding data block.

 

PL.Enabled

BIT

Instruction Status

  • ON means the PEERLINK instruction is enabled.
     

  • OFF means the PEERLINK instruction is disabled.
     

 

 

 

 

PL0 - PL15

WORD

Data Block 0

This range of register locations is used to store the data that is sent from the local controller, and to store the data received from the other controllers on the shared data network.

PL16 - PL31

WORD

Data Block 1

PL32 - PL47

WORD

Data Block 2

PL48 - PL63

WORD

Data Block 3

PL64 - PL79

WORD

Data Block 4

PL80 - PL95

WORD

Data Block 5

PL96 - PL111

WORD

Data Block 6

PL112 - PL127

WORD

Data Block 7

PL128 - PL143

WORD

Data Block 8

PL144 - PL159

WORD

Data Block 9

PL160 - PL175

WORD

Data Block 10

PL176 - PL191

WORD

Data Block 11

PL192 - PL207

WORD

Data Block 12

PL208 - PL223

WORD

Data Block 13

PL224 - PL239

WORD

Data Block 14

PL240 - PL255

WORD

Data Block 15

 


Data View Display Formats

Note: These formats are for display purposes only, the PEERLINK variables cannot be edited when displayed using any of the formats.

 

Short multi-line

 

Long multi-line

 

Short single line

 

Long single line

 

 

 

 

 

 

 


See Also:

 


Rung Example: