Documente Academic
Documente Profesional
Documente Cultură
2
Communication
Block Library
09/2005
33002527.03
2
Table of Contents
3
Part II Extended. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4
Chapter 11 MBP_MSTR: Modbus Plus Master . . . . . . . . . . . . . . . . . . . . . . 87
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Function mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Parameter description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Write data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Read data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Read local statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Clear local statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Write Global Data (Peer Cop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Read Global Data (Peer Cop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Get remote statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Clear remote statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Peer cop health . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Optional module reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Read CTE (Config extension table). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Write CTE (Config extension table). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Peer Cop Communications Health Status. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Modbus Plus network statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
TCP/IP Ethernet Network Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Modbus Plus and SY/MAX Ethernet Error Codes . . . . . . . . . . . . . . . . . . . . . . . 122
SY/MAX-specific error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
TCP/IP Ethernet error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
CTE error codes for SY/MAX and TCP/IP Ethernet . . . . . . . . . . . . . . . . . . . . . 129
5
Chapter 15 RCV_TLG: Receiving telegrams . . . . . . . . . . . . . . . . . . . . . . . 153
At a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Example of how to receive a telegram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6
Chapter 23 TCP_IP_ADDR: TCP/IP Address . . . . . . . . . . . . . . . . . . . . . . . 211
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
7
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
8
About the Book
At a Glance
Document Scope This document describes the functions and function blocks of the Communication
library.
This document is valid for Unity Pro Version 2.2.
Validity Note The data and illustrations found in this document are not binding. We reserve the
right to modify our products in line with our policy of continuous product
development. The information in this document is subject to change without notice
and should not be construed as a commitment by Schneider Electric.
33002527 9
About the Book
Product Related Schneider Electric assumes no responsibility for any errors that may appear in this
Warnings document. If you have any suggestions for improvements or amendments or have
found errors in this publication, please notify us.
No part of this document may be reproduced in any form or by any means, electronic
or mechanical, including photocopying, without express written permission of
Schneider Electric.
All pertinent state, regional, and local safety regulations must be observed when
installing and using this product. For reasons of safety and to ensure compliance
with documented system data, only the manufacturer should perform repairs to
components.
When controllers are used for applications with technical safety requirements,
please follow the relevant instructions.
Failure to use Schneider Electric software or approved software with our hardware
products may result in injury, harm, or improper operating results.
Failure to observe this product related warning can result in injury or equipment
damage.
User Comments We welcome your comments about this document. You can reach us by e-mail at
techpub@schneider-electric.com
10 33002527
General Information
I
Introduction
Overview This section contains general information about the communication library.
33002527 11
General Information
12 33002527
Block types and their applications
1
Introduction
Overview This chapter describes the different block types and their applications.
33002527 13
Block types and their applications
Block types
Block types Different block types are used in Unity Pro. The general term for all block types is
FFB.
There are the following types of block:
l Elementary Function (EF)
l Elementary Function Block (EFB)
l Derived Function Block (DFB)
l Procedure
Elementary Elementary functions (EF) have no internal status.. If the input values are the same,
Function the value at the output is the same for all executions of the function, e.g. the addition
of two values gives the same result at every execution.
An elementary function is represented in the graphical languages (FDB and LD) as
a block frame with inputs and an output. The inputs are always represented on the
left and the outputs always on the right of the frame The name of the function, i.e.
the function type, is shown in the center of the frame.
The number of inputs can be increased with some elementary functions.
Elementary Elementary function blocks (EFB) have an internal status. If the inputs have the
function block same values, the value on the output can have another value during the individual
executions. For example, with a counter, the value on the output is incremented.
An elementary function block is represented in the graphical languages (FDB and
LD) as a block frame with inputs and outputs. The inputs are always represented on
the left and the outputs always on the right of the frame The name of the function
block, i.e. the function block type, is shown in the center of the frame. The instance
name is displayed above the frame.
Derived function Derived function blocks (DFBs) have the same properties as elementary function
block blocks. They are created by the user in the programming languages FBD, LD, IL
and/or ST.
14 33002527
Block types and their applications
FFB Structure
Structure Each FFB is made up of an operation (name of the FFB), the operands required for
the operation (formal and actual parameters) and an instance name for elementary/
derived function blocks.
Call of a function block in the FBD programming language:
Instance Name Operation Operand
(FFB name)
Formal Actual
parameter parameter
MY_TON
TON
ENABLE EN ENO ERROR
EXAMP IN Q OUT
TIME1 PT ET TIME2
Operands
Operation The operation determines which function is to be executed with the FFB, e.g. shift
register, conversion operations.
33002527 15
Block types and their applications
Operand The operand specifies what the operation is to be executed with. With FFBs, this
consists of formal and actual parameters.
Formal/actual Inputs and outputs are required to transfer values to or from an FFB. These are
parameters called formal parameters.
Objects are linked to formal parameters; these objects contain the current process
states. They are called actual parameters.
At program runtime, the values from the process are transferred to the FFB via the
actual parameters and then output again after processing.
The data type of the actual parameters must match the data type of the input/output
(formal parameters). The only exceptions are generic inputs/outputs whose data
type is determined by the actual parameter. If all actual parameters consist of
literals, a suitable data type is selected for the function block.
FFB Call in IL/ST In text languages IL and ST, FFBs can be called in formal and in informal form.
Details can be found in the Reference manual.
Example of a formal function call:
out:=LIMIT (MN:=0, IN:=var1, MX:=5) ;
Example of an informal function call:
out:=LIMIT (0, var1, 5) ;
Note: Take note that the use of EN and ENO is only possible for formal calls.
16 33002527
Block types and their applications
VAR_IN_OUT FFBs are often used to read a variable at an input (input variables), to process it and
variable to output the altered values of the same variable (output variables).
This special type of input/output variable is also called a VAR_IN_OUT variable.
The input and output variable are linked in the graphic languages (FBD and LD)
using a line showing that they belong together.
Function block with VAR_IN_OUT variable in FBD:
MY_EXAMP1
EXAMP1
Input1 IN1 OUT1 Output1
Input2 IN2 OUT2 Output2
Comb_IN_OUT IO1 IO1 Comb_IN_OUT
33002527 17
Block types and their applications
EN and ENO
Description An EN input and an ENO output can be configured for all FFBs.
If the value of EN is "0" when the FFB is called up, the algorithms defined by the FFB
are not executed and ENO is set to "0".
If the value of EN is "1" when the FFB is called up, the algorithms defined by the FFB
are executed. After the algorithms have been executed successfully, the value of
ENO is set to "1". If an error occurs when executing these algorithms, ENO is set to
"0".
If ENO is set to "0" (caused by EN=0 or an error during execution):
l Function blocks
l EN/ENO handling with function blocks that (only) have one link as an output
parameter:
Function_block_1 Function_block_2
EN ENO EN ENO
IN1 OUT IN1 OUT
IN2 IN2
18 33002527
Block types and their applications
l Functions/Procedures
As defined in IEC61131-3, the outputs from deactivated functions (EN-input set
to "0") is undefined. (The same applies to procedures.)
Here nevertheless an explanation of the output statuses in this case:
l EN/ENO handling with function/procedure blocks that (only) have one link as
an output parameter:
Function/Procedure_1 Function/Procedure_2
EN ENO EN ENO
IN1 OUT IN1 OUT
IN2 IN2
Conditional/ "Unconditional" or "conditional" calls are possible with each FFB. The condition is
Unconditional realized by pre-linking the input EN.
FFB Call l EN connected
conditional calls (the FFB is only processed if EN = 1)
l EN shown, hidden, and marked TRUE, or shown and not occupied
unconditional calls (FFB is always processed)
Note for IL and The use of EN and ENO is only possible in the text languages for a formal FFB call,
ST e.g.
MY_BLOCK (EN:=enable, IN1:=var1, IN2:=var2,
ENO=>error, OUT1=>result1, OUT2=>result2);
Assigning the variables to ENO must be done with the operator =>.
With an informal call, EN and ENO cannot be used.
33002527 19
Block types and their applications
20 33002527
Availability of the modules on the
various hardware platforms
2
Availability of the block on the various hardware platforms
Introduction Not all blocks are available on all hardware platforms. The modules that are
available on hardware platform can be found in the following tables.
Note: The functions, procedures and function blocks in this library are not defined
in IEC 61131-3.
33002527 21
Availability of the modules
Legend:
+ Yes
- No
22 33002527
Operation of the communication
EFs
3
At a Glance
Subject of this This chapter describes the operation and management of the communication
Chapter functions.
33002527 23
Operation of the communication EFs
24 33002527
Operation of the communication EFs
At a Glance
Subject of this This section describes the operation and management of the communication
Section functions for Premium and Atrium PLCs.
33002527 25
Operation of the communication EFs
Rules for using the communication functions of Premium and Atrium PLCs
At a Glance The communication functions used with Premium and Atrium PLCs have certain
unique characteristics which set them apart from the other functions of the library.
This documentation complies with the documentation charter concerning the
function library, but also contains additional information relating to the particularities
of the communication specific-application.
Located All communication functions that do not require programming in the server PLC
variables (READ_VAR, WRITE_VAR, etc.) provide access to the located variables of remote
PLCs. Unlocated variables are not accessible.
Apart from the first example of the WRITE_VAR (See Example of how to
write words on a network, p. 247) function, all of the other examples are
made using direct addressing variables (use of addresses, located variables).
Programming The most concise programming language for creating communication applications
language is Structured Text language (ST). All of the examples, except that of the READ_VAR
(See READ_VAR: Reading variables, p. 171) function, are therefore
written in ST.
26 33002527
Operation of the communication EFs
At a Glance These functions allow one device to communicate with another. Certain of these are
common to several types of communication channels, others may be specific to a
single communication channel.
33002527 27
Operation of the communication EFs
28 33002527
Operation of the communication EFs
33002527 29
Operation of the communication EFs
30 33002527
Operation of the communication EFs
Destination address
33002527 31
Operation of the communication EFs
At a Glance Management parameters are grouped together in the form of an array of four
integers. The values contained in this array can be used to manage communication
functions.
Note: The first two words are managed by the system. You are responsible for
managing the last two words.
Structure The following table describes the structure of the data in the communication
management table:
Order of the word Most significant byte Least significant byte
Data managed by 1 Exchange number Activity bit
the system 2 operation report (See communication report
Operation Report, p. 36) (See Communication
Report, p. 35)
Data managed by 3 Timeout (See Timeout, p. 38)
the user 4 Length (See Length, p. 38)
Activity bit This bit indicates the execution status of the communication function.
It is set to 1 when launched and returns to 0 when its execution is complete.
This is the first bit of the first element of the table.
Example: if the management table has been declared as follows:
Tab_Gest ARRAY [1..4] OF INT, the activity bit is the bit with the notation
Tab_Gest[1].0.
Note: the notation previously used requires configuration of the project properties
in such a way as to authorize the extraction of bits on integer types. If this is not the
case Tab_Gest[1].0 cannot be accessed in this manner.
32 33002527
Operation of the communication EFs
33002527 33
Operation of the communication EFs
At a Glance Communication and operation reports are part of the management parameters.
34 33002527
Operation of the communication EFs
Communication This report is common to all functions. It is significant when the value of the activity
Report bit switches from 1 to 0.
The reports with a value between 16#01 and 16#FE concern errors detected by the
processor that executed the function.
The different values of this report are indicated in the following table:
Value Communication report (least significant byte)
16#00 Correct exchange
16#01 Exchange stop on timeout
16#02 Exchange stop on user request (CANCEL)
16#03 Incorrect address format
16#04 Incorrect destination address
16#05 Incorrect management parameter format
16#06 Incorrect specific parameters
16#07 Problem in sending to the destination
16#08 Reserved
16#09 Insufficient receive buffer size
16#0A Insufficient send buffer size
16#0B No processor system resources
16#0C Incorrect exchange number
16#0D No telegram received
16#0E Incorrect length
16#0F Telegram service not configured
16#10 Network module missing
16#11 Request missing
16#12 Application server already active
16#13 UNI-TE V2 transaction number incorrect
16#FF Message refused
Note: The function can detect a parameter error before activating the exchange. In
this case the activity bit remains at 0, and the report is initialized with values
corresponding to the error.
33002527 35
Operation of the communication EFs
Operation Report This report byte is specific to each function, and specifies the result of the operation
on the remote application.
It is significant only if the communication report has the following values:
l 16#00 (correct exchange),
l 16#FF (message refused).
If the value of the communication report is 16#00, the operation report will have the
following values:
Value Operation report (most significant byte)
16#00 Positive result
16#01 Request not processed
16#02 Incorrect response
16#03 Reserved
36 33002527
Operation of the communication EFs
If the value of the communication report is 16#FF, the operation report will have the
following values:
Value Operation report (most significant byte)
16#01 No resources towards the processor
16#02 No line resources
16#03 No device or device without resources (*)
16#04 Line error
16#05 Length error
16#06 Faulty communication channel
16#07 Addressing error
16#08 Application error
16#0B No system resources
16#0C Communication function not active
16#0D Destination missing
16#0F Intra-station routing problem or channel not configured
16#11 Address format not managed
16#12 No destination resources
16#14 Non-operational connection (example: Ethernet TCP/IP)
16#15 No resource on the local channel
16#16 Access not authorized (example: Ethernet TCP/IP)
16#17 Inconsistent network configuration (example: Ethernet TCP/IP)
16#18 Connection temporarily unavailable
16#21 Application server stopped
16#30 Transmission error
Legend:
(*) Code only managed by PCMCIA cards: TSX FPP20 and TSX FPP10
33002527 37
Operation of the communication EFs
Length The length parameter is used both to specify the number of characters (in bytes) to
be sent during transmission, but also to store the number of characters (in bytes)
received after reception of a message.
Before certain communication functions are launched (SEND_REQ, DATA_EXCH,
PRINT_CHAR, SEND_TLG), it is compulsory for some of these functions, and
advisable for others, to update the length parameter.
Note: With the PRINT_CHAR function, for example, if another function in the
application is using the same report table where the number of bytes to send is
different to the previous function, it is imperative to initialize the length parameter
with the new number of bytes to transmit. Otherwise it keeps the same number of
bytes sent by the previous function.
Timeout Timeout determines the maximum waiting time for the response. The time base for
this parameter is 100 ms (the value 0 corresponds to an infinite waiting value).
When the timeout elapses, the exchange is ended with an error report. Also, the
system does not accept any responses after the end of the timeout.
Example
Activity bit = 0
Stop of timeout
Activity bit = 0 Update of the report
report = 1
38 33002527
Operation of the communication EFs
Server function
At a Glance The server function can be used to respond to requests from client devices.
The TSX 57 35• and PCX 57 35• processors provide two request servers:
l a main server (recommended for requests of less than 256 bytes),
l an auxiliary server (recommended for requests of up to 1024 bytes),
Both of these servers can be activated simultaneously.
Illustration The following diagram shows the requests sent to the servers in the PLC cycle:
Inputs
Main server
(UNI-TE server)
Auxiliary server
(asynchronous server)
Outputs
33002527 39
Operation of the communication EFs
Main server This server corresponds to port 0 (UNI-TE server). It is activated at the start of the
PLC's MAST cycle.
The response time of the client PLC depends on the cycle time of the server PLC.
This can be used to process up to 4 simultaneous requests per PLC cycle.
All UNI-TE requests are supported. The size of the request must be less than 256
bytes.
This entity can be addressed at the topological address SYS or
{network.station}SYS.
Auxiliary server This server corresponds to port 7 (asynchronous server). It is activated only for
periodical tasks at the end of the PLC cycle, after the MAST task has been
processed whilst awaiting the start of the next cycle.
The start of the next, higher priority cycle could interrupt a request in progress.
Access to this server is therefore reserved for applications requiring no consistency
in their read/write data.
The application response time will essentially depend on the PLC cycle time. The
size of the request may be up to 1024 bytes. It cannot be accessed from a
communication function; the server processes object (bit or word) READ/WRITE
requests, etc.
40 33002527
Extended
II
Introduction
Overview This section describes the elementary functions and elementary function blocks of
the Extended family.
33002527 41
Extended
42 33002527
ADDR: Address conversion
4
Description
Function The ADDR function is used to convert a character string into an address that can be
Description used directly by communication functions.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
ADDR
Addr_String IN OUT Addr_Array
LD Representation:
representation
ADDR
EN ENO
IL representation Representation:
LD Addr_String
ADDR
ST Addr_Array
33002527 43
ADDR
ST Representation:
representation Addr_Array := ADDR(Addr_String);
44 33002527
CANCEL: Stopping an exchange
in progress
5
At a Glance
33002527 45
CANCEL
Description
Note: the execution of this function is synchronous with the execution of the PLC
program (the communication function is stopped in the PLC cycle during which the
CANCEL function was executed).
FBD Representation:
representation
CANCEL
Exchange_num NUM CR Report
Ladder Representation:
representation
CANCEL
EN ENO
IL representation Representation:
LD Exchange_Num
CANCEL
ST Report
ST Representation:
representation CANCEL(Exchange_Num, Report);
46 33002527
CANCEL
33002527 47
CANCEL
At a Glance This example covers canceling an exchange carried out with the OUT_IN_CHAR
function.
When the exchange is launched, a unique number is assigned to it. This number
remains valid until the end of the exchange.
The CANCEL function uses this number to interrupt the exchange to which it is
assigned.
OUT_IN_CHAR(ADDR(‘{20.5}0.0.0.SYS’),1,Str_Out,Str_In,%MW170:
4);
END_IF;
48 33002527
CREAD_REG: Continuous
register reading
6
Overview
33002527 49
CREAD_REG
Description
Function This function block reads a register area continuously. It reads data from an
description addressed node via Modbus Plus, TCP/IP Ethernet or SY/MAX Ethernet.
EN and ENO can be configured as additional parameters.
Note: When programming a CREAD_REG function, you must be familiar with the
routing procedures used by your network. Modbus Plus routing path structures are
described in detail in the Modbus Plus Network Planning and Installation Guide. If
TCP/IP or SY/MAX Ethernet routing is implemented, standard Ethernet IP router
products must be used. A full description of the TCP/IP routing is provided in the
Quantum with Unity ProTCP/IP Configuration User Guide.
Note: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Representation Representation:
in FBD CREAD_REG_Instance
CREAD_REG
OffsetAddress SLAVEREG
NumberOfRegisters NO_REG REG_READ RegisterToRead
DataStructure ADDRFLD STATUS ErrorCode
Representation Representation:
in LD CREAD_REG_Instance
CREAD_REG
EN ENO
OffsetAddress SLAVEREG
50 33002527
CREAD_REG
Representation Representation:
in IL CAL CREAD_REG_Instance (SLAVEREG:=OffsetAddress,
NO_REG:=NumberOfRegisters, ADDRFLD:=DataStructure,
REG_READ=>RegisterToRead, STATUS=>ErrorCode)
Representation Representation:
in ST CREAD_REG_Instance (SLAVEREG:=OffsetAddress,
NO_REG:=NumberOfRegisters, ADDRFLD:=DataStructure,
REG_READ=>RegisterToRead, STATUS=>ErrorCode) ;
Runtime error For a list of all block error codes and values, see Extended, p. 254.
33002527 51
CREAD_REG
52 33002527
CREAD_REG
33002527 53
CREAD_REG
Function mode
Function mode Although a large number of CREAD_REG function blocks can be programmed; only
of the four read operations may be active at the same time. In this case it is irrelevant
CREAD_REG whether they are the result of this function block or others (e.g. MBP_MSTR, MSTR,
block READ_REG). All function blocks use one data transaction path and require multiple
cycles to complete a job.
Note: A TCP/IP communication between a Quantum PLC (NOE 211 00) and a
Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible,
when only one read or write job is carried out in every cycle. If several jobs are sent
per PLC cycle, the communication stops without generating an error message in
the status register of the function block.
All routing information is contained in the WordArr5 data structure of the ADDRFLD
input. The type function block assigned to this input is defined by the network used.
Please use:
l Modbus Plus for function block ModbusP_ADDR
l TCP/IP Ethernet for function block TCP_IP_ADDR
l SY/MAX Ethernet for function block SYMAX_IP_ADDR
Note: The WordArr5 data structure can also be used with constants.
Note: This function block puts a heavy load on the network; therefore the network
load must be carefully monitored. If the network load is too high, the program logic
should be reorganized in order to work with the READ_REG function block, a
variation of this function block that does not operate in a continuous mode, but
under command control.
54 33002527
CREAD_REG
Parameter description
SLAVEREG Start of the area in the addressed slave from which the source data is read. The
source area always resides within the %MW register area.
NO_REG Number of addresses to be read from the addressed slave (1 ... 100).
The parameter can be entered as an address, located variable or unlocated
variable.
REG_READ An ARRAY that is the same size as the requested transmission must be agreed upon
(≥ NO_REG) for this parameter. The name of this array is defined as a parameter. If
the array is defined too small, then only the amount of data is transmitted that is
present in the array.
The parameter must be defined as a located variable.
STATUS If an error occurs while the function is being executed, an error code remains at this
output for one cycle.
Error code, see
l Modbus Plus and SY/MAX Ethernet Error Codes, p. 122
l SY/MAX-specific error codes, p. 124
l TCP/IP Ethernet error codes, p. 126
The parameter can be entered as an address, located variable or unlocated
variable.
33002527 55
CREAD_REG
56 33002527
CWRITE_REG: Continuous
register writing
7
Overview
33002527 57
CWRITE_REG
Description
Function This function block writes continuously to the register area. It transfers data from the
description PLC via Modbus Plus, TCP/IP Ethernet or SY/MAX Ethernet to an addressed slave.
EN and ENO can be configured as additional parameters.
Note: You must be familiar with the routing procedures of the network when
programming a CWRITE_REG function. Modbus Plus routing path structures are
described in detail in the Modbus Plus Network Planning and Installation Guide. If
TCP/IP or SY/MAX Ethernet routing is implemented, standard Ethernet IP router
products must be used. A full description of the TCP/IP routing is provided in the
Quantum with Unity ProTCP/IP Configuration User Guide.
Note: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Representation Representation:
in FBD CWRITE_REG_Instance
CWRITE_REG
OffsetAddress SLAVEREG
NumberOfRegisters NO_REG
SourceDataArea REG_WRIT
DataStructure ADDRFLD STATUS ErrorCode
58 33002527
CWRITE_REG
Representation Representation:
in LD CWRITE_REG_Instance
CWRITE_REG
EN ENO
OffsetAddress SLAVEREG
NumberOfRegisters NO_REG
SourceDataArea REG_WRIT
Representation Representation:
in IL CAL CWRITE_REG_Instance (SLAVEREG:=OffsetAddress,
NO_REG:=NumberOfRegisters, REG_WRIT:=SourceDataArea,
ADDRFLD:=DataStructure, STATUS=>ErrorCode)
Representation Representation:
in ST CWRITE_REG_Instance ( SLAVEREG:=OffsetAddress,
NO_REG:=NumberOfRegisters, REG_WRIT:=SourceDataArea,
ADDRFLD:=DataStructure, STATUS=>ErrorCode) ;
33002527 59
CWRITE_REG
Runtime error For a list of all block error codes and values, see Extended, p. 254.
60 33002527
CWRITE_REG
33002527 61
CWRITE_REG
62 33002527
CWRITE_REG
Function mode
Function mode Although a large number of CWRITE_REG function blocks can be programmed, only
of the four write operations may be active at the same time. In this case it is irrelevant
CWRITE_REG whether they are the result of this function block or others (e.g. MBP_MSTR, MSTR,
block WRITE_REG). All function blocks use one data transaction path and require multiple
cycles to complete a job.
If several CWRITE_REG function blocks are used within an application, they must at
least differ in the values of their NO_REG or REG_WRIT parameters.
Note: A TCP/IP communication between a Quantum PLC (NOE 211 00) and a
Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible,
when only one read or write job is carried out in every cycle. If several jobs are sent
per PLC cycle, the communication stops without generating an error message in
the status register of the function block.
All routing information is contained in the WordArr5 data structure of the ADDRFLD
input. The type function block assigned to this input is defined by the network used.
Please use:
l Modbus Plus for function block ModbusP_ADDR
l TCP/IP Ethernet for function block TCP_IP_ADDR
l SY/MAX Ethernet for function block SYMAX_IP_ADDR
Note: The WordArr5 data structure can also be used with constants.
Note: This function block puts a heavy load on the network; therefore the network
load must be carefully monitored. If the network load is too high, the program logic
should be reorganized, in order to work with the WRITE_REG function block, a
variation of this function block that does not operate in a continuous mode, but
under command control.
33002527 63
CWRITE_REG
Parameter description
SLAVEREG Start of the area in the addressed slave to which the source data is written. The
source area always resides within the %MW address area.
NO_REG Number of registers to be written to slave processor (1 ... 100). The parameter can
be entered as an address, located variable, unlocated variable or literal.
STATUS If an error occurs while the function is being executed, an error code remains at this
output for one cycle.
Error code, see
l Modbus Plus and SY/MAX Ethernet Error Codes, p. 122
l SY/MAX-specific error codes, p. 124
l TCP/IP Ethernet error codes, p. 126
The parameter can be entered as an address, located variable or unlocated
variable.
REG_WRIT An ARRAY that is the same size as the requested transmission must be agreed upon
(≥ NO_REG) for this parameter. The name of this array is defined as a parameter. If
the array is defined too small, then only the amount of data is transmitted that is
present in the array.
The parameter must be defined as a located variable.
64 33002527
DATA_EXCH: Exchanging data
between applications
8
At a Glance
33002527 65
DATA_EXCH
Description
Function The DATA_EXCH function is used to perform data transfers from one application to
Description another:
l data transmission,
l data reception,
l data transmission then reception.
Note: this function can be used to send UNI-TE or Modbus requests to another
device. For this, it is necessary to make sure the data sent constitutes the entire
frame required by the protocol being used.
FBD Representation:
representation
DATA_EXCH
Address ADR RECP Received_Data
Action TYPE
Data_to_Send EMIS
Management_Param GEST GEST Management_Param
LD Representation:
representation
DATA_EXCH
EN ENO
Action TYPE
Data_to_Send EMIS
66 33002527
DATA_EXCH
IL representation Representation:
LD Address
DATA_EXCH Action, Data_to_Send, Management_Param,
Received_Data
ST Representation:
representation DATA_EXCH(Address, Action, Data_to_Send, Management_Param,
Received_Data);
33002527 67
DATA_EXCH
68 33002527
DATA_EXCH
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an assisted entry screen of the function:
DATA_EXCH
Parameters
Address: ... ?
Mode: ... Exchange
Data to Send: ...
Data to Receive: ...
Report: ...
Possible types: Array of Constant Int, Array of Int (n>=6)
Address ADDR(‘..’)
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
Note: if you use the entry field instead of the menu, you can enter a variable of the
INT type, either located or not.
33002527 69
DATA_EXCH
Data to send The variable for transmission is an integer array. This array can be located or not.
Data to be The reception zone is an array of integers, that can be located or not. The size of
received this array depends on the number of objects to be received.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
70 33002527
DATA_EXCH
At a Glance Let us suppose we want two PLC stations to communicate on a Fipway network.
Station 1 must send the data (20 bytes located in %MW70:10) to station 2, which
receives it in a table located in %MW80:10. Each PLC has a management table
starting with the address %MW90.
For station 1, the word %MW93 must contain the length of the data to be sent, or 20
(10 words to be sent).
For station 2, the word %MW93 is set to 0 before the exchange, in order to see the
number of characters received at the end of the exchange.
The DATA_EXCH function requires both PLCs to be programmed, one to send, the
other to receive.
Fipway
33002527 71
DATA_EXCH
Request parameters:
Parameters Description
ADDR(‘{20.2}APP’) l 20 : network
l 2 : station
l APP: application of station 2
2 Type of communication: transmission
%MW70:10 Data to send
%MW90:4 Management table
%MW80:1 Reception zone for responses. Here, there is no data to receive,
but a word must nevertheless be reserved (compulsory).
72 33002527
DATA_EXCH
Request parameters:
Parameters Description
ADDR(‘{20.1}APP’) l 20 : network
l 1 : station
l APP: application of station 1
3 Type of communication: reception
%MW70:1 Data to send. Here there is none, but at least one word must be
reserved.
%MW90:4 Management table
%MW80:10 Reception zone: 10 words are provided from station 1.
33002527 73
DATA_EXCH
74 33002527
INPUT_BYTE: Receiving
character strings
9
Description
Function INPUT_BYTE is used to send an array of bytes read request to a character mode
Description communication module. The message received is stored in an array of bytes.
This function is used to receive up to 4 Kbytes (120 bytes for the terminal port).
Two exclusive possibilities are available:
l read a number of bytess: no condition should be configured,
l read a message: a stop condition should be configured in the configuration
screen.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
INPUT_BYTE
Address ADR RECP Received_Data
Raz RAZ
Buffer_Length NB
Management_Param GEST GEST Management_Param
33002527 75
INPUT_BYTE
LD Representation:
representation
INPUT_BYTE
EN ENO
Raz RAZ
Buffer_Length NB
IL representation Representation:
LD Address
INPUT_BYTE Reset, Buffer_Length, Management_Param,
Received_Data
ST Representation:
representation INPUT_BYTE(Address, Reset, Buffer_Length, Management_Param,
Received_Data);
76 33002527
INPUT_BYTE
33002527 77
INPUT_BYTE
Programming When several INPUT_BYTE are launched simultaneously, the Reset parameter
rules must be set to 0 (module's receive memory not reset).
A request may be made to reset the module's memory for the next message in order
to avoid receiving old data.
When the Reset parameter is set to 1, the INPUT_BYTE function must be launched
before sending the data.
It takes several PLC cycles to receive an arry of bytes of more than 240 bytes. It is
therefore important to make sure that the management data is not modified during
the processing of the function. The system receives the string consistently over
several fragments.
78 33002527
INPUT_CHAR: Receiving
character strings
10
At a Glance
33002527 79
INPUT_CHAR
Description
Function The INPUT_CHAR function is used to send a character string read request to a
Description character mode communication module (await reception of character strings). The
message received is stored in a character string.
This function is used to receive up to 4 Kbytes (120 bytes for the terminal port).
Two exclusive possibilities are available:
l read a number of characters: no condition should be configured,
l read a message: a stop condition should be configured in the configuration
screen.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
INPUT_CHAR
Address ADR RECP Received_Data
Raz RAZ
String_Length NB
Management_Param GEST GEST Management_Param
LD Representation:
representation
INPUT_CHAR
EN ENO
Raz RAZ
String_Length NB
80 33002527
INPUT_CHAR
IL representation Representation:
LD Address
INPUT_CHAR Reset, String_Length, Management_Param,
Received_Data
ST Representation:
representation INPUT_CHAR(Address, Reset, String_Length, Management_Param,
Received_Data);
33002527 81
INPUT_CHAR
Programming When several INPUT_CHAR are launched simultaneously, the Reset parameter
rules must be set to 0 (module's receive memory not reset).
A request may be made to reset the module's memory for the next message in order
to avoid receiving old data.
When the Reset parameter is set to 1, the INPUT_CHAR function must be launched
before sending the data.
It takes several PLC cycles to receive a character string of more than 240 bytes (the
string is fragmented). It is therefore important to make sure that the management
data is not modified during the processing of the function. The system receives the
string consistently over several fragments.
82 33002527
INPUT_CHAR
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
INPUT_CHAR
Parameters
Address: ...
?
Reset module memory: ... Yes No
Type of read
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
33002527 83
INPUT_CHAR
Type of read The two radio buttons select the mode of operation and this choice must be made
according to the configuration of the channel used.
Number of You can enter an integer, in the form of a variable or an immediate value.
characters
String to be The reception zone is a variable of theSTRING type. The size of this variable is a
received function of the number of characters to be received. This variable must be declared
before being used in this screen.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
84 33002527
INPUT_CHAR
At a Glance From a station with an address of 1 on Fipway network 20, we would like to read a
character string sent by a video terminal (screen and keyboard) connected to the
TER port of the PLC with a network address of 20, station 5.
This character string is stored in the Str_1 variable, the management table of the
communication function being %MW110:4.
Premium Micro
{20.5}
Fipway
{20.1}
33002527 85
INPUT_CHAR
Request parameters:
Parameters Description
ADDR(‘{20.5}0.0.0.SYS’) l {20.5} : network 20, station 5
l 0 : rack
l 0 : module
l 0 : channel 0
l SYS: system address (terminal port)
1 Reset
0 Read the entire character string
%MW110:4 Management table
Str_1 Variable of type STRING that is to receive the message
86 33002527
MBP_MSTR: Modbus Plus Master
11
Overview
33002527 87
MBP_MSTR
88 33002527
MBP_MSTR
Description
Note: The function block can only be used on the program level, i.e. not in Derived
Function Blocks (DFBs).
Note: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Note: You must be familiar with the routing procedures of your network when
programming an MSTR function. Modbus Plus routing path structures are described
in detail in the Modbus Plus Network Planning and Installation Guide. If TCP/IP or
SY/MAX Ethernet routing is implemented, standard Ethernet IP router products
must be used. A full description of the TCP/IP routing is provided in the Quantum
with Unity Pro TCP/IP Configuration User Guide.
33002527 89
MBP_MSTR
Representation Representation:
in FBD
MBP_MSTR_Instance
MBP_MSTR
EnableMSTRFunction ENABLE ACTIVE OperationActiv
CancelActivMSTROperation ABORT ERROR FaultyOperation
SUCCESS OperationSuccessful
CONTROL ControlBlock
DATABUF DataField
Representation Representation:
in LD
MBP_MSTR_Instance
MBP_MSTR
EN ENO
EnableMSTRFunction OperationActiv
ENABLE ACTIVE
CancelActivMSTROperation FaultyOperation
ABORT ERROR
OperationSuccessful
SUCCESS
CONTROL ControlBlock
DATABUF DataField
Representation Representation:
in IL CAL MBP_MSTR_Instance (ENABLE:=EnableMSTRFunction,
ABORT:=CancelActivMSTROperation, ACTIVE=>OperationActiv,
ERROR=>FaultyOperation, SUCCESS=>OperationSuccessful,
CONTROL=>ControlBlock, DATABUF=>DataField)
90 33002527
MBP_MSTR
Representation Representation:
in ST MBP_MSTR_Instance (ENABLE:=EnableMSTRFunction,
ABORT:=CancelActivMSTROperation, ACTIVE=>OperationActiv,
ERROR=>FaultyOperation, SUCCESS=>OperationSuccessful,
CONTROL=>ControlBlock, DATABUF=>DataField) ;
Runtime error In the event of an error occurring during an MSTR operation, a hexadecimal error
code is displayed in the CONTROL[2] register of the control block for one cycle.
Function error codes are network-specific:
l Modbus Plus and SY/MAX Ethernet error codes (See Modbus Plus and SY/MAX
Ethernet Error Codes, p. 122)
l SY/MAX specific error codes (See SY/MAX-specific error codes, p. 124)
l TCP/IP Ethernet error codes (See TCP/IP Ethernet error codes, p. 126)
l CTE Error Codes for SY/MAX and TCP/IP Ethernet (See CTE error codes for SY/
MAX and TCP/IP Ethernet, p. 129)
Note: For a list of all block error codes and values, see Extended, p. 254.
33002527 91
MBP_MSTR
Function mode
Function mode Using the MBP_MSTR block, one of 12 available network communication operations
of MBP_MSTR can be triggered via the network. Each operation receives a code. Whether the
blocks operations are available depends on the type of network used.
Legend:
X Yes
- No
92 33002527
MBP_MSTR
Parameter description
ENABLE When ON, the operation specified in the first element of the CONTROL register is
enabled.
DATABUF For operations providing data, e.g. the write operation, the data field is the data
source. For operations receiving data, e.g. the read operation, the data field is the
data destination.
With Ethernet CTE Read and Write operations, the data field holds the contents of
the Ethernet configuration extension table. DATABUF must be defined as an ARRAY
having at least 10 elements in this case.
The data field must be declared as a located variable.
CONTROL This field contains the control block. The first element CONTROL[1] contains a
number from 1 to 12, which provides the operation code of the Modbus operation to
be performed. The content of the sequence register is determined by the operation.
The data field must be declared as a located variable.
The structure of the control block differs according to the network used:
l Modbus Plus
l TCP/IP Ethernet
l SY/MAX Ethernet
33002527 93
MBP_MSTR
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0
94 33002527
MBP_MSTR
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0
33002527 95
MBP_MSTR
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0
96 33002527
MBP_MSTR
Write data
Description The write operation transfers data to an addressed node. The transaction utilizes a
master transaction path and may require several cycles.
An attempt to program the MBP_MSTR in such a way that it writes to its own drop
address will generate an error in the CONTROL[2] register of the block. However, it
is possible to perform a write operation to a non-existing slave register. The slave
detects the status and logs it. This can last for several cycles.
Network The write operation can be performed on Modbus Plus, TCP/IP Ethernet and
implementation SY/MAX Ethernet networks.
33002527 97
MBP_MSTR
98 33002527
MBP_MSTR
Read data
Description The read operation transfers data from a specified node on the network. The
transaction utilizes a master transaction path and may require several cycles.
An attempt to program the MBP_MSTR in such a way that it reads from its own station
address will generate an error in the CONTROL[2] register of the block. But it is
possible to perform a read operation on a non-existing register of the slave. The
slave detects the status and logs it. This can last for several cycles.
Network The read operation can be performed on Modbus Plus, TCP/IP Ethernet and
implementation SY/MAX Ethernet networks.
33002527 99
MBP_MSTR
100 33002527
MBP_MSTR
Description This operation reads the data from the local node. The operation is carried out in one
cycle and does not require a master transaction path.
Network The write operation can be performed on Modbus Plus, TCP/IP Ethernet and
implementation SY/MAX Ethernet networks:
l List of available Modbus Plus network statistics (See Modbus Plus network
statistics, p. 116)
l List of TCP/IP Ethernet network statistics (See TCP/IP Ethernet Network
Statistics, p. 121)
33002527 101
MBP_MSTR
Description This operation deletes the statistics concerning the local node. The operation is
carried out in one cycle and does not require a master transaction path.
Note: If you edit the "Clear local statistics" operation, only words 13 to 22 in the
statistics table are cleared.
Network The operation can be performed on Modbus Plus and TCP/IP Ethernet networks.
implementation l List of available Modbus Plus network statistics (See Modbus Plus network
statistics, p. 116)
l List of TCP/IP Ethernet network statistics (See TCP/IP Ethernet Network
Statistics, p. 121)
102 33002527
MBP_MSTR
Description This operation transfers data to the communication processor of the current node,
so that it can be sent via the network as soon as the node receives the token. This
data can be received by all nodes connected to the local network. The operation is
carried out in one cycle and does not require a master transaction path.
33002527 103
MBP_MSTR
Description This operation reads data from the communications processor of any node
connected to the network that sends out global data. The operation can take several
cycles if the global data is not currently available with the nodes called. If global data
is available, the operation is executed in one cycle. A master transaction path is not
required.
104 33002527
MBP_MSTR
Description This operation reads the data referring to remote nodes on the network (see Modbus
Plus network statistics, p. 116 and TCP/IP Ethernet Network Statistics, p. 121). This
operation can last for several cycles and does not require a master data transaction
path.
With each query, the remote communications processor supplies a complete
statistics table even if the query does not refer to the entire table. MBP_MSTR will
then copy only those words into the identified $MW addresses that you queried.
Network The operation can be performed on Modbus Plus and TCP/IP Ethernet networks.
implementation
33002527 105
MBP_MSTR
106 33002527
MBP_MSTR
Description This operation clears the statistics concerning remote nodes on the network from the
data field of the local node. This operation can last for several cycles and employs
one single master data transaction path.
Note: If the "Clear remote statistics" operation is edited, only the words 13 through
22 of the statistics table (see Modbus Plus network statistics, p. 116 and TCP/IP
Ethernet Network Statistics, p. 121) will be deleted.
Network The write operation can be performed on Modbus Plus and TCP/IP Ethernet
implementation networks.
33002527 107
MBP_MSTR
Description This operation reads the selected data from the peer cop communications health
table and downloads the respective data into the specified %MW addresses
registers of State RAM. The Peer cop communications health table is 12 words long,
MBP_MSTR indexes all words with 0 through 11.
108 33002527
MBP_MSTR
Description The "Reset optional module" operation leads a Quantum NOE option module to start
a reset cycle to reset its working environment.
Network The write operation can be performed on TCP/IP Ethernet and SY/MAX Ethernet
implementation networks.
33002527 109
MBP_MSTR
Description The "Read CTE" operation reads a given number of bytes from the Ethernet
configuration extension table in the specified buffer in the PLC memory. The bytes
to be read start with a byte offset at the start of the CTE. The contents of the Ethernet
CTE table is displayed on output DATABUF.
Network The write operation can be performed on TCP/IP Ethernet and SY/MAX Ethernet
implementation networks.
110 33002527
MBP_MSTR
CTE indicator The values in the Ethernet configuration extension table (CTE) are displayed in a
implementation field on output DATABUF when a CTE read operation is implemented. The registers
(DATABUF) display the following CTE data:
CTE indicator implementation (DATABUF):
Parameter Register Contents
Frame type DATABUF[0] 1 = 802.3
2 = Ethernet
IP address DATABUF[1] First byte of the IP address
DATABUF[2] Second byte of the IP address
DATABUF[3] Third byte of the IP address
DATABUF[4] Fourth byte of the IP address
Lower netmask DATABUF[5] Most significant word
DATABUF[6] Least significant word
Gateway DATABUF[7] First byte of the gateway
DATABUF[8] Second byte of the gateway
DATABUF[9] Third byte of the gateway
DATABUF[10] Fourth byte of the gateway
33002527 111
MBP_MSTR
Description The "Write CTE" operation writes the CTE configuration table from the specified
data (DATABUF) to a specified Ethernet configuration extension table or to a specific
slot.
Network The write operation can be performed on TCP/IP Ethernet and SY/MAX Ethernet
implementation networks.
112 33002527
MBP_MSTR
CTE indicator The values in the Ethernet configuration extension table (CTE) are displayed in a
implementation field on output DATABUF when a CTE write operation is implemented. The registers
(DATABUF) are used to transfer the following CTE data:
CTE indicator implementation (DATABUF):
Parameter Register Contents
Frame type DATABUF[0] 1 = 802.3
2 = Ethernet
IP address DATABUF[1] First byte of the IP address
DATABUF[2] Second byte of the IP address
DATABUF[3] Third byte of the IP address
DATABUF[4] Fourth byte of the IP address
Lower netmask DATABUF[5] Most significant word
DATABUF[6] Least significant word
Gateway DATABUF[7] First byte of the gateway
DATABUF[8] Second byte of the gateway
DATABUF[9] Third byte of the gateway
DATABUF[10] Fourth byte of the gateway
33002527 113
MBP_MSTR
Peer Cop The table containing the Peer Cop status information fills 12 consecutive registers,
Communications which can be indexed with the numbers 0 to 11 in an MBP_MSTR operation. Each
Health Status individual bit of the table words is used to present one aspect of communications
health that refers to a specific node on the Modbus Plus network.
Relation bit The bits of the words 0 to 3 represent the health at the global communications input
network node of nodes 1 to 64. The bits of words 4 ... 7 represent the health of the output of a
specific node.
The bits in words 8 to 11 represent the health of the input of a specific node.
Status type Word index Relation bit network node
Global receive 0
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
1
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
2
48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
3
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
Send direct 4
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
5
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
6
48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
7
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
Receive direct 8
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
9
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
10
48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
11
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
114 33002527
MBP_MSTR
Health bit status The status of the Peer Cop Health bit indicates the current communications status
of its assigned node. A health bit will be set when the associated node accepts input
for its Peer Cop data block or when it receives a signal that another node has
accepted specific output data from its Peer Cop output data block. A health bit will
be deleted if the associated data block did not accept any communication within the
configured Peer Cop health timeout period.
All health bits will be deleted when interface command "Put Peer Cop" is executed
during PLC startup. The table values become valid when the Token has been
completely bypassed, after the interface command "Put Peer Cop" has been carried
out. The health bit of a specific node is always zero when the assigned Peer Cop
entry is zero.
33002527 115
MBP_MSTR
Modbus Plus The following table shows the statistics available on Modbus Plus. You can obtain
network this data by running the corresponding MBP_MSTR operation (Modbus function code
statistics 8).
Note: If you edit the "Clear local statistics" or "Clear remote statistics" operation,
only words 13 to 22 in the statistics table are cleared.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
116 33002527
MBP_MSTR
33002527 117
MBP_MSTR
118 33002527
MBP_MSTR
33002527 119
MBP_MSTR
120 33002527
MBP_MSTR
TCP/IP Ethernet A TCP/IP Ethernet module replies to the "Get local statistics" and "Set local
Network statistics" commands using the following information:
Statistics
Word Meaning
00 to 02 MAC address
e.g. MAC address 00 00 54 00 12 34 is displayed as follows:
Word Contents
00 00 00
01 00 54
02 34 12
03 Module state
l 0x0001 = Running
l 0x4000 = APPI LED (1=ON, 0 = OFF)
l 0x8000 = LED connection
04 and 05 Number of receiver interrupts
06 and 07 Number of transfer interrupts
08 and 09 Transfer timeout error count
10 and 11 Collision detection error count
12 and 13 Omitted packets
14 and 15 Memory error count
16 and 17 Number of restarts performed by the driver
18 and 19 Receive framing error count
20 and 21 Overflow error count receiver
22 and 23 Receive CRC error counter
24 and 25 Receive buffer error counter
26 and 27 Transfer buffer error counter
28 and 29 Transfer bin underflow counter
30 and 31 Late collision counter
32 and 33 Lost carrier counter
34 and 35 Number of retries
36 and 37 IP address
e.g. the IP address 198.202.137.113 (or c6 CA 89 71) is represented as
follows:
Word Contents
36 89 71
37 C6 CA
33002527 121
MBP_MSTR
Form of the Function error codes for Modbus Plus and SY/MAX Ethernet transactions appear as
function error Mmss, where:
code l M is the high code
l m is the low code
l ss is a subcode
Hexadecimal Hexadecimal error code for Modbus Plus and SY/MAX Ethernet:
error code
Hex. Error Description
Code
1001 Abort by user
2001 An operation type that is not supported has been specified in the control
block
2002 One or more control block parameters were modified while the MSTR
element was active (this only applies to operations which require several
cycles for completion). Control block parameters my only be modified in
inactive MSTR components.
2003 Invalid value in the length field of the control block
2004 Invalid value in the offset field of the control block
2005 Invalid value in the length and offset fields of the control block
2006 Unauthorized data field on slave
2007 Unauthorized network field on slave
2008 Unauthorized network routing path on slave
2009 Routing path equivalent to their own address
200A Attempt to get more global data words than available
200E The control block is not assigned, or parts of the control block are located
outside of the %MW (4x) range.
30ss Exceptional response by Modbus slave (See ss hexadecimal value in 30ss
error code, p. 123)
4001 Inconsistent response by Modbus slave
5001 Inconsistent response by the network
6mss Routing path error (See ss hexadecimal value in 6mss error code, p. 123)
The subfield m shows where the error occurred (a 0 value means local node,
2 means 2nd device in route, etc).
122 33002527
MBP_MSTR
ss hexadecimal
value in 6mss
Note: Subfield m in error code 6mss is an Index in the routing information that
error code
shows where an error has been detected (a 0 value indicates the local node, 2
means the second device in the route, etc.).
33002527 123
MBP_MSTR
SY/MAX-specific When utilizing SY/MAX Ethernet, three additional types of errors may appear in the
error codes CONTROL[1] register of the control block ().
The error codes have the following meaning:
l 71xx Error: Errors found by the SY/MAX remote device
l 72xx Error: Errors found by the server
l 73xx Error: Errors found by the Quantum translator
124 33002527
MBP_MSTR
33002527 125
MBP_MSTR
TCP/IP Ethernet An error in an MSTR routine via TCP/IP Ethernet may produce one of the following
error codes errors in the MSTR control block:
The error code appears as Mmss, where:
l M is the high code
l m is the low code
l ss is a subcode
126 33002527
MBP_MSTR
HEX error codes An error on the TCP/IP Ethernet network itself may produce one of the following
TCP/IP Ethernet errors in the CONTROL[1] register of the control block.
network HEX error codes TCP/IP Ethernet network:
Hex. Error Meaning
Code
5004 Interrupted system invocation
5005 I/O error
5006 No such address
5009 The socket descriptor is not valid
500C Not enough storage space
500D Authorization denied
5011 Entry exists
5016 An argument is not valid
5017 An internal table has no more space
5020 There is interference on the connection
5023 This operation was blocked and the socket is non-blocking
5024 The socket is non-blocking and the connection cannot be closed down
5025 The socket is non-blocking and a previous connection attempt has not been
concluded
5026 Socket operation on a non-socket
5027 The destination address is not valid
5028 Message too long
5029 Wrong type of protocol for the socket
502A Protocol not available
502B Protocol not supported
502C Socket type not supported
33002527 127
MBP_MSTR
128 33002527
MBP_MSTR
CTE error codes The following error codes are displayed in the CONTROL[1] register of the control
for SY/MAX and block, if there is a problem with the Ethernet configuration extension table (CTE) in
TCP/IP Ethernet your program configuration.
CTE error codes for SY/MAX and TCP/IP Ethernet:
Hex. Error Description
Code
7001 There is no Ethernet configuration extension
7002 The CTE is not available for access
7003 The offset is not valid
7004 Offset + length are not valid
7005 Bad data field in the CTE
33002527 129
MBP_MSTR
130 33002527
ModbusP_ADDR: Modbus Plus
Address
12
Overview
33002527 131
MODBUSP_ADDR
Description
Function This function block allows the entry of the Modbus Plus address for function blocks
description READ_REG, CREAD_REG, WRITE_REG and CWRITE_REG. The address is
transferred as a data structure.
EN and ENO can be configured as additional parameters.
Note: You must be familiar with your network when programming the
ModbusP_ADDR function block. Modbus Plus routing path structures are described
in detail in "Modbus Plus Network Planning and Installation Guide".
Representation Representation:
in FBD
ModbusP_ADDR_Instance
ModbusP_ADDR
NOMModuleSlot SLOT_ID
ADDRFLD DataStructureModbusPlusAddress
BYTE_variable1 ROUTING1
BYTE_variable2 ROUTING2
BYTE_variable3 ROUTING3
BYTE_variable4 ROUTING4
BYTE_variable5 ROUTING5
132 33002527
MODBUSP_ADDR
Representation Representation:
in LD
ModbusP_ADDR_Instance
ModbusP_ADDR
EN ENO
NOMModuleSlot SLOT_ID
ADDRFLD DataStructureModbusPlusAddress
BYTE_variable1 ROUTING1
BYTE_variable2 ROUTING2
BYTE_variable3 ROUTING3
BYTE_variable4 ROUTING4
BYTE_variable5 ROUTING5
Representation Representation:
in IL CAL ModbusP_ADDR_Instance (SLOT_ID:=NOMModuleSlot,
ROUTING1:=BYTE_variable1, ROUTING2:=BYTE_variable2,
ROUTING3:=BYTE_variable3, ROUTING4:=BYTE_variable4,
ROUTING5:=BYTE_variable5,
ADDRFLD=>DataStructureModbusPlusAddress)
Representation Representation:
in ST ModbusP_ADDR_Instance (SLOT_ID:=NOMModuleSlot,
ROUTING1:=BYTE_variable1, ROUTING2:=BYTE_variable2,
ROUTING3:=BYTE_variable3, ROUTING4:=BYTE_variable4,
ROUTING5:=BYTE_variable5,
ADDRFLD=>DataStructureModbusPlusAddress) ;
33002527 133
MODBUSP_ADDR
134 33002527
MODBUSP_ADDR
Detailed Description
Slot_ID If a Modbus Plus network option module (NOM) in the rack of a Quantum controller
is addressed as the destination node, the value at the Slot_ID input represents the
physical NOM slot, i.e. if the NOM is plugged in at Slot 7 of the rack, the value
appears as follows:
0 0 0 0 0 1 1 1
Routing x The Routing x input is used for address specification (routing path addresses one
of five) of the destination node during network transfer. The last byte in the routing
path that is not zero is the destination node.
0 x x x x x x x
33002527 135
MODBUSP_ADDR
Routing tab 1 If a Modbus Plus Network Options Module (NOM) is addressed as the destination
node in a Quantum control module rack, the most significant byte represents the
physical slot of the NOM. If the destination node is a CPU, the most significant byte
(regardless of the CPU slot) is set to "0".
If NOM is inserted in slot 7 on the module rack, the most significant byte of routing
tab 1 looks as follows:
Most significant byte Least significant byte
0 0 0 0 0 1 1 1 0 x x x x x x x
136 33002527
OUT_IN_CHAR: Sending/
receiving character strings
13
At a Glance
33002527 137
OUT_IN_CHAR
Description
Function The OUT_IN_CHAR function is used to send a string of a maximum of 210 bytes (120
Description for the terminal port), followed by a message receive request (send only or receive
only is also possible).
The character string may be contained in a static variable or stipulated in the form
of an immediate value (series of bytes between apostrophes, e.g.: 'Message to be
sent').
These character strings may contain special characters, and must start with the
character $ followed by the hexadecimal value of the character to be sent, for
example $0D.
Certain special characters may be used, such as:
$R = CR (carriage return), $L = LF (line feed), $N = CR+LF.
The additional parameters EN and ENO can be configured.
FBD Representation:
Representation
OUT_IN_CHAR
Address ADR RECP Received_Data
Mode TYPE
Data_to_Send EMIS
Management_Param GEST GEST Management_Param
138 33002527
OUT_IN_CHAR
LD Representation:
Representation
OUT_IN_CHAR
EN ENO
Mode TYPE
Data_to_Send EMIS
IL Representation:
Representation LD Address
OUT_IN_CHAR Mode, Data_to_Send, Management_Param,
Received_Data
ST Representation:
Representation OUT_IN_CHAR(Address, Mode, Data_to_Send, Management_Param,
Received_Data);
33002527 139
OUT_IN_CHAR
140 33002527
OUT_IN_CHAR
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
OUT_IN_CHAR
Parameters
Address: ... ?
Mode: ... Exchange
String to be sent:
Variable: ...
Value:
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
33002527 141
OUT_IN_CHAR
Note: simply choose from the solutions offered in the drop-down menu.
Note: if you use the entry field instead of the menu, you can enter a variable of the
INT type, either located or not.
String to be sent The string to be send is a variable of the STRING type. This variable must be
declared before being used.
If the choice of string is a variable (example String_0), the immediate value entry
field disappears.
String to be The reception zone is a variable of theSTRING type. The size of this variable is a
received function of the number of characters to be received. This variable must be declared
before being used in this screen.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
142 33002527
OUT_IN_CHAR
At a Glance Let us assume we want to send a character string Str_1 from station 1 of network
20 to the terminal port of station 5, then receive a character string Str_2 from the
terminal port of station 5 of the same network.
Here, a video terminal is connected to the terminal port of station 5 of network 20.
The string to be sent contains 10 characters.
The function's management table is made up of the table of words %MW170:4.
{20.5}
Fipway
{20.1}
33002527 143
OUT_IN_CHAR
OUT_IN_CHAR(ADDR(’{20.5}0.0.0.SYS’),1,Str_1,%MW170:4,Str_2);
END_IF;
Request parameters:
Parameters Description
ADDR(‘{20.5}0.0.0.SYS’) l {20.5}: network 20, station 5
l 0: rack
l 0: module
l 0: channel 0
l SYS: system address
1 Transmission then reception
Str_1 Variable of type STRING containing the message to send
%MW170:4 Management table
Str_2 Variable of type STRING that will contain the message received
Note: Before the function is launched, initialize the length parameter (in the
example: %MW173 ) with the value corresponding to the number of characters (in
bytes) to send to Str_1).
At the end of the exchange, %MW173 will contain the length of the data received
(in bytes).
144 33002527
PRINT_CHAR: Sending character
strings
14
At a Glance
33002527 145
PRINT_CHAR
Description
FBD Representation:
Representation
PRINT_CHAR
Address ADR
String_to_Send EMIS
Management_Param GEST GEST Management_Param
LD Representation:
Representation
PRINT_CHAR
EN ENO
Address ADR
String_to_Send EMIS
146 33002527
PRINT_CHAR
IL Representation:
Representation LD Address
PRINT_CHAR String_to_Send, Management_Param
ST Representation:
Representation PRINT_CHAR(Address, String_to_Send, Management_Param);
33002527 147
PRINT_CHAR
Programming Special characters are preceded by the character $ in the string to be transmitted.
Rules The $ characters are not transmitted by the sender, and must therefore not be
counted during the initialization of the length parameter.
The spaces between two characters are counted in a byte.
Therefore, for the example PRINTING IN PROGRESS$L$R, the length of the data
to be sent is 22 bytes.
It takes several PLC cycles to send a character string of more than 240 bytes (the
string is fragmented).
It is therefore important to make sure that the management data is not modified
during the processing of the function. The system transmits the string consistently
over several fragments, but does not prohibit the transmission of another character
string between two fragments.
Note: To send character strings containing end of string characters (ZERO). You
must:
l use localized STRINGS,
l initialize the last word of the exchange management table with the number of
characters to send. If you initialize this word with the value 0, the string that is
sent will stop at the first ZERO character it encounters. If you initialize it will a
value, the length of the character string sent will be equal to this value.
148 33002527
PRINT_CHAR
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
PRINT_CHAR
Parameters
Address: ...
?
String to be sent:
Variable: ...
Value:
Report: ...
Possible types: Array of Constant Int, Array of Int (n>=6)
Address ADDR(‘..’)
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
String to be sent The string to be sent is a variable of the STRING type or an immediate value. If a
STRING type variable is selected, the value field disappears.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
33002527 149
PRINT_CHAR
At a Glance Let us assume we want to send a character string to a video terminal connected to
the built-in link of the TSX SCY 21601 module of a PLC with a network address of
20, station 3. The TSX SCY 21601 module is located in slot 2 of the base rack.
The management table is located in %MW110:4 and the string to be sent is located
in the variable Str_1.
{20.1}
Fipway
{20.3}
150 33002527
PRINT_CHAR
Request parameters:
Parameters Description
ADDR(‘{20.3}0.2.0. l {20.3}: network 20, station 3
SYS’) l 0: rack
l 2: module
l 0: channel 0
l SYS: system address
Str_1 Character string to send, variable Str_1 is of type STRING.)
%MW110:4 Management table
Note: Each time the function is launched, initialize the length parameter (in the
example: %MW113) with the value corresponding to the number of characters (in
bytes) to send to Str_1).
33002527 151
PRINT_CHAR
152 33002527
RCV_TLG: Receiving telegrams
15
At a Glance
33002527 153
RCV_TLG
Description
Function The RCV_TLG function is used to read telegram-type data from a remote application.
Description The data received must be a maximum of 16 bytes in length. Unlike the other
communication functions, this function is processed immediately (synchronous):
there are therefore no activity bit and timeout parameters.
The integer table assigned to the management parameters therefore only uses two
words instead of four (the exchange and timeout numbers being unnecessary).
Note: this function can be used on Fipway in the processor only, and for stations
0 to 15.
FBD Representation:
representation
RCV_TLG
ADR Address
RECP Received_Data
Management_Param GEST GEST Management_Param
LD Representation:
representation
RCV_TLG
EN ENO
ADR Address
RECP Received_Data
IL representation Representation:
LD Management_Param
RCV_TLG Address, Received_Data
154 33002527
RCV_TLG
ST Representation:
representation RCV_TLG(Management_Param, Address, Received_Data);
33002527 155
RCV_TLG
At a Glance Let us assume we want to receive an 8-word (16 byte) telegram from a remote
application on a Fipway network.
{20.3}
Fipway
{20.1}
IF RE(%I0.3.11) THEN
RCV_TLG(%MW200:2, %MW300,%MW310:8);
END_IF;
Request parameters:
Parameters Description
%MW200:2 Management table
%MW300 Contains the address of the sender at the end of the exchange.
%MW310:8 Contents of the telegram received
156 33002527
READ_ASYN: Reading data
asynchronously
16
Description
Function The READ_ASYN function is used to read 1 Kbyte of data via the asynchronous
Description messaging channel of TSX ETY modules in TCP/IP mode.
The following data can be read-accessed:
l internal bits,
l internal words.
Asynchronous reading can only take place between two stations on the same
Ethernet TCP/IP network segment.
The READ_ASYN function is sent at the end of the MAST task only if this is configured
in periodic mode. It is possible to activate 8 functions simultaneously.
The operating principle is identical to that of the WRITE_ASYN (See Exchange
principle, p. 224) function.
The size of the send and receive buffers is expressed in words. It is 512 words, or
1024 bytes.
33002527 157
READ_ASYN
FBD Representation:
representation
READ_ASYN
Address ADR RECP Receiving_Array
Object_Type OBJ
First_Object NUM
Object_Number NB
Management_Param GEST GEST Management_Param
LD Representation:
representation
READ_ASYN
EN ENO
Object_Type OBJ
First_Object NUM
Object_Number NB
IL representation Representation:
LD Address
READ_ASYN Object_Type, First_Object, Object_Number,
Management_Param, Receiving_Array
ST Representation:
representation READ_ASYN(Address, Object_Type, First_Object, Object_Number,
Management_Param, Receiving_Array);
158 33002527
READ_ASYN
33002527 159
READ_ASYN
160 33002527
READ_GDATA: Reading Modbus
Plus Global Data
17
Description
Function The READ_GDATA function is used to read shared data, or Global Data, on a
Description Modbus Plus network.
Global Data is shared between a maximum of 64 stations on the same Modbus Plus
network. Each station may write up to 32 integers, which can then be used by all
stations on the network. Conversely, each station can read the 32 integers
(maximum) of all the other network stations.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
READ_GDATA
Address ADR RECP Receiving_Array
Management_Param GEST GEST Management_Param
LD Representation:
representation
READ_GDATA
EN ENO
33002527 161
READ_GDATA
IL representation Representation:
LD Address
READ_GDATA Management_Param, Receiving_Array
ST Representation:
representation READ_GDATA(Address, Management_Param, Receiving_Array);
162 33002527
READ_REG: Read register
18
Overview
33002527 163
READ_REG:
Description
Function With a rising edge at the REQ input, this function block reads a register area from an
description addressed slave via Modbus Plus, TCP/IP-Ethernet or SY/MAX-Ethernet.
Note: When programming a READ_REG function, you must be familiar with the
routing procedures used by your network. Modbus Plus routing path structures are
described in detail in the Modbus Plus Network Planning and Installation Guide. If
TCP/IP or SY/MAX Ethernet routing is implemented, standard Ethernet IP router
products must be used. A full description of the TCP/IP routing is provided in the
Quantum with Unity Pro TCP/IP Configuration User Guide.
Note: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Representation Representation:
in FBD READ_REG_Instance
READ_REG
StartReadOnce REQ NDR SetAfterReadingNewData
OffsetAddress SLAVEREG ERROR SetInCaseOfError
NumberOfRegisters NO_REG REG_READ RegisterToRead
DataStructure ADDRFLD STATUS ErrorCode
164 33002527
READ_REG:
Representation Representation:
in LD
READ_REG_Instance
READ_REG
EN ENO
StartReadOnce SetAfterReadingNewData
REQ NDR
SetInCaseOfError
OffsetAddress SLAVEREG ERROR
Representation Representation:
in IL CAL READ_REG_Instance (REQ:=StartReadOnce,
SLAVEREG:=OffsetAddress, NO_REG:=NumberOfRegisters,
ADDRFLD:=DataStructure, NDR=>SetAfterReadingNewData,
ERROR=>SetInCaseOfError, REG_READ=>RegisterToRead,
STATUS=>ErrorCode)
Representation Representation:
in ST READ_REG_Instance (REQ:=StartReadOnce,
SLAVEREG:=OffsetAddress, NO_REG:=NumberOfRegisters,
ADDRFLD:=DataStructure, NDR=>SetAfterReadingNewData,
ERROR=>SetInCaseOfError, REG_READ=>RegisterToRead,
STATUS=>ErrorCode) ;
33002527 165
READ_REG:
Runtime error For a list of all block error codes and values, see Extended, p. 254.
166 33002527
READ_REG:
33002527 167
READ_REG:
Function mode
Function mode Although a large number of READ_REG function blocks can be programmed, only
of READ_REG four read operations may be active at the same time. In such a case it is insignificant
blocks whether they are the result of this function block or others (e.g. MBP_MSTR,
CREAD_REG). All function blocks use one data transaction path and require multiple
cycles to complete a job.
Note: A TCP/IP communication between a Quantum PLC (NOE 211 00) and a
Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible,
when only one read or write job is carried out in every cycle. If several jobs are sent
per PLC cycle, the communication stops without generating an error message in
the status register of the function block.
All routing information is contained in the WordArr5 data structure of the ADDRFLD
input. The type function block assigned to this input is defined by the network used.
Please use:
l Modbus Plus for function block ModbusP_ADDR
l TCP/IP Ethernet for function block TCP_IP_ADDR
l SY/MAX Ethernet for function block SYMAX_IP_ADDR
Note: The WordArr5 data structure can also be used with constants.
168 33002527
READ_REG:
Parameter description
SLAVEREG Start of the area in the addressed slave from which the source data is read. The
source area always resides within the %MW register area.
NO_REG Number of addresses to be read from the addressed slave (1 ... 100).
The parameter can be entered as a direct address, located variable, unlocated
variable or literal.
NDR Transition to ON state for one program cycle signifies receipt of new data ready to
be processed.
The parameter can be entered as a direct address, located variable or unlocated
variable.
ERROR Transition to ON state for one program cycle signifies the detection of a new error.
The parameter can be entered as a direct address, located variable or unlocated
variable.
REG_READ An ARRAY that is the same size as the requested transmission must be agreed upon
(≥ NO_REG) for this parameter. The name of this array is defined as a parameter. If
the array is defined too small, then only the amount of data is transmitted that is
present in the array.
The parameter must be defined as a located variable.
33002527 169
READ_REG:
STATUS If an error occurs while the function is being executed, an error code remains at this
output for one cycle.
Error code, see
l Modbus Plus and SY/MAX Ethernet Error Codes, p. 122
l SY/MAX-specific error codes, p. 124
l TCP/IP Ethernet error codes, p. 126
The parameter can be entered as an address, located variable or unlocated
variable.
170 33002527
READ_VAR: Reading variables
19
At a Glance
33002527 171
READ_VAR
Description
Function The READ_VAR function is used to read the value of one or more language objects:
Description l internal bits,
l internal words.
The objects that are read must always be consecutive. They may be located in a
remote CPU or in a device connected to a communication channel of one of the
following types: Ethernet TCP/IP, Modbus Plus, Fipway, Uni-Telway, terminal port,
Modbus, Fipio.
The READ_VAR function can read up to 1000 consecutive bits in a remote device,
whatever the device and the protocol used may be (Uni-Telway or Modbus/Jbus).
Note: Reading over 1000 bits requires the use of the SEND_REQ function.
FBD Representation:
representation
READ_VAR
Address ADR RECP Receiving_Array
Object_Type OBJ
First_Object NUM
Object_Number NB
Management_Param GEST GEST Management_Param
172 33002527
READ_VAR
LD Representation:
representation
READ_VAR
EN ENO
Object_Type OBJ
First_Object NUM
Object_Number NB
IL representation Representation:
LD Address
READ_VAR Object_Type, First_Object, Object_Number,
Management_Param, Receiving_Array
ST Representation:
representation READ_VAR(Address, Object_Type, First_Object, Object_Number,
Management_Param, Receiving_Array);
33002527 173
READ_VAR
174 33002527
READ_VAR
Rules of use Object types must be entered consistently. Entries must be written either all in lower
case or all in upper case, otherwise the function sends back a report equal to 16#06
(incorrect specific parameters).
For Micro, Premium or Atrium PLCs receiving the read variables function, read-only
access to internal bits has the following particularity:
l The forcing value of the bits is returned in the response.
l Reading 1 bit therefore comprises two response bytes:
l The first contains the value of the 8 bits from the one requested.
l The second indicates whether these bits have been forced.
l In order to read one of the last 8 bits of the memory it is necessary to read all the
last 8, otherwise the function sends back a 16#01 operation report.
Note: Space for the forcing indication bytes should be provided for in the receive
table. Otherwise a 16#03 fault code is sent back in the report.
33002527 175
READ_VAR
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
READ_VAR
Parameters
Address: ... ?
Type of Object to Read:
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
Note: simply choose from the solutions offered in the drop-down menu.
176 33002527
READ_VAR
Note: if you enter a constant, an entry field appears to enter the constant. If you
enter a variable, this can be located or not.
Note: if you enter a constant, an entry field appears to enter the constant. If you
enter a variable, this can be located or not.
Reception zone The reception zone is an integer array. The size of this array depends on the number
of objects to read. This integer array can be located or not.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
33002527 177
READ_VAR
At a Glance The master PLC must read internal words %MW100 to %MW109 of address station 6
on a Uni-Telway bus. The values of the words that are read are sorted on the basis
of the internal word %MW10, and management parameters are stored on the basis of
%MW40.
Ad0 = 6
Uni-Telway
178 33002527
READ_VAR
ADDR
EN ENO
‘%MW’ OBJ
100 NUM
10 NB
Request parameters:
Parameters Description
’0.0.0.6’ l 0 : rack
l 0 : module
l 0 : channel 0
l 6 : destination address
’%MW’ Type of object (internal word)
100 Address of first object
10 Number of consecutive objects
%MW40:4 Report
%MW10:10 Contents of the response
33002527 179
READ_VAR
At a Glance The following examples illustrate the READ_VAR communication function for reading
bits. In this case the receive table consecutively contains the value of the bits as well
as the forcing indication.
Reading 32 In ST, the syntax of the internal bit reading function is as follows:
internal bits READ_VAR (ADDR(‘{20.1}0.5.1.3’),‘%M’, 0, 32, %MW100:4,
%MW50:4);
The receive table must include 8 bytes (4 words), 4 bytes for the value and 4 bytes
for the forcing indication.
Word Byte 3 Byte 2 Byte 1 Byte 0
Value %MW100 0000 0000 1100 1100
%MW101 1111 1111 0000 1111
Forcing %MW102 0000 0000 0101 0101
%MW103 0000 0000 0000 1111
Forcing can be performed for each %MW102 or %MW103 bit set to 1; the forcing value
being that of the corresponding bit read.
Example:
Value of the first 4 bits Forcing of the first 4 bits Description
(byte 0 of word %MW100) (byte 0 of word %MW102)
0 1 The bit is forced to 0
0 0 The bit is not forced
1 1 The bit is forced to 1
1 0 The bit is not forced
180 33002527
READ_VAR
Reading 18 In ST, the syntax of the internal bit reading function is as follows:
internal bits READ_VAR (ADDR(‘{20.1}0.5.1.3’),‘%M’, 0, 18, %MW100:3,
%MW50:4);
The receive table must contain 3 words (or 6 bytes). In fact, to obtain the value of
the 18 bits, 3 bytes plus a further 3 bytes are needed in order to contain the forcing
value of the 18 bits.
Value of the 14th bit Value of the 1st bit
33002527 181
READ_VAR
At a Glance Station 2 of network 20 must read a 5-word table %MW0 to %MW4 of the Uni-Telway
slave, network address 20, station 1, communication module TSX SCM 2116 in slot
5, channel 1 in the communication module, server address Ad0 = 3.
TSX 87 Premium
{20.2}
{20.1}
Uni-Telway
Ad0 = 3
Ad0 = 1
182 33002527
READ_VAR
ADDR
EN ENO
‘%MW’ OBJ
0 NUM
5 NB
Request parameters:
Parameters Description
ADDR(‘{20.1}0.5.1.3’) l {20.1} : network 20, station 1
l 0 : rack
l 5 : module
l 1 : channel 1
l 3 : read destination slave address
‘%MW’ Type of object (internal word)
0 address of first object
5 Number of consecutive objects
%MW50:4 Management table
%MW20:5 Contents of the response
33002527 183
READ_VAR
At a Glance The following example illustrates the READ_VAR function with a management
parameter check.
184 33002527
SEND_REQ: Sending requests
20
At a Glance
33002527 185
SEND_REQ
Description
Function The SEND_REQ function is used to code and send all UNI-TE and Modbus/Jbus
Description requests, as well as receive the associated responses.
Coding details for UNI-TE requests are provided in the reference manual:
Communication Reference TSX DR NET.
Details on coding the Modbus/Jbus requests are provided in the TSX DG MDB
manual.
Modbus requests common to all Schneider devices are presented in the
Architecture and communication services manual.
The additional parameters EN and ENO can be configured.
FBD
Representation
SEND_REQ
Address ADR RECP Received_Data
Request_Code CODE
Data_to_Send EMIS
Management_Param GEST GEST Management_Param
LD
Representation
SEND_REQ
EN ENO
Request_Code CODE
Data_to_Send EMIS
186 33002527
SEND_REQ
IL LD Address
Representation SEND_REQ Request_Code, Data_to_Send, Management_Param,
Received_Data
33002527 187
SEND_REQ
188 33002527
SEND_REQ
33002527 189
SEND_REQ
Note: to find out details and the list of requests recognized by each device, refer to
the TSX DR NET reference manual.
General Usage These requests are used to identify and diagnose all the types of devices that have
Requests a UNI-TE server.
Request Name Request Report Code Comment
Code
IDENTIFICATION 16#0F 16#3F Provides the following information
l product range,
l specific application type,
l product type,
l catalogue reference.
READ_CPU 16#4F 16#7F Performs system diagnostics on any device.
PROTOCOL_VERSION 16#30 16#60 Used to adapt the version of the protocol between two
communicating entities.
MIRROR 16#FA 16#FB Tests the correct routing of data between two
communicating devices.
190 33002527
SEND_REQ
To ensure that the ETY module is ready for operation, allow the PLC to run (in run
mode) for 15 seconds after the last stop mode before issuing the SEND_REQ
function. After the user issues the CHANGE IP PARAMETERS command and the
ETY module accepts the new parameters, the ETY module resets and begins
operations with the new parameters.
Note: FDR clients that use the ETY module for a server must be rebooted after the
ETY's IP address change is completed. Otherwise, these FDR clients can not
update their parameter files on the FDR server (the ETY module).
Note: Constant words contain the original configuration parameters, not those that
were updated after the IP address change.
Note: You can see the new configuration (IP parameters, subnet mask, and
gateway address) in the Unity Pro ETY debug screen. You can also see the newly
assigned IP address in the Ethernet Module Statistics web page, however, you
must be aware that the IP Address, Subnetwork mask, and Gateway data on this
page reflect the old configuration.
33002527 191
SEND_REQ
Refer to the example for changing IP parameters with SEND_REQ (See Changing
IP Parameters with SEND_REQ (Example), p. 199).
192 33002527
SEND_REQ
Accessing These requests provide a set of services that give read/write access to internal bit
Objects and word-type data, system bit and word-type data, floating point data, constant
data and SFC data.
Request Name Request Code Report Code Comment
READ_OBJECT 16#36 16#66 Used to read one or more consecutive objects
of the same type.
WRITE_OBJECT 16#37 16#FE Used to write one or more consecutive objects
of the same type.
READ_INTERNAL_BIT 16#00 16#30 Used to read the value of an internal bit.
WRITE_INTERNAL_BIT 16#10 16#FE Used to write the value of an internal bit.
READ_INTERNAL_WORD 16#04 16#34 Used to read the value of an internal word.
WRITE_INTERNAL_WORD 16#14 16#FE Used to write the value of an internal word.
33002527 193
SEND_REQ
Management of These requests provide a set of services that can be used to manage a processor's
Operating Modes operating modes.
Request Name Request Code Report Code Comment
RUN 16#24 16#FE Used to launch the execution of a processor's tasks.
STOP 16#25 16#FE Used to stop the execution of a processor's tasks.
INIT 16#33 16#63 Used to trigger a hot or cold re-start.
Reservation These requests provide a reservation mechanism that is used to protect a server
Management against concurrent connections during a critical period.
Request Name Request Code Report Code Comment
RESERVE 16#1D 16#FE Enables a client to generally or partially reserve a
server's functions.
RELEASE 16#1E 16#FE Enables a client to free up the reserved server.
I_AM_ALIVE 16#2D 16#FE Used to maintain the reservation.
194 33002527
SEND_REQ
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
SEND_REQ
Parameters
Address: ... ?
Request Code: ...
Data to send: ...
Reception zone: ...
Report: ...
Possible types: Array of Constant Int, Array of Int (n>=6)
Address ADDR(‘..’)
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
Note: if you enter a constant, an entry field appears to enter the constant. If you
enter a variable, it can be located or not.
33002527 195
SEND_REQ
Data to Send These data to be sent are stored in the form of an integer array. This array can be
located or not.
Reception Zone The reception zone is an array of integers. This array can be located or not, and its
size depends on the request code used.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
196 33002527
SEND_REQ
At a Glance Station 2 of network 20 must send an identification request to the device with
address Ad0=3 on the Uni-Telway bus of station 1 of the same network. The identifi-
cation request has the decimal code 15 (or 16#0F).
The management table is located at %MW10:4.
Uni-Telway
Ad0 = 3
Ad0 = 1
33002527 197
SEND_REQ
Request parameters:
Parameters Description
ADDR(‘{20.1}0.5.1.3’) l {20.1}: network 20, station 1
l 0: rack
l 5: module
l 1: channel 1
l 3: destination address
15 Request 15 (or 16#0F if the coding is hexadecimal)
%MW0:1 Data sent (for example: no data to send)
%MW10:4 Management table
%MW100:24 Contents of the response (reception of 24 words)
Note: Each time the function is launched, initialize the length parameter (in the
example: %MW13 = 0).
198 33002527
SEND_REQ
Illustration The graphic shows you how to set IP parameters for the ETY module in slot 2 with
the SEND_REQ block:
Note:
l ADR: reflects the ETY’s position in slot 2.
l CODE: reflects the value of the REQUEST_CODE.
l EMIS: contains the IP parameters in Data_to_Send:
l address (139.158.10.7)
l subnet mask (255.255.248.0)
l gateway (139.158.8.1)
l GEST: reflects Management_Param (management parameters).
You have to assign a time to the third word of Management_Param. The fourth
word should have the INT value 18.
l RECP: This parameter requires a minimum INT value of 1, even when no
response message is returned, as in the case of an IP change request..
33002527 199
SEND_REQ
At a Glance The SEND_REQ function is used to code and send all UNI-TE and Modbus/Jbus
requests, as well as receive the associated responses.
In certain cases (reading of word tables for example) it is necessary to resequence
the objects received by using the ROR1_ARB function (shift of a byte in a table). .
200 33002527
SEND_TLG: Sending telegrams
21
At a Glance
33002527 201
SEND_TLG
Description
Function The SEND_TLG function is used to send telegram-type data to a remote application.
Description The data to be sent must be a maximum of 16 bytes in length. Unlike the other
communication functions, this function is processed immediately (synchronous):
there are therefore no activity bit and timeout parameters.
The integer table assigned to the management parameters therefore only uses two
words instead of four (the exchange and timeout numbers being unnecessary).
WARNING
Card position
The SEND_TLG function can be used on Fipway only if the TSX FPP
20 card and only for stations 0 to 15.
Failure to follow this instruction can result in death, serious injury,
or equipment damage.
FBD Representation:
Representation
SEND_TLG
Address ADR
Data_to_Send EMIS
Management_Param GEST GEST Management_Param
202 33002527
SEND_TLG
LD Representation:
Representation
SEND_TLG
EN ENO
Address ADR
Data_to_Send EMIS
IL Representation:
Representation LD Address
SEND_TLG Data_to_Send, Management_Param
ST Representation:
Representation SEND_TLG(Address, Data_to_Send, Management_Param);
33002527 203
SEND_TLG
204 33002527
SEND_TLG
At a Glance Let us suppose we want to send an 8-word telegram from station 1 to the remote
station 3 on Fipway network 20.
We will use table %MW190:8 to contain these words to be sent, and table %MW200:2
will contain the management table of the exchange.
{20.1} {20.3}
IF RE(%I0.3.10) THEN
SEND_TLG(ADDR(’{20.3}APP’), %MW190:8, %MW200:2);
END_IF;
Request parameters:
Parameters Description
ADDR(’{20.3}APP’) l {20.2}: network 20, station 3
l APP: application
%MW190:8 Contents of the telegram to be sent
%MW200:2 Management table
Note: The word %MW 201 must be initialized to 16 (8 words) before the request is
sent.
To execute this function synchronously, it is necessary to test the operation report
immediately after the program line that activates the execution of this function.
33002527 205
SEND_TLG
206 33002527
SYMAX_IP_ADDR: SY/MAX
IP Address
22
Overview
33002527 207
SYMAX_IP_ADDR
Description
Function This function block allows the entry of the SY/MAX IP address for function blocks
Description REAG_REG, CREAD_REG, WRITE_REG and CWRITE_REG. The address is
transferred as a data structure.
EN and ENO can be configured as additional parameters.
Note: You must be familiar with your network when programming the
SYMAX_IP_ADDR function block.
Representation Representation:
in FBD
SYMAX_IP_ADDR_Instance
SYMAX_IP_ADDR
MappingIndex DROP_NO
NOEModuleSlot SLOT_ID
ADDRFLD DataStructureSYMAX_IP
DestinationDropNumber DESTDROP
Terminator TERMINAT
Representation Representation:
in LD
SYMAX_IP_ADDR_Instance
SYMAX_IP_ADDR
EN ENO
MappingIndex DROP_NO
NOEModuleSlot SLOT_ID
ADDRFLD DataStructureSYMAX_IP
DestinationDropNumber DESTDROP
Terminator TERMINAT
208 33002527
SYMAX_IP_ADDR
Representation Representation:
in IL CAL SYMAX_IP_ADDR_Instance (DROP_NO:=MappingIndex,
SLOT_ID:=NOEModuleSlot, DESTDROP:=DestinationDropNumber,
TERMINAT:=Terminator, ADDRFLD=>DataStructureSYMAX_IP)
Representation Representation:
in ST SYMAX_IP_ADDR_Instance (DROP_NO:=MappingIndex,
SLOT_ID:=NOEModuleSlot, DESTDROP:=DestinationDropNumber,
TERMINAT:=Terminator, ADDRFLD=>DataStructureSYMAX_IP) ;
33002527 209
SYMAX_IP_ADDR
Detailed Description
DROP_NR The MBP to Ethernet Transporter (MET) mapping index is given at the DROP_NR
input, i.e. if MET is 6, the value appears as follows:
0 0 0 0 0 1 1 0
Slot_ID If a NOE in the rack of a Quantum controller is addressed as destination node, the
value at the SLOT_ID input represents the physical NOE slot, i.e. if the NOE is
plugged in at Slot 7 of the rack, the value appears as follows:
0 0 0 0 0 1 1 1
ADDRFLD If a NOE in the rack of a Quantum controller is addressed as a destination node, the
value in the most significant byte represents the physical slot of the NOE and the
least significant byte represents the MBP on Ethernet Transporter (MET) mapping
index, i.e. if the NOE is inserted in slot 7 of the rack and the MET mapping index is
6, the first element of the data structure looks as follows:
Most significant byte Least significant byte
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0
210 33002527
TCP_IP_ADDR: TCP/IP Address
23
Overview
33002527 211
TCP_IP_ADDR
Description
Function This function block allows the entry of the TCP/ IP address for function blocks
Description READ_REG, CREAD_REG, WRITE_REG and CWRITE_REG. The address is
transferred as a data structure.
EN and ENO can be configured as additional parameters.
Note: You must be familiar with your network when programming the
TCP_IP_ADDR function block. The "Quantum Ethernet TCP/IP Module User
Guide" provides a complete description of the TCP/IP routing.
Representation Representation:
in FBD
TCP_IP_ADDR_Instance
TCP_IP_ADDR
MapIndex MAP_IDX
NOEModuleSlot SLOT_ID
ADDRFLD DataStructureTCP_IPAddress
Byte4OfIPAddress IP_B4
Byte3OfIPAddress IP_B3
Byte2OfIPAddress IP_B2
Byte1OfIPAddress IP_B1
212 33002527
TCP_IP_ADDR
Representation Representation:
in LD TCP_IP_ADDR_Instance
TCP_IP_ADDR
EN ENO
MapIndex MAP_IDX
NOEModuleSlot SLOT_ID
ADDRFLD DataStructureTCP_IPAddress
Byte4OfIPAddress IP_B4
Byte3OfIPAddress IP_B3
Byte2OfIPAddress IP_B2
Byte1OfIPAddress IP_B1
Representation Representation:
in IL CAL TCP_IP_ADDR_Instance (MAP_IDX:=MapIndex,
SLOT_ID:=NOEModuleSlot, IP_B4:=Byte4OfIPAddress,
IP_B3:=Byte3OfIPAddress, IP_B2:=Byte2OfIPAddress,
IP_B1:=Byte1OfIPAddress,
ADDRFLD=>DataStructureTCP_IPAddress)
Representation Representation:
in ST TCP_IP_ADDR_Instance (MAP_IDX:=MapIndex,
SLOT_ID:=NOEModuleSlot, IP_B4:=Byte4OfIPAddress,
IP_B3:=Byte3OfIPAddress, IP_B2:=Byte2OfIPAddress,
IP_B1:=Byte1OfIPAddress,
ADDRFLD=>DataStructureTCP_IPAddress) ;
33002527 213
TCP_IP_ADDR
214 33002527
TCP_IP_ADDR
Detailed Description
MAP_IDX The MBP to Ethernet Transporter (MET) mapping index is given at the Map_Idx+
input, i.e. if MET is 6, the value appears as follows:
0 0 0 0 0 1 1 0
Slot_ID If a NOE in the rack of a Quantum controller is addressed as destination node, the
value at the SLOT_ID input represents the physical NOE slot, i.e. if the NOE is
plugged in at Slot 7 of the rack, the value appears as follows:
0 0 0 0 0 1 1 1
ADDRFLD If a NOE in the rack of a Quantum controller is addressed as a destination node, the
value in the most significant byte represents the physical slot of the NOE and the
least significant byte represents the MBP on Ethernet Transporter (MET) mapping
index, i.e. if the NOE is inserted in slot 7 of the rack and the MET mapping index is
6, the first element of the data structure looks as follows:
Most significant byte Least significant byte
0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0
33002527 215
TCP_IP_ADDR
216 33002527
UNITE_SERVER: Immediate
server
24
At a Glance
33002527 217
UNITE_SERVER
Description
Function The UNITE_SERVER function is used to process UNI-TE requests immediately from
Description the application program.
This function can be activated in the MAST task or the FAST task.
Note: At any given time, only one UNITE_SERVER function can be activated by the
application.
218 33002527
UNITE_SERVER
Exchange The following diagram illustrates the exchanges made during the use of the
principle UNITE_SERVER communication function.
Inputs
First request:
READ_VAR1
UNITE_SERVER
Response to the first function activated
request READ_VAR1
UNITE_SERVER
Response to the second
function activated
request READ_VAR2
Outputs
FBD Representation:
representation
UNITE_SERVER
ADR Address
RqRp Received_Codes
Management_Param GEST GEST Management_Param
33002527 219
UNITE_SERVER
LD Representation:
representation
UNITE_SERVER
EN ENO
ADR Address
RqRp Received_Codes
IL representation Representation:
LD Management_Param
UNITE_SERVER Address, Received_Codes
ST Representation:
representation UNITE_SERVER(Management_Param, Address, Received_Codes);
220 33002527
UNITE_SERVER
33002527 221
UNITE_SERVER
Request parameters:
Parameters Description
%MW110:2 Management table
ADDR(’0.2.1.SYS’) l 0: rack
l 2: module
l 1: channel 1
l SYS: system address
%MW10 Response:
l Most significant byte: 16#03, Modbus read n words function
code.
l Least significant byte: 16#03, Modbus read n words function
response code.
222 33002527
WRITE_ASYN: Writing data
asynchronously
25
Description
Function The WRITE_ASYN function is used to write 1 Kbyte of data via the asynchronous
Description messaging channel of TSX ETY modules in TCP/IP mode.
The following data can be write-accessed:
l internal bits,
l internal words.
Asynchronous writing can only take place between two stations on the same
Ethernet TCP/IP network segment.
The WRITE_ASYN function is sent at the end of the MAST task only if this is
configured in periodic mode. It is possible to activate 8 functions simultaneously.
The size of the send and receive buffers is expressed in words. It is 512 words, or
1024 bytes.
33002527 223
WRITE_ASYN
Exchange The following diagram illustrates the exchanges between two stations for a
principle WRITE_ASYN function:
I
P Triggering of the WRITE_ASYN
function
O
I
Sending of the function
P
Reception of messages
Routing the responses to the I
WRITE_ASYN functions P
224 33002527
WRITE_ASYN
FBD Representation:
representation
WRITE_ASYN
Address ADR
Object_Type OBJ
First_Object NUM
Object_Number NB
Data_to_Write EMIS
Management_Param GEST GEST Management_Param
LD Representation:
representation
WRITE_ASYN
EN ENO
Address ADR
Object_Type OBJ
First_Object NUM
Object_Number NB
Data_to_Write EMIS
IL representation Representation:
LD Address
WRITE_ASYN Object_Type, First_Object, Object_Number,
Data_to_Write, Management_Param
ST Representation:
representation WRITE_ASYN(Address, Object_Type, First_Object, Object_Number,
Data_to_Write, Management_Param);
33002527 225
WRITE_ASYN
226 33002527
WRITE_GDATA: Writing the
Global Data Modbus Plus
26
Description
Function The WRITE_GDATA function is used to write shared data, or Global Data, on a
Description Modbus Plus network.
Global Data is shared between a maximum of 64 stations on the same Modbus Plus
network. Each station may write up to 32 integers, which can then be used by all
stations on the network. Conversely, each station can read the 32 integers
(maximum) of all the other network stations.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
WRITE_GDATA
Address ADR
Data_to_Write OUT
Management_Param GEST GEST Management_Param
33002527 227
WRITE_GDATA
LD Representation:
representation
WRITE_GDATA
EN ENO
Address ADR
Data_to_Write OUT
IL representation Representation:
LD Address
WRITE_GDATA Data_to_Write, Management_Param
ST Representation:
representation WRITE_GDATA(Address, Data_to_Write, Management_Param);
228 33002527
WRITE_GDATA
33002527 229
WRITE_GDATA
230 33002527
WRITE_REG: Write register
27
Overview
33002527 231
WRITE_REG
Description
Function With a rising edge at the REQ input, this function block writes a register area from a
description register area from the PLC via Modbus Plus, TCP/IP Ethernet or SY/MAX-Ethernet
to an addressed slave.
EN and ENO can be configured as additional parameters.
Note: When programming a WRITE_REG function, you must be familiar with the
routing procedures used by your network. Modbus Plus routing path structures are
described in detail in the Modbus Plus Network Planning and Installation Guide. If
TCP/IP or SY/MAX Ethernet routing is implemented, standard Ethernet IP router
products must be used. A full description of the TCP/IP routing is provided in the
Quantum with Unity ProTCP/IP Configuration User Guide.
Note: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Representation Representation:
in FBD
WRITE_REG_Instance
WRITE_REG
StartWriteOnce REQ DONE SetAfterWritingData
OffsetAddress SLAVEREG ERROR SetInCaseOfError
NumberOfRegisters NO_REG
SourceDataArea REG_WRIT
DataStructureForTransfer ADDRFLD STATUS ErrorCode
232 33002527
WRITE_REG
Representation Representation:
in LD
WRITE_REG_Instance
WRITE_REG
EN ENO
StartWriteOnce SetAfterWritingData
REQ DONE
SetInCaseOfError
OffsetAddress SLAVEREG ERROR
NumberOfRegisters NO_REG
SourceDataArea REG_WRIT
Representation Representation:
in IL CAL WRITE_REG_Instance (REQ:=StartWriteOnce,
SLAVEREG:=OffsetAddress, NO_REG:=NumberOfRegisters,
REG_WRIT:=SourceDataArea,
ADDRFLD:=DataStructureForTransfer,
DONE=>SetAfterWritingData, ERROR=>SetInCaseOfError,
STATUS=>ErrorCode)
Representation Representation:
in ST WRITE_REG_Instance (REQ:=StartWriteOnce,
SLAVEREG:=OffsetAddress, NO_REG:=NumberOfRegisters,
REG_WRIT:=SourceDataArea,
ADDRFLD:=DataStructureForTransfer,
DONE=>SetAfterWritingData, ERROR=>SetInCaseOfError,
STATUS=>ErrorCode) ;
33002527 233
WRITE_REG
Runtime error For a list of all block error codes and values, see Extended, p. 254.
234 33002527
WRITE_REG
33002527 235
WRITE_REG
236 33002527
WRITE_REG
Function mode
Function mode Although a large number of WRITE_REG function blocks can be programmed, only
of the four write operations may be active at the same time. In such a case it is insignificant
WRITE_REG whether they are the result of this function block or others (e.g. MBP_MSTR,
block CWRITE_REG). All function blocks use one data transaction path and require
multiple cycles to complete a job.
If several WRITE_REG function blocks are used within an application, they must at
least differ in the values of their NO_REG or REG_WRIT parameters.
Note: A TCP/IP communication between a Quantum PLC (NOE 211 00) and a
Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible,
when only one read or write job is carried out in every cycle. If several jobs are sent
per PLC cycle, the communication stops without generating an error message in
the status register of the function block.
The status signals DONE and ERROR report the function block state to the user
program.
All routing information is contained in the WordArr5 data structure of the ADDRFLD
input. The type function block assigned to this input is defined by the network used.
Please use:
l Modbus Plus for function block ModbusP_ADDR (See ModbusP_ADDR:
Modbus Plus Address, p. 131)
l TCP/IP Ethernet for function block TCP_IP_ADDR (See TCP_IP_ADDR: TCP/
IP Address, p. 211)
l SY/MAX Ethernet for function block SYMAX_IP_ADDR (See SYMAX_IP_ADDR:
SY/MAX IP Address, p. 207)
Note: The WordArr5 data structure can also be used with constants.
33002527 237
WRITE_REG
Parameter description
SLAVEREG Start of the area in the addressed slave to which the source data is written. The
source area always resides within the %MW address area.
REG_WRIT An ARRAY that is the same size as the planned transmission must be agreed upon
(≥ NO_REG) for this parameter. The name of this array is defined as a parameter. If
the array is defined too small, then only the amount of data is transmitted that is
present in the array.
The parameter must be defined as a located variable.
DONE Transition to ON state for one program scan signifies that the data has been
transferred.
The parameter can be entered as an address, located variable or unlocated
variable.
ERROR Transition to ON state for one program cycle signifies the detection of a new error.
The parameter can be entered as an address, located variable or unlocated
variable.
238 33002527
WRITE_REG
STATUS If an error occurs while the function is being executed, an error code remains at this
output for one cycle.
Error code, see
l Modbus Plus and SY/MAX Ethernet Error Codes, p. 122
l SY/MAX-specific error codes, p. 124
l TCP/IP Ethernet error codes, p. 126
The parameter can be entered as an address, located variable or unlocated
variable.
33002527 239
WRITE_REG
240 33002527
WRITE_VAR: Writing variables
28
At a Glance
33002527 241
WRITE_VAR
Description
Function The WRITE_VAR function is used to write one or more language objects of the same
Description type:
l internal bits,
l internal words.
The objects to be written must always be consecutive. They may be located in a
remote CPU or in a device connected to a communication channel of one of the
following types: Ethernet TCP/IP, Ethway, Uni-Telway, terminal port, Fipway,
Modbus, Modbus Plus, Ethway, Fipio.
The additional parameters EN and ENO can be configured.
FBD Representation:
representation
WRITE_VAR
Address ADR
Object_Type OBJ
First_Object NUM
Object_Number NB
Data_to_Write EMIS
Management_Param GEST GEST Management_Param
242 33002527
WRITE_VAR
LD Representation:
representation
WRITE_VAR
EN ENO
Address ADR
Object_Type OBJ
First_Object NUM
Object_Number NB
Data_to_Write EMIS
IL representation Representation:
LD Address
WRITE_VAR Object_Type, First_Object, Object_Number,
Data_to_Write, Management_Param
ST Representation:
representation WRITE_VAR(Address, Object_Type, First_Object, Object_Number,
Data_to_Write, Management_Param);
33002527 243
WRITE_VAR
Note: The length parameter must not be initialized before launching the function.
244 33002527
WRITE_VAR
At a Glance For this communication function, you can call up the assisted entry screen.
Illustration The following screen shows an example of the assisted entry screen of the function:
WRITE_VAR
Parameters
Address: ... ?
Type of Object to Write:
OK Cancel
Note: if you enter a value directly in the field, the assisted address entry button
turns gray.
33002527 245
WRITE_VAR
Note: simply choose from the solutions offered in the drop-down menu.
Note: if you enter a constant, an entry field appears to enter the constant. If you
enter a variable, it can be localised (See , p. 277) or not. On the other hand the
objects to be written are mandatory located variables.
Note: if you enter a constant, an entry field appears to enter the constant. If you
enter a variable, it can be localised or not.
Data to write The data to write zone is an integer array. The size of this array depends on the
number of objects to write. This integer array can be located or not.
Note: be careful not to use several identical memory areas for report tables,
otherwise the variable read function may not work.
246 33002527
WRITE_VAR
At a Glance Until now, the examples have been written using direct addressing (use of %MWi),
but it is also possible to create these same examples using unlocated variables.
The following example uses unlocated variables, and covers the writing of a 50-word
table named Tab_1 (declared as an ARRAY [0..49] OF INT) in the Uni-Telway
slave, with the address:
l Network 20
l Station 1
l SCM2116 module in a TSX 87 in slot 5 of the base rack
l Channel 1
l Server address of slave Ad0 = 3.
The values to write are in the variable Tab_1 of the sender.
The management parameters are located in a table of 4 integers called
Management_Parameter (declared as ARRAY [0..3] OF INT).
{20.2}
{20.1}
Uni-Telway
Ad0 = 3
Ad0 = 1
33002527 247
WRITE_VAR
WRITE_VAR(ADDR(’{20.1}0.5.1.3’),’%MW’,0,50,Tab_1,Management_
Parameter);
END_IF;
Request parameters:
Parameters Description
ADDR(’{20.1}5.1.3’) l {20.1}: network 20, station 1
l 0: rack
l 5: module
l 1: channel 1
l 3: destination address
’%MW’ Type of object (internal word)
0 address of the first object to write
50 Number of consecutive objects to write
Tab_1 Data to write
Management_Parameter Management table
248 33002527
WRITE_VAR
At a Glance The following example illustrates the WRITE_VAR function with a management
parameter check.
33002527 249
WRITE_VAR
250 33002527
Appendices
Introduction
33002527 251
Appendices
252 33002527
EFB Error Codes and Values
A
Overview
Introduction The following tables show the error codes and error values created for the EFBs of
the Communication Library.
33002527 253
EFB Error Codes and Values
Introduction The following tables show the error codes and error values created for the EFBs of
the Communication Library.
Extended Table of error codes and errors values created for EFBs of the Extended family.
EFB name Error code ENO Error Error Error description
state in value in value in
case of Dec Hex
error
CREAD_REG E_EFB_MSTR_ERROR F -30191 16#8A11 MSTR communication error
CREAD_REG E_EFB_NOT_STATE_ F -30531 16#88BD Variable not mapped to % MW (4x)
RAM_4X area
CREAD_REG - F 8195 16#2003 Value displayed in status word.
(Comes together with
E_EFB_MSTR_ERROR)
CREAD_REG - F 8206 16#200E Value displayed in status word.
Comes together with
E_EFB_NOT_STATE_RAM_4X
CREAD_REG - F - - See tables of :
l Modbus Plus and SY/MAX
EtherNet Error Codes (See
Modbus Plus and SY/MAX
Ethernet Error Codes, p. 122)
l SY/MAX specific Error Codes
(See SY/MAX-specific error
codes, p. 124)
l TCP/IP EtherNet Error Codes
(See TCP/IP Ethernet error
codes, p. 126)
CWRITE_REG E_EFB_MSTR_ERROR F -30191 16#8A11 MSTR communication error
CWRITE_REG - F 8195 16#2003 Value displayed in status word
Comes together with
E_EFB_MSTR_ERROR
CWRITE_REG - F 8206 16#200E Value displayed in status word
Comes together with
E_EFB_NOT_STATE_RAM_4X
254 33002527
EFB Error Codes and Values
33002527 255
EFB Error Codes and Values
256 33002527
EFB Error Codes and Values
Introduction The following table shows the commen error codes and error values created for
floating point errors.
33002527 257
EFB Error Codes and Values
258 33002527
System objects
B
At a Glance
Subject of this This chapter describes the system bits and words of Unity Pro language.
Chapter Note: The symbols, associated with each bit object or system word, mentioned in
the descriptive tables of these objects, are not implemented as standard in the
software, but can be entered using the data editor.
They are proposed in order to ensure the homogeneity of their names in the different
applications.
33002527 259
System objects
General The Premium, Atrium and Quantum PLCs use %Si system bits which indicate the
state of the PLC, or they can be used to control how it operates.
These bits can be tested in the user program to detect any functional development
requiring a set processing procedure.
Some of these bits must be reset to their initial or normal state by the program.
However, the system bits that are reset to their initial or normal state by the system
must not be reset by the program or by the terminal.
260 33002527
System objects
33002527 261
System objects
262 33002527
System objects
33002527 263
System objects
CAUTION
%S16 for Quantum PLCs
On Quantum, communication errors from modules (NOM, NOE, NWM,
CRA, CRP) and MMS modules are not reported on bits %S10 and
%S16.
It is entirely your responsibility to ensure that these system bits are used
correctly
Failure to follow this instruction can result in injury or equipment
damage.
264 33002527
System objects
33002527 265
System objects
266 33002527
Glossary
%IW According to the IEC standard, %IW indicates an analog input -type language object.
%KW According to the IEC standard, %KW indicates a constant word-type language object.
%MW According to the IEC standard, %MW indicates a memory word-type language object.
%QW According to the IEC standard, %QW indicates an analog output-type language
object.
ADDR_TYPE This predefined type is used as output for ADDR function. This type is ARRAY[0..5]
OF Int. You can find it in the libset, in the same family than the EFs which use it.
ANL_IN ANL_IN is the abbreviation of Analog Input data type and is used when processing
analog values. The %IW adresses for the configured analog input module, which
were specified in the I/O component list, are automatically assigned data types and
should therefore only be occupied with Unlocated Variables.
33002527 267
Glossary
ANL_OUT ANL_OUT is the abbreviation of Analog Output data type and is used when
processing analog values. The %MW adresses for the configured analog input
module, which were specified in the I/O component list, are automatically assigned
data types and should therefore only be occupied with Unlocated Variables.
ANY There is a hierarchy between the different types of data. In the DFB, it is sometimes
possible to declare which variables can contain several types of values. Here, we
use ANY_xxx types.
The following diagram shows the hierarchically-ordered structure:
ANY
ANY_ELEMENTARY
ANY_MAGNITUDE_OR_BIT
ANY_MAGNITUDE
ANY_NUM
ANY_REAL
REAL
ANY_INT
DINT, INT, UDINT, UINT
TIME
ANY_BIT
DWORD, WORD, BYTE, BOOL
ANY_STRING
STRING
ANY_DATE
DATE_AND_TIME, DATE, TIME_OF_DAY
EBOOL
ANY_DERIVED
ANY_ARRAY
ANY_ARRAY_ANY_EDT
ANY_ARRAY_ANY_MAGNITUDE
ANY_ARRAY_ANY_NUM
ANY_ARRAY_ANY_REAL
ANY_ARRAY_REAL
ANY_ARRAY_ANY_INT
ANY_ARRAY_DINT
ANY_ARRAY_INT
ANY_ARRAY_UDINT
ANNY_ARRAY_UINT
ANY_ARRAY_TIME
ANY_ARRAY_ANY_BIT
ANY_ARRAY_DWORD
ANY_ARRAY_WORD
ANY_ARRAY_BYTE
ANY_ARRAY_BOOL
ANY_ARRAY_ANY_STRING
ANY_ARRAY_STRING
ANY_ARRAY_ANY_DATE
ANY_ARRAY_DATE_AND_TIME
ANY_ARRAY_DATE
ANY_ARRAY_TIME_OF_DAY
ANY_ARRAY_EBOOL
ANY_ARRAY_ANY_DDT
ANY_STRUCTURE
ANY_DDT
ANY_IODDT
ANY_FFB
ANY_EFB
ANY_DFB
268 33002527
Glossary
Base 10 literals A literal value in base 10 is used to represent a decimal integer value. This value can
be preceded by the signs "+" and "-". If the character "_" is employed in this literal
value, it is not significant.
Example:
-12, 0, 123_456, +986
Base 16 Literals An literal value in base 16 is used to represent an integer in hexadecimal. The base
is determined by the number "16" and the sign "#". The signs "+" and "-" are not
allowed. For greater clarity when reading, you can use the sign "_" between bits.
Example:
16#F_F or 16#FF (in decimal 255)
16#F_F or 16#FF (in decimal 224)
Base 2 Literals A literal value in base 2 is used to represent a binary integer. The base is determined
by the number "2" and the sign "#". The signs "+" and "-" are not allowed. For greater
clarity when reading, you can use the sign "_" between bits.
Example:
2#1111_1111 or 2#11111111 (in decimal 255)
2#1110_0000 or 2#11100000 (in decimal 224)
Base 8 Literals A literal value in base 8 is used to represent an octal integer. The base is determined
by the number "8" and the sign "#". The signs "+" and "-" are not allowed. For greater
clarity when reading, you can use the sign "_" between bits.
Example:
8#3_77 or 8#377 (in decimal 255)
8#34_0 or 8#340 (in decimal 224)
33002527 269
Glossary
BOOL BOOL is the abbreviation of Boolean type. This is the elementary data item in
computing. A BOOL type variable has a value of either: 0 (FALSE) or 1 (TRUE).
A BOOL type word extract bit, for example: %MW10.4.
BYTE When 8 bits are put together, this is callad a BYTE. A BYTE is either entered in
binary, or in base 8.
The BYTE type is coded in an 8 bit format, which, in hexadecimal, ranges from
16#00 to 16#FF
DATE The DATE type coded in BCD in 32 bit format contains the following information:
l the year coded in a 16-bit field,
l the month coded in an 8-bit field,
l the day coded in an 8-bit field.
The DATE type is entered as follows: D#<Year>-<Month>-<Day>
This table shows the lower/upper limits in each field:
DATE_AND_ see DT
TIME
270 33002527
Glossary
33002527 271
Glossary
272 33002527
Glossary
Representation examples:
EBOOL EBOOL is the abbrevation of Extended Boolean type. A EBOOL type variable brings
a value (0 (FALSE) or 1 (TRUE) but also rising or falling edges and forcing
capabilities.
An EBOOL type variable takes up one byte of memory.
The byte split up into:
l one bit for the value,
l one bit for the history bit (each time the state’s object changes, the value is copied
inside the history bit),
l one bit for the forcing bit (equals to 0 if the object isn’t forced, equal to 1 if the bit
is forced.
The default type value of each bit is 0 (FALSE).
33002527 273
Glossary
Elementary see EF
Function
ENO ENO means Error NOtification, this is the output associated to the optional input EN.
If ENO is set to 0 (caused by EN=0 or in case of an execution error),
l the outputs of function blocks remain in the status they were in for the last correct
executed scanning cycle and
l the output(s) of functions and procedures are set to "0".
274 33002527
Glossary
FFB Collective term for EF (Elementary Function), EFB (Elementary Function Block) and
DFB (Derived Function block)
Function see EF
GRAY Gray or "reflected binary" code is used to code a numerical value being developed
into a chain of binary configurations that can be differentiated by the change in
status of one and only one bit.
This code can be used, for example, to avoid the following random event: in pure
binary, the change of the value 0111 to 1000 can produce random numbers between
0 and 1000, as the bits do not change value altogether simultaneously.
Equivalence between decimal, BCD and Gray:
Decimal 0 1 2 3 4 5 6 7 8 9
BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Gray 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101
33002527 275
Glossary
-INF INF
Integer Literals Integer literal are used to enter integer values in the decimal system. The values can
have a preceding sign (+/-). Individual underlines (_ ) between numbers are not
significant.
Example:
-12, 0, 123_456, +986
276 33002527
Glossary
Located A located variable is a variable for which it is possible to know its position in the PLC
variables memory. For example, the variable Water_pressure, is associated with%MW102.
Water_pressure is said to be localized.
Multiple Token Operating mode of an SFC. In multitoken mode, the SFC may possess several
active steps at the same time.
33002527 277
Glossary
Naming An identifier is a sequence of letters, numbers and underlines beginning with a letter
conventions or underline (e.g. name of a function block type, an instance, a variable or a section).
(Identifier) Letters from national character sets (e.g: ö,ü, é, õ) can be used except in project and
DFB names. Underlines are significant in identifiers; e.g. A_BCD and AB_CD are
interpreted as different identifiers. Multiple leading underlines and consecutive
underlines are invalid.
Identifiers cannot contain spaces. Not case sensitive; e.g. ABCD and abcd are
interpreted as the same identifier.
According to IEC 61131-3 leading digits are not allowed in identifiers. Nevertheless,
you can use them if you activate in dialog Tools → Project settings in tab
Language extensions the ceck box Leading digits.
Identifiers cannot be keywords.
NAN Used to indicate that a result of an operation is not a number (NAN = Not A Number).
Example: calculating the square root of a negative number.
Note: The IEC 559 standard defines two classes of NAN: quiet NAN (QNAN) and
signaling NaN (SNaN) QNAN is a NAN with the most significant fraction bit set and a
SNAN is a NAN with the most significant fraction bit clear (Bit number 22). QNANs
are allowed to propagate through most arithmetic operations without signaling an
exception. SNAN generally signal an invalid-operation exception whenever they
appear as operands in arithmetic operations (See %SW17 and %S18).
278 33002527
Glossary
Procedure Procedures are functions view technically. The only difference to elementary
functions is that procedures can take up more than one output and they support data
type VAR_IN_OUT. To the eye, procedures are no different than elementary
functions.
Procedures are a supplement to IEC 61131-3.
-INF INF
Note: The IEC 559 standard defines two classes of NAN: quiet NAN (QNAN) and
signaling NaN (SNaN) QNAN is a NAN with the most significant fraction bit set and a
SNAN is a NAN with the most significant fraction bit clear (Bit number 22). QNANs
are allowed to propagate through most arithmetic operations without signaling an
exception. SNAN generally signal an invalid-operation exception whenever they
appear as operands in arithmetic operations (See %SW17 and %S18).
Real Literals An literal real value is a number expressed in one or more decimals.
Example:
-12.0, 0.0, +0.456, 3.14159_26
33002527 279
Glossary
Real Literals with An Literal decimal value can be expressed using standard scientific notation. The
Exponent representation is as follows: mantissa + exponential.
Example:
-1.34E-12 or -1.34e-12
1.0E+6 or 1.0e+6
1.234E6 or 1.234e6
Single Token Operating mode of an SFC chart for which only a single step can be active at any
one time.
STRING A variable of the type STRING is an ASCII standard character string. A character
string has a maximum length of 65534 characters.
TIME The type TIME expresses a duration in milliseconds. Coded in 32 bits, this type
makes it possible to obtain periods from 0 to 2 32-1 milliseconds.
The units of type TIME are the following: the days (d), the hours (h), the minutes (m),
the seconds (s) and the milliseconds (ms). A literal value of the type TIME is
represented by a combination of previous types preceded by T#, t#, TIME# or
time#.
Examples: T#25h15m, t#14.7S, TIME#5d10h23m45s3ms
280 33002527
Glossary
Time literals The units of type TIME are the following: the days (d), the hours (h), the minutes (m),
the seconds (s) and the milliseconds (ms). A literal value of the type TIME is
represented by a combination of previous types preceded by T#, t#, TIME# or
time#.
Examples: T#25h15m, t#14.7S, TIME#5d10h23m45s3ms
Example: TOD#23:59:45.
TOPO_ADDR_ This predefined type is used as output for READ_TOPO_ADDR function. This type
TYPE is an ARRAY[0..4] OF Int. You can find it in the libset, in the same family than the
EFs which use it.
33002527 281
Glossary
UDINT UDINT is the abbreviation of Unsigned Double Integer format (coded on 32 bits)
unsigned. The lower and upper limits are as follows: 0 to (2 to the power of 32) - 1.
Example:
0, 4294967295, 2#11111111111111111111111111111111, 8#37777777777,
16#FFFFFFFF.
UINT UINT is the abbreviation of Unsigned integer format (coded on 16 bits). The lower
and upper limits are as follows: 0 to (2 to the power of 16) - 1.
Example:
0, 65535, 2#1111111111111111, 8#177777, 16#FFFF.
Unlocated An unlocated variable is a variable for which it is impossible to know its position in
variable the PLC memory. A variable which have no address assigned is said to be
unlocated.
Variable Memory entity of the type BOOL, WORD, DWORD, etc., whose contents can be modified
by the program during execution.
282 33002527
Glossary
WORD The WORD type is coded in 16 bit format and is used to carry out processing on bit
strings.
This table shows the lower/upper limits of the bases which can be used:
Representation examples
33002527 283
Glossary
284 33002527
Index
B
AC
Symbols C
%S15, 261 CANCEL, 45, 48
%S16, 261 CARRY, 261
%S17, 261 Communication
%S18, 262, 263 ADDR, 43
%S19, 262, 263 CANCEL, 45
%S20, 264 DATA_EXCH, 65
%S21, 264 INPUT_BYTE, 75
%SW12, 265 INPUT_CHAR, 79
%SW13, 265 Length, 38
%SW14, 265 Management table, 32
%SW15, 265 OUT_IN_CHAR, 137
%SW16, 265 PRINT_CHAR, 145
%SW17, 266 RCV_TLG, 153
%SW18, 266 READ_ASYN, 157
%SW19, 266 READ_GDATA, 161
READ_VAR, 171
Report, 32
Numerics SEND_REQ, 185
100MSCOUNTER, 266 SEND_TLG, 201
1RSTTASKRUN, 264 UNITE_SERVER, 217
WRITE_ASYN, 223
WRITE_GDATA, 227
A WRITE_VAR, 241
ADDR, 43 Conditional FFB Call, 19
Address conversion constant word, 191
ADDR, 43 Continuous register reading
CREAD_REG, 49
Continuous register writing
B CWRITE_REG, 57
Block types, 14 CREAD_REG, 49
CWRITE_REG, 57
33002527 285
Index
D Extensions
ADDR, 43
DATA_EXCH, 65
CANCEL, 45
Assisted entry, 69
DATA_EXCH, 65
Example, 71
INPUT_BYTE, 75
Derived function block, 14
INPUT_CHAR, 79
OUT_IN_CHAR, 137
E PRINT_CHAR, 145
RCV_TLG, 153
Elementary Function, 14 READ_ASYN, 157
Elementary function block, 14 READ_GDATA, 161
EN, 18 READ_VAR, 171
ENO, 18 SEND_REQ, 185
Error Codes, 253 SEND_TLG, 201
Error Values, 253 UNITE_SERVER, 217
ETY WRITE_ASYN, 223
constant word, 191 WRITE_GDATA, 227
Example, 48, 143 WRITE_VAR, 241
Exchanging data between applications
DATA_EXCH, 65
Expanded F
ModbusP_ADDR, 131
FLOATSTAT, 266
SYMAX_IP_ADDR, 207
Extended
CREAD_REG, 49 I
CWRITE_REG, 57
Immediate server
MBP_MSTR, 87
UNITE_SERVER, 217
READ_REG, 163
INDEXOVF, 264
TCP_IP_ADDR, 211
INPUT_BYTE, 75
WRITE_REG, 231
INPUT_CHAR, 79
Assisted entry, 83
Example, 85
IOERRTSK, 261
L
Located variables
Communication, 26
286 33002527
Index
M Reading object
Shift in a table, 200
Management parameters, 32
Reading variables
Management table, 32
READ_VAR, 171
MBP_MSTR, 87
Receiving character strings
Modbus Plus Address
INPUT_BYTE, 75
ModbusP_ADDR, 131
INPUT_CHAR, 79
Modbus Plus Master
Receiving telegrams
MBP_MSTR, 87
RCV_TLG, 153
ModbusP_ADDR, 131
Report, 32, 34
ROR1_ARB
O with SEND_REQ, 200
OSCOMMPATCH, 265
OSCOMMVERS, 265 S
OSINTVERS, 265
SEND_REQ, 185
OUT_IN_CHAR, 137, 143
Assisted entry, 195
Assisted entry, 141
Example, 197
OVERFLOW, 262, 263
SEND_REQ block
OVERRUN, 262, 263
IP parameters, 199
SEND_TLG, 201, 202
Example, 205
P Sending character strings
PRINT_CHAR, 145 PRINT_CHAR, 145
Assisted entry, 149 Sending requests
Example, 150 SEND_REQ, 185
Procedure, 14 Sending telegrams
SEND_TLG, 201
Sending/receiving character strings
R OUT_IN_CHAR, 137
RCV_TLG, 153 Server, 39
Example, 156 Shift in a table, 200
Read Register Stopping an exchange in progress
READ_REG, 163 CANCEL, 45
READ_ASYN, 157 STRINGERROR, 261
READ_GDATA, 161 Structure
READ_REG, 163 Communication function, 30
READ_VAR, 171 SY/MAX-IP Address
Assisted entry, 176 SYMAX_IP_ADDR, 207
Example, 178, 180 SYMAX_IP_ADDR, 207
Execution check, 184
Network example, 182
Reading data asynchronously
READ_ASYN, 157
Reading Modbus Plus Global Data
READ_GDATA, 161
33002527 287
Index
T W
TCP/IP address Write Register
TCP_IP_ADDR, 211 WRITE_REG, 231
TCP_IP_ADDR, 211 WRITE_ASYN, 223
Timeout, 38 WRITE_GDATA, 227
WRITE_REG, 231
WRITE_VAR, 241, 242
U Assisted entry, 245
Unconditional FFB Call, 19 Example, 247
UNI-TE requests, 190 Example of how to check execution, 249
UNITE_SERVER, 217 Writing data asynchronously
Example, 222 WRITE_ASYN, 223
UTWPORTADDR, 265 Writing the Global Data Modbus Plus
WRITE_GDATA, 227
Writing variables
WRITE_VAR, 241
X
XWAYNETWADDR, 265
288 33002527