Programming IEC 61131 Communication Blocks

C

Thread Starter

Clive Libotte

The references of the books are: R W Lewis, Programming Industrial Control Systems using
IEC (6)1131-3 (IEE, London,England,1998)and Karl-Heins John & Michael Tiegelkamp, IEC
61131-3 Programming Industrial Control Systems (Springer-Verlag,Berlin, followed by recent
date - I've returned the book). The first book gives only one example using a pair of
communication blocks, one send (USEND) and one recieve (URCV) with no examples on the other
ten application communication commands. I can't recall any examples in the second book. I
need to know how to map the communication blocks to a hardware PLC communications module,
and then write the code to produce the interface into the applications program. If anyone
can help,please contact me directly on [email protected] if the details are not of interest to other members. Thanks and Kind Regards. Clive Libotte.
 
F

Friedrich Haase

<pre>
Moin Mr. Libotte,
moin all,

Communication Blocks are not contained in IEC 61131-3 but in IEC 61131-5.

Here just the interfaces. If they look funny, try a fixed pitch font, (if they still look funny see the standard ;-)

Semantic of communication FB parameters
---------------------------------------
Generate remote variable address, Data which may be used at VAR_i inputs of the READ and WRITE function blocks
+--------------+
| REMOTE_VAR |
UINT ---| SCOPE |--- VAR_ADDR
STRING ---| SC_ID |
STRING ---| NAME |
(Note) ---| SUB |
+--------------+
NOTE The input SUB can be of type STRING, or ANY_INT.

Device verification
-------------------
+-------------+
| STATUS |
BOOL ---> REQ NDR |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
| STATUS |--- INT
| PHYS |--- INT
| LOG |--- INT
| LOCAL |--- ARRAY[0..7] OF WORD
+-------------+
+-------------+
| USTATUS |
BOOL ---| EN_R NDR |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
| STATUS |--- INT
| PHYS |--- INT
| LOG |--- INT
| LOCAL |--- ARRAY[0..7] OF WORD
+-------------+

Polled data acquisition
-----------------------
+--------------+
| READ |
BOOL ---> REQ NDR |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
(Note) ---| VAR_1 STATUS |--- INT
: | : RD_1 |--- ANY
(Note) ---| VAR_n : | :
| RD_n |--- ANY
+--------------+
NOTE The VAR_i inputs are extensible and can be of STRING type or of the VAR_ADDR data type.

Programmed data acquisition
---------------------------
+-------------+
| USEND |
BOOL ---> REQ DONE |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
STRING ---| R_ID STATUS |--- INT
ANY ---| SD_1 |
: | : |
ANY ---| SD_n |
+-------------+

+-------------+
| URCV |
BOOL ---| EN_R NDR |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
STRING ---| R_ID STATUS |--- INT
| RD_1 |--- ANY
| : | :
| RD_n |--- ANY
+-------------+

+-------------+
| BSEND |
BOOL ---> REQ DONE |--- BOOL
BOOL ---> R ERROR |--- BOOL
COMM_CHANNEL ---| ID STATUS |--- INT
STRING ---| R_ID |
ANY_INT ---| LEN |
ANY ---| SD_1 |
+-------------+

+-------------+
| BRCV |
BOOL ---| EN_R NDR |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
STRING ---| R_ID STATUS |--- INT
| LEN |--- ANY_INT
| RD_1 |--- ANY
+-------------+

Parametric control
------------------
+--------------+
| WRITE |
BOOL ---> REQ DONE |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
(Note) ---| VAR_1 STATUS |--- INT
ANY ---| SD_1 |
: | : |
(Note) ---| VAR_n |
ANY ---| SD_n |
+--------------+
NOTE The VAR_i inputs are extensible and can be of STRING type or of the VAR_ADDR data type.

Interlocked control
-------------------
+-------------+
| SEND |
BOOL ---> REQ NDR |--- BOOL
BOOL ---> R ERROR |--- BOOL
COMM_CHANNEL ---| ID STATUS |--- INT
STRING ---| R_ID RD_1 |--- ANY
ANY ---| SD_1 : | :
: | : RD_m |--- ANY
ANY ---| SD_n |
+-------------+

+-------------+
| RCV |
BOOL ---| EN_R NDR |--- BOOL
BOOL ---> RESP ERROR |--- BOOL
COMM_CHANNEL ---| ID STATUS |--- INT
STRING ---| R_ID RD_1 |--- ANY
ANY ---| SD_1 : | :
| : RD_n |--- ANY
ANY ---| SD_m |
+-------------+


Programmed alarm report
-----------------------
+--------------+
| NOTIFY |
BOOL ---| EVENT DONE |--- BOOL
COMM_CHANNEL ---| ID ERROR |--- BOOL
STRING ---| EV_ID STATUS |--- INT
INT ---| SEVERITY |
ANY ---| SD_1 |
: | : |
ANY ---| SD_n |
+--------------+

+-----------------+
| ALARM |
BOOL ---| EN_R DONE |--- BOOL
BOOL ---| EVENT ERROR |--- BOOL
COMM_CHANNEL ---| ID STATUS |--- INT
STRING ---| EV_ID ACK_UP |--- BOOL
INT ---| SEVERITY ACK_DN |--- BOOL
ANY ---| SD_1 |
: | : |
ANY ---| SD_n |
+-----------------+

Connection management
---------------------
+---------------+
| CONNECT |
BOOL ---| EN_C VALID |--- BOOL
(Note) ---| PARTNER ERROR |--- BOOL
| STATUS |--- INT
| ID |--- COMM_CHANNEL
+---------------+
NOTE The data type of the input PARTNER is implementer specific.


Best regards
Friedrich Haase


Dr. Friedrich Haase
Consulatant
Ing.-Buro Dr. F.Haase
[email protected]
</pre>
 
B

Bruce Durdle

IEC 61131-3 clause 2.5.2.3.5 covers communication function blocks. It reads:

"Standard communication function blocks for programmable controllers are defined in IEC 1131-5. These function blocks provide programmable
communications functionality such as device verification, polled data acquisition, programmed data acquisition, parametric control, interlocked
control, programmed alarm reporting, and connection management and protection."

So in fact there are no "standard communications function blocks" defined in IEC 61131-3, and Lewis in Chapter 12 refers to the "then draft"
IEC61131-5 standard in his discussion. Having had a look at my demo version of Concept, it would appear that this is one of the functions that is over tp the vendor to provide and is not set out in the standard./

Bruce.
 
R

Rob Hulsebos

The difficulty with IEC 61131-5 function blocks is that, although standardized, they are made for the wrong network (MAP) instead of a more commonly used industrial network. Profibus/FMS once made a mapping, but no vendor actually
implemented this (and also FMS is almost unknown today). Because the PLC/Open Group has ignored
the promotion of -5, nobody has paid much attention to it. Additionally, the command set is fairly limited. I ran into this when making a mapping from -5 to Modbus and to TCP/IP and to FMS, for a PLC vendor which doesn't exist anymore.
In order to be able to use all functionality of the underlying network, I had to add extra function-block inputs and outputs, thereby destroying portability (but who has ever ported a PLC-program from one vendor to another vendor's
equipment ?).

Rob Hulsebos
 
D

Drew Faulkner

> to be able to use all functionality of the underlying network, I had to
> add extra function-block inputs and outputs, thereby destroying
> portability (but who has ever ported a PLC-program from one vendor to
> another vendor's equipment ?).

Happens more often than you probably imagine - I've ported several applications between PLCs, usually when a plant has a rigid policy of only
having one PLC brand, and the supplier normally builds a machine with a different controller.

Andrew Faulkner.
Istari Systems Ltd.
 
Top