All brand and product names are trademarks
or registered trademarks of the owner
concerned.
All rights reserved, including those of the
translation.
No part of this manual may be reproduced in
any form (printed, photocopy, microfilm or
any otherprocess) or processed, duplicated or
distributed by means of electronic systems
without written permission of Moeller GmbH,
Bonn.
Subject to alterations without notice.
Warning!
Dangerous electrical voltage!
Before commencing the installation
• Disconnect the power supply of the device.
• Ensure that devices cannot be accidentally
restarted.
• Verify isolation from the supply.
• Earth and short circuit.
• Cover or enclose neighbouring units that
are live.
• Follow the engineering instructions (AWA)
of the device concerned.
• Only suitably qualified personnel in
accordance with EN 50110-1/-2
(VDE 0105 Part 100) may work on this
device/system.
• Before installation and before touching
the device ensure that you are free of
electrostatic charge.
• The functional earth (FE) must be
connected to the protective earth (PE) or
to the potential equalisation. The system
installer is responsible for implementing
this connection.
• Connecting cables and signal lines should
be installed so that inductive or capacitive
interference do not impair the automation
functions.
• Install automation devices and related
operating elements in such a way that they
are well protected against unintentional
operation.
• Suitable safety hardware and software
measures should be implemented for the
I/O interface so that a line or wire breakage
on the signal side does not result in
undefined states in the automation
devices.
• Ensure a reliable electrical isolation of the
low voltage for the 24 volt supply. Only
use power supply units complying with
IEC 60364-4-41 (VDE 0100 Part 410) or
HD 384.4.41 S2.
• Deviations of the mains voltage from the
rated value must not exceed the tolerance
limits given in the specifications, otherwise
this may cause malfunction and dangerous
operation.
• Emergency stop devices complying with
IEC/EN 60204-1 must be effective in all
operating modes of the automation
devices. Unlatching the emergency-stop
devices must not cause restart.
• Devices that are designed for mounting in
housings or control cabinets must only be
operated and controlled after they have
been installed with the housing closed.
Desktop or portable units must only be
operated and controlled in enclosed
housings.
Moeller GmbH
Safety instructions
I
• Measures should be taken to ensure the
proper restart of programs interrupted
after a voltage dip or failure. This should
not cause dangerous operating states even
for a short time. If necessary, emergencystop devices should be implemented.
• Wherever faults in the automation system
may cause damage to persons or property,
external measures must be implemented to
ensure a safe operating state in the event
of a fault or malfunction (for example, by
means of separate limit switches,
mechanical interlocks etc.).
II
02/02 AWB27-1300-GB
Contents
About This Manual3
List of revisions3
1General5
Application field5
Hardware and software requirements7
2Data Arrays of the Function Blocks9
Data exchange principle9
Data array size11
Data array structure13
– One-dimensional data arrays for TCMT1zB0/U0 13
– Three-dimensional data arrays for TCMT1zU2/U5 14
Assigning the data array parameters15
– Default parameters 15
– Changing parameters 19
– Examples 19
Working with data arrays21
– Writing data array elements
(in the user program) 21
– Reading data array elements
(in the user program) 22
– Data array access for fixed-length frames 22
– Data array access for variable length frames 22
– Transferring status information 23
1
Contents
02/02 AWB27-1300-GB
3Function Blocks25
Overview25
–Type code 26
Installation27
– Directory structure 27
– Selecting the function blocks 28
– Code/data size, cycle time requirements 28
– Installation procedure 29
Integrating the parameter function block
in the user program30
– Setting for Suconet mode 32
Parameter function block34
– Description of the outputs 40
– Description of the parameters of array
Dial-up function blocks67
Telecontrol function blocks69
– Local error messages 69
– Error codes of the partner station 71
6Data Transmission Example75
Glossary77
Index79
2
02/02 AWB27-1300-GB
List of revisions
About This Manual
This manual describes how to install and how to assign
parameters to the application modules for telecontrol cards/
modules that communicate with one another via a dial-up
line in accordance with IEC/EN 60870-5.
Other manuals (AWBs)
The following manuals on telecontrol are also available:
Hardware and engineering
ZB4-501-TC1/TC2 telecontrol module
AWB27-1297-GB
Telecontrol via a leased line,
S40-AM-TD application module
AWB27-1301-GB
Edition
date
02/02Gen.Complete revision, protection and
PageDescriptionNewModi-
GSM function description added to
application module
Omitted
fied
x
3
02/02 AWB27-1300-GB
4
02/02 AWB27-1300-GB
1 General
Application fieldThe S40-AM-TD application module, version 2.0, provides a
range of different function blocks. These function blocks
form the interface between telecontrol modules and the user
program in the PLC. They support the configuration of
telecontrol stations that are interconnected via a dial-up line
system. A telecontrol station consists of:
•PLC
• ZB4-501-TC1/-TC2 telecontrol module; only ZB4-501-TC1
telecontrol modules version 03 or higher can be used. It
must also be remembered that this module can only be
connected to PS4 controllers and that the address is
permanently set to 2.
• Dial-up modem; The use of a wireless modem on the
PS416-TCS-200 controller is not supported by the
hardware and software.
All telecontrol stations have the same rights. This means that
each station can establish a connection with another station
via a dial-up modem. Normally data is collected from several
remote stations in a central station and processed.
Depending on how the parameters are set, the stations can
have the same performance capabilities and provide all
services available. Alternatively, a station’s parameters can
be set so that only basic services can be carried out.
5
General
02/02 AWB27-1300-GB
Figure 1 shows the structure of a telecontrol system with
Moeller components. In this example, a station with two
remote stations communicates via a dial-up line.
Station A
=
PS416
CPU
POW
>
?
>
Station BStation C
PS4-200PS4-300
A
Suconet K
Figure 1: Telecontrol system with communication via a dial-up line
a Station (PS416 with ZB4-501-TC2 telecontrol module)
b Dial-up modem
c Dial-up line
d Outstation
(PS4-300 with ZB4-501-TC1/-TC2 telecontrol module)
e Outstation
(PS4-200 with ZB4-501-TC1/-TC2 telecontrol module)
h
The PS4-200 is only suitable in part as a dial-up station
@
>
since the program with the dial-up and the data module
requires approx. 45 Kbytes of code.
6
02/02 AWB27-1300-GB
Hardware and
software requirements
Hardware and
software requirements
Table 1 provides an overview of the hardware and software
requirements for using PS4 or PS416 controllers.
Table 1:Hardware and software requirements
Type/version
S40-AM-TD
Function block type
Sucosoft S40
ZB4-501-TC1
PS416-TCS-200
ZB4-501-TC2
Memory expansion
required
1) The S40-AM-TD application module, version 2.0, also contains
1)
the function blocks of version 1.2.
PS4-150/-200/-300PS416
2.02.0
TCMT1zxxTCMT1zxx
from 4.0from 4.0
03–
––
0101
with PS4-150/-200–
7
02/02 AWB27-1300-GB
8
02/02 AWB27-1300-GB
2 Data Arrays of the Function Blocks
Data exchange principleData is exchanged between stations via “byte” type data
arrays. This means that data formatted differently in the
application must be converted prior to entry in the data
array. Conversely, array elements must be converted to the
data format of the application before they can be read.
The following example illustrates data exchange between
a station and two remote partner stations.
The “TCMT1zU2/U5“ function blocks provide all functions,
whilst the “TCMT1zB0“ function block only provides the
basic service “Send/Read Fixed Length Data”.
h
The “z” in the function block designation is the
placeholder for either a = asynchronous or
b = synchronous.
9
Data Arrays of the
Function Blocks
02/02 AWB27-1300-GB
ab
SD
1
CR = 1
:
RD
1
SD
1
CR = 1
RD
1
Max. 13 Kbyte
:
Max. 13 Kbyte
c
10
RD
256
SD
256
CR = 256
SD
CR = 256
Figure 2: Data exchange
a Station: PS416
function block: TCMT1zU2/U5
b Station: PS4-300
function block: TCMT1zU2/U5
c Station: PS4-200
function block: TCMT1zB0
SD = Send data
RD = Receive data
CR = Number of the communication channel
256
RD
256
Max. 6.5 Kbyte
02/02 AWB27-1300-GB
Data array size
Data array sizeThe size of the data arrays depends on the function block
type selected:
If the “TCMT1zB0“ or “TCMT1zU0“ function blocks are
selected, the data array is one-dimensional and is 1 to
220 bytes for send and receive data (a fig. 3).
The data arrays in function blocks “TCMT1zU2“ and “U5“
are three-dimensional. These are defined by using the
parameters subaddress (0 to 255) and “offset address” (0 to
219) of type UINT (a fig. 4). The third parameter specifies
the number of remote partner stations.
Separate data arrays are defined for all send and receive
data. In the example, the 256 send data arrays and 256
receive data arrays would be for the central station and one
send and receive data array for each of the 256 partner
stations. Ensure that the size of the send data array in the
central station is the same as the size of the receive data
array in the partner station and vice versa. In the example
therefore, the number of SD
central station must be the same as the number of RD
send data units from the
1
1
receive data units of the partner station.
The maximum size of all data arrays in a station is approx.
6.5 Kbyte for PS4-150/-200 and 13 Kbyte for a PS4-300/
PS416. In a central station this available range must be
shared equally amongst all other stations of the telecontrol
line.
11
Data Arrays of the
Function Blocks
02/02 AWB27-1300-GB
With a PS416 or PS4-300 controller as the central station,
the maximum available range (send and receive data arrays)
is therefore calculated as follows:
Maximum data volume per partner station =
When assigning offset addresses and subaddresses, make
sure that the maximum available data volume is not
exceeded.
Offset addresses x Subaddresses (send data array)
+ Offset addresses x Subaddresses (receive data array)
= Data volume F Maximum data volume per partner station
13 Kbyte
Number of partner stations in the telecontrol line
12
02/02 AWB27-1300-GB
Data array structure
Data array structureOne-dimensional data arrays for TCMT1zB0/U0
These function blocks allow two stations to be connected.
The “TCMT1zB0“ function block supports service 17 (send/
Figure 3: Structure of the send and receive data array
a Send data array
b Receive data array
13
Data Arrays of the
Function Blocks
02/02 AWB27-1300-GB
Three-dimensional data arrays for TCMT1zU2/U5
These function blocks allow several stations to be
connected. They can perform all available services.
A two-dimensional array is provided for each station so that
the entire data array range is classified as three-dimensional.
Offset address
219
219
:
90
80
70Data range for fixed length frames
60
50
40
30
20
10
0
01234567...255
(offset for fixed length frames is always 0)
Byte
Receive data array (Rec_dat)
Send data array (Tra_dat)
Figure 4: Structure of the send and receive data arrays
Subaddress:
Specifies the number of available offset address ranges.
Offset address:
Specifies the maximum number of bytes in a subaddress.
255
Subaddress
14
02/02 AWB27-1300-GB
Assigning the data array
parameters
Assigning the data array
parameters
Default parameters
The function blocks are supplied with default parameters for
a data transfer of 20 bytes of send and receive data.
These data arrays are already set up in the variable
declaration of the function blocks. They may have to be
adjusted, however, if the default parameters are not exactly
as required.
One-dimensional data arrays for TCMT1zB0/U0
The function blocks have the following data array basic
settings and range limits:
VAR_INPUT
tra_dat: ARRAY[0..219] OF BYTE ;
END_VAR
VAR_OUTPUT
rec_dat: ARRAY[0..219] OF BYTE ;
END_VAR
With function block TCMT1zB0
VAR
ui_ar_daten_parameter : ARRAY[5..5] OF UINT:=
[020];
END_VAR
With function block TCMT1zU0
VAR
ui_ar_daten_parameter : ARRAY[1..5] OF UINT:=
[255,255,220,220,020];
END_VAR
15
Data Arrays of the
02/02 AWB27-1300-GB
Function Blocks
tra_dat Send data array
rec_dat Receive data array
ui_ar_daten_parameter : Array content of “ui_ar_daten_parameter”: ARRAY[5..5]
Byte No.ParameterRangeDefault value
5Fixed_length1 to 22020
ui_ar_daten_parameter : Array content of “ui_ar_daten_parameter”: ARRAY[1..5]
1) Tra_sub_max/Rec_sub_max:
No subaddress is required as the data arrays are onedimensional. With variable length frames, the data entered
instead of the subaddress and offset address is transferred
transparently. This can be used on the partner station to check
the Subaddress value. If, for example, the sent “Subaddress”
value is less than the set address of the partner station, this
station will send a negative acknowledgement.
2) Tra_dfl_max/Rec_dfl_max:
Both parameters have default value 220, which can be adjusted
accordingly for the application concerned. The values for
“Tra_dfl_max/Rec_dfl_max” must be the same as the number
of offset addresses of the array “tra_dat/rec_dat”!
Example: Tra_dfl_max = 220 => tra_dat = 0 to 219
3) Fixed_length:
If service 17 is executed (send/read fixed length RAM data),
parameters xxx_dfl_max must f fixed_length.
1) Dfn_max:
Number of stations with which to communicate.
2) Tra_sub_max:
The maximum value of the subaddresses of the send data array
“tra_dat” must be entered for “tra_sub_max”.
3) Rec_sub_max:
The maximum value of the subaddresses of the receive data
array “rec_dat” must be entered for “rec_sub_max”.
4) Tra_dfl_max:
The maximum offset address of all send “tra_dat” data arrays
must be entered for “tra_dfl_max”.
5) Rec_dfl_max:
The maximum offset address of all receive data arrays
“rec_dat” must be entered for “rec_dfl_max”.
6) Fixed_length:
Data length of a fixed length frame (service 17). If service 17 is
executed (send/read fixed length RAM data), parameters
xxx_dfl_max must f fixed_length.
18
The following shows which parameters can be adapted.
02/02 AWB27-1300-GB
Assigning the data array
parameters
Changing parameters
The set data array parameters can be modified in the
following way:
XSave the function block under another name.
XChange the desired parameters in the variables
declaration.
XCheck your changes by checking syntax using (ALT+F10).
The modified function block is available for further use in the
list of application-specific function blocks.
Examples
Two remote partner stations are connected to a central
station via a dial-up modem. The partner stations only
communicate via the central station. The central station
sends 5 bytes to the partner stations (service 12) and
receives 30 bytes from them (service 15). To do this, the
following settings must be made in the variables
declarations of the central and partner stations:
Central station
The function block “TCMT1zU2“ is used for the central
station. The above-mentioned parameters result in a 70 byte
data memory requirement.
19
Data Arrays of the
02/02 AWB27-1300-GB
Function Blocks
Declaration:
VAR_INPUT
requested_station : USINT(1..2) ;
tra_dat: ARRAY[1..2, 0..0, 0..4] OF BYTE ; (*Send data array (station number,
subaddresses, offset addresses)*)
END_VAR
VAR_OUTPUT
rec_dat: ARRAY[1..2, 0..0, 0..29] OF BYTE ; (*Receive data array (station number,
END_VAR
VAR
ui_ar_daten_parameter : ARRAY[0..5] OF UINT:= [2,0,0,5,30,0];
END_VAR
subaddresses, offset addresses)*)
Partner station
The function block “TCMT1zU0“ is used for both partner
stations. The above-mentioned parameters result in a
35 byte memory requirement.
Declaration:
VAR_INPUT
requested_station : USINT(1..1) ;
tra_dat: ARRAY[0..29] OF BYTE ; (*Send data array*)
END_VAR
VAR_OUTPUT
rec_dat: ARRAY[0..4] OF BYTE ; (*Receive data array*)
END_VAR
VAR
ui_ar_daten_parameter : ARRAY[1..5] OF UINT:= [0,0,30,5,0];
END_VAR
20
02/02 AWB27-1300-GB
Working with data arrays
Working with data arraysThe next section describes how to read or write data arrays
using the example of the send and receive data arrays of a
central station.
Ensure that all the array indices (subscripts) are within the
limits when accessing data arrays. If the array index
(subscript) limits are exceeded, the controller will “Halt“ and
the “Not-Ready“-LED will light up.
The data arrays were defined as follows in the variables
declaration for the parameter function block:
VAR_INPUT
tra_dat: ARRAY[1..2, 0..0, 0..29] OF BYTE ; (*Send data array (station number,
subaddresses, offset addresses)*)
END_VAR
VAR_OUTPUT
rec_dat: ARRAY[1..2, 0..0, 0..4] OF BYTE ; (*Receive data array (station number,
subaddresses, offset addresses)*)
END_VAR
Writing data array elements (in the user program)
To save the constant “5” in the array element [station “2”,
subaddress “0”, offset address “3”] of the send data array,
proceed as follows:
LD 5
ST Instance_name.tra_dat [2,0,3]
.
.
END_PROGRAM
21
Data Arrays of the
Function Blocks
02/02 AWB27-1300-GB
Reading data array elements (in the user program)
The content of the station “2”, subaddress “0” and offset
address “3” array element of the receive data array is stored
under the variable “VALUE_1”.
When data is transmitted using fixed length frames, only the
data array range for subaddress “0” is defined. The data is
read and written under the parameter “fixed_length”,
starting with “tra_source_offset” = 0 up to the maximum
length.
Data array access for variable length frames
All the elements of the data array can be accessed with
variable length frames. The subaddress “tra_ subaddress”,
offset address “tra_source_offset” and/or
“tra_destination_offset” and user data length
“tra_variable_length” function block inputs can be used to
access any elements of a subaddress, from one byte up to
the entire data array length.
02/02 AWB27-1300-GB
Working with data arrays
Transferring status information
“User_status” bits are used to transfer up to four bits of
information and are transferred with every service. If status
changes are detected at the function block inputs
“user_status_1” to “user_status_4” of the telecontrol
station concerned while a service is being processed, the
inputs will be automatically updated in the array of
“user_status” bits at the partner station.
“User_status” bits can be used to transfer bit data, such as
battery monitoring (DBM) to the partner station without the
need for a separate service.
Active stationpassive station_1
user_status_1_2_3_4_1_2_3_4
Outstation_1
Outstation_2passive station_2
Outstation_n
23
02/02 AWB27-1300-GB
24
02/02 AWB27-1300-GB
3 Function Blocks
OverviewThe function blocks of the S40-AM-TD application module
make it easier to program the data transfer between the PLC
and telecontrol modules.
Three types of function blocks are provided:
• Dial-up function block
• Telecontrol function block
• Parameter function block
The dial-up function block performs the following functions:
• Modem initialisation
• Establishment and clearing of the connection to
partner station
• Connection monitoring
• Redial within the set time frame
• Display of modem signals
The telecontrol function block carries out the communi-
cation services and monitors the execution of a service.
The parameter function block is used to declare the dialup and telecontrol function block and contains the calls for
these function blocks. The dial-up and telecontrol function
blocks cannot be processed directly. Their parameters are set
via the parameter function block. Dial-up and telecontrol
function blocks are provided in the form of a LIB file.
Depending on the capabilities of the PLCs, there are several
parameter and telecontrol function blocks that are matched
to each other. These parameter and telecontrol function
blocks vary according to the number of services and partner
stations they support. The dial-up function block is the same
for all.
The function blocks with basic services enable a
connection for sending and reading data between two
stations.
25
Function Blocks
02/02 AWB27-1300-GB
The function blocks with universal services provide all
services available. They vary in the number of stations they
support.
1) from version 03
B = Basic service, U = Universal service, Ps = Partner station
Type code
The type code of the parameter function blocks consists of
the following:
TCMTX z X X
26
Variant 0 for 1 partner station
Variant 2 for 4 partner stations
Variant 5 for 32 partner stations
Variant B – Basic services
Variant U – Universal services
A = asynchronous
S = synchronous
Type 1 – Dial-up line
Figure 5: Type code for function block selection
02/02 AWB27-1300-GB
InstallationDirectory structure
All the files of the module are on the S40-AM-TD diskette.
DirectoryFilesContent
–read_me.ger
read_me.eng
read_me.fra
VER_12BS4T1_U0 to U4
S4T01_U0 to U5
TCD_UNI
TCD_KE28
TCD_KE64
TCD_WE32
ExamplePS4_D(F,GB)
PS416_D (F,GB)
VER_20ATCMT1zB0.POE
TCMT1zU0.POE
TCMT1zU2.POE
TCMT1zU5.POE
ExamplePS4_D(F,GB)
PS341_D(F,GB)
PS416_D(F,GB)
LibraryTCM_TD_2 (PS4-200)
TCM_TD_3 (PS4-300)
TCM_TD_4 (PS416)
Files of the original S40-AM-TD V1.2B module.
This module is described in the online manual
04/00 AWB27-1300-GB (www.moeller.net
r support).
Example program
Parameter function blocks
Example program
Library files; these files contain the following
function blocks:
• TCM_DIAL dial-up module
• TCM_T1B0 Basic module data
• TCM_T1U0 Universal module data
• TCM_T1U2 Universal module data
• TCM_T1U5 Universal module data
TC2_TD ZB4_501_TC1/2 driver
Installation
27
Function Blocks
02/02 AWB27-1300-GB
Selecting the function blocks
Install both the parameter function blocks in the form of a
POU file (.POE) as well as the library file (.LIB) containing the
dial-up and telecontrol function blocks. A library file is
provided for every PLC type. After installation no other
measures are required for the library files.
Example
For example, to incorporate a universal function block with
four communication channels for a PS4-300 in synchronous
mode with the ZB4-501-TC2 telecontrol module, the
following programs in the table must be installed:
• FB file: TCMT1zU2.POE
• Library file: TCM_TD_3.LIB
After the installation you can integrate the function blocks in
your user program (a page 30). Remember that it must be
called in each program cycle.
Code/data size, cycle time requirements
The specifications apply to the example programs with the
default data array sizes in a passive state. With an active
data channel this time requirement will change according to
the service concerned and can therefore only be determined
in the overall application.
Installation procedure
Parameter function blocks (.POE)
XCopy the parameter function block TCMT1zXX.POE to the
Source directory of your project.
XChoose ‹Edit r Register Sources› in the S40 Project
Manager to register the function block.
Dial-up and telecontrol function blocks (library files)
Carry out the following steps to import a (library) file into
your current project with the S40-NAVIGATOR:
XSpecify the PLC type in the selection window shown in the
NAVIGATOR toolbar.
XChoose ‹Options r Library r Import›.
XSelect the library file (e.g. from drive “A“) and confirm the
step with “OK“.
A message will indicate that the file was successfully
imported.
Refer to the manual Sucosoft S40 User Guide
(AWB2700-1305-GB), section “Using libraries” for more
information on using the library files.
29
Function Blocks
02/02 AWB27-1300-GB
Integrating the parameter
function block in the user
program
The following overview shows the interrelationship between
the user program and the function blocks. Some important
parameters are described. The complete description of all
parameters is provided in section “Parameter function
block” on page 34.
User programDescription
Declaration
VAR
---
FB_FW : TCMT1zxx ; (*Parameter function block*)
Declare variables in the
declaration section
Instantiate the parameter
function block
TC2_rdata : ARRAY [1..36] OF BYTE AT %RDB1.1.0.0 ;
TC2_tdata : ARRAY [1..36] OF BYTE AT %SDB1.1.0.0 ;
---
END_VAR
Program section
---
CAL FB_FW( (*Call for parameter function block*)
reset :=,
lock_station :=,
-
-
TCM_tdata:=TC2_tdata,
TCM_rdata:=TC2_rdata,
I
:=dial_active,
-
-
:=fail_code
)
Set the address space of the TC2
module
Call parameter function block
Assign the input and output
parameters for the parameter
function block
30
02/02 AWB27-1300-GB
Integrating the parameter
function block in the user
program
“TCMT1zXX“ parameter function blockDescription
Declaration
-
Frame format: BOOL:=1;
tra_dat: Array[1..4(32),0..0,0..219] of BYTE;
rec_dat: Array[1..4(32),0..0,0..219] of BYTE;
ui_ar_daten_parameter :Array[x..x] of UINT;
B_ar_modul_parameter :Array[0..20] of BYTE;
Fb_dial: TCM_dial; (*Dial-up function block*)
Fb_line: TCM_T1XX; (*Dial-up function block*)
-
Program
-
(*SUCONET operation mode synchronous with
PS4-200/341*)
(*SUCONET operation mode asynchronous with PS4341/PS416*)
-
-
The following settings must be made
and checked:
0 = FT1.2, 1 = FT3
Send data array
Receive data array
Data array parameter (a page 9)
Module parameter (a page 45)
Default
Default
Setting of the Suconet mode
synchronous (default setting)/
asynchronous with text marking
(a page 33)
No other changes are required since
the dial-up and telecontrol function
block have default settings.
CAL fb_dial(
Str_sim_pin:=sim_pin,
-
-
I
-
-
:=usi_signal_quality
)
Call of the dial-up function block
31
Function Blocks
02/02 AWB27-1300-GB
CAL fb_line(
X_syn_hsk:=,
-
-
I
-
-
:=ui_cterr
)
-
-
Call of the telecontrol function block
Setting for Suconet mode
Data transfer is carried out between the PLC and the bus
system in synchronous or asynchronous mode depending on
the master PLC or station involved.
Setting the required mode:
The mode must be specified in all parameter function blocks:
XCall up the function block and deactivate one of the
following two program sequences by marking the
sequence concerned as text using the characters (* *).
02/02 AWB27-1300-GB
Integrating the parameter
function block in the user
program
The default setting is synchronous mode. The program
sequences are parenthesised as follows:
(*SUCONET operation mode synchronous with PS4_200/341*)
ld NKD_1
PLC_message
st fb_line.x_syn_hsk
(*SUCONET operation mode asynchronous with PS4_341/
PS416*)
(*
ld b_ar_modul_parameter[0].2
st fb_line.x_syn_hsk
*)
The parentheses must be set as follows for asynchronous
mode:
(*SUCONET operation mode synchronous with PS4_200/341*)
(*
ld NKD_1
PLC_message
st fb_line.x_syn_hsk
*)
(*SUCONET operation mode asynchronous with PS4_341/PS416*)
ld b_ar_modul_parameter[0].2
st fb_line.x_syn_hsk
33
Function Blocks
02/02 AWB27-1300-GB
Parameter function blockDescription of the inputs
Table 2:Inputs for dialling the modem
InputsData
type
resetBOOL0/1Sets the dial-up function block and corresponding
lock_station
dial
sim_pin
dial_praefix
telegramformat
modem_type
BOOL0/1“lock_station” = 1 is used to lock the station from
BOOL0/1Setting the “dial” input from 0 r 1 will establish
STRING
(4)
STRINGmax. 10
BOOL0/1Selection of the telecontrol frame format
USINT0 to 6The initialisation string is sent according to the
Value
range
characters
Description
telecontrol function block to the basic setting and
initialises the modem.
the services coming from all other stations (except
for service 33). If the station is locked, error code
4B will be displayed.
a connection to the set partner station.
Deactivating the input from 1 r 0 clears the
connection.
The PIN number of the (SIM) telephone card must
be entered here as a string. This four-digit number
is loaded into the adapter on power on or module
reset. If the PIN number is loaded retentively, it is
recognised during initialisation.
Dial-up prefix for the modem, a also table 3 on
page 35.
0: FT1.2
1: FT3
modem type (a “Initialisation string” on
page 35)
34
Dial-up prefix (dial_praefix)
The dial-up procedure is defined by the “dial_praefix”
function block input. Check the general specification for the
telephone exchange or network. Also, read about this aspect
in your modem manual.
02/02 AWB27-1300-GB
Parameter function block
Table 3:Dial-up prefix settings
1234
ATDP0W
T
*
ATD Connection establishment with dial-up character string
PPulse dialling
TTone dialling
*Special tone dial character
(with Loges 64 K/M analog communication partner)
#Special character for tone dialling
(with Westermo ID-90V90 modem)
0Dialling tone request (important for PABXs)
xxOther parameters as per modem manual
WWaiting for dial tone recognition
,Dialling interval
xx
_
,
_
Initialisation string
Modem parameters are adapted to the telecontrol
application by sending an initialisation string to the modem
after switching on the controller or after a “Reset“.
The initialisation parameters for several modems are defined
in the “init_parameter” array. If only one modem is used,
just enter the element for this modem in the array. It must,
however, be ensured that the code 0-6 is entered
accordingly in the “b_ar_modulparameter[1]” array. This is
particularly important for GSM modems with the codes 4 to
6. The unused arrays can be used for tests with the modem.
The initialisation string is sent automatically after a module
is reset. “AT” as header and “crlf” (carriage return line feed)
at the end are generated automatically by the module.
The RTS control line of modems with the codes 4, 5 and 6 is
automatically set to “1“.
35
Function Blocks
Communication between all modem types is only possible if
the ISDN modem with an integrated analog section is used.
With modems that are solely ISDN modems, the
communication partner must be run in V110 mode. Only
GSM modems are suitable for this. The initialisation required
is shown in table 4 for type 6.
All tested modems can be used with their factory setting if
they are set for 9600 baud 8N1. The following modems
must be initialised with the following parameters via a
terminal program such as Windows Hyperterminal:
• Westermo TD-32 AT&FC1&K0&Y0S0=1X3&W0 crlf
• Siemens M20T AT+IPR=9600CR
Table 4:Initialisation string according to modem type
The meaning of the individual initialisation parameters is
explained in the modem manuals concerned.
36
02/02 AWB27-1300-GB
Parameter function block
Table 5:Inputs for the telecontrol function
Inputs
Data
type
Value
range
Description
strobeBOOL0/1Start of the service defined at “command”.
Active only when “ready” =1
requested_station
USINT1 to xPartner station to which a connection is to be
established.
The upper value limit depends on the telecontrol
function block selected.
command
USINT10 to 33Command code for the services offered,
a table 11 on page 51.
lock_data
BOOL0/1“lock_data” = 1 disables the writing of the
data array.
lock_time
BOOL0/1“lock_time” = 1 means that time
synchronisation is disabled.
lock_flash
BOOL0/1“lock_flash” = 1 means that writing of the flash
is disabled or is not available.
user_status_1
user_status_2
user_status_3
user_status_4
tra_status
BOOL0/1User status bit 1
BOOL0/1User status bit 2
BOOL0/1User status bit 3
BOOL0/1User status bit 4
WORD0 to 65535Status word
The status word is automatically transferred
after every connection establishment and when
service 31 is carried out between stations
(is indicated in the partner station in the
status array).
tra_variable_
USINT–Data length in the case of variable length frames.
length
tra_subaddress
USINT0 to 255Definition of the subaddress for variable length
frames
tra_source_offset
USINT0 to 219Source offset address for variable length frames
37
Function Blocks
02/02 AWB27-1300-GB
Inputs
tra_destination_
offset
tra_flash_segment
tra_dat
com_ref_1
com_ref_2
com_ref_n
phone_number_1
phone_number_2
phone_number_n
tra_information
TCM_tdata
TCM_rdata
Data
type
USINT0 to 219Destination offset address in the case of variable
UINT0 to 511Segment number of the flash memory and/or
ARRAY
OF BYTE
UINT1 to 65534Communication reference 1
UINT1 to 65534Communication reference 2
UINT1 to 65534Communication reference n
STRING32
STRING32
STRING32
STRING32
ARRAY
OF BYTE
ARRAY
OF BYTE
Value
range
characters
characters
characters
characters
1 to 36a the following section “TCM_tdata,
1 to 36a the following section “TCM_tdata,
Description
length frames
RAM memory card in the partner station.
Over 512 segments can be addressed with the
RAM memory card (a also page 54 and 56).
Send data array
Phone number of the 1st partner station
Phone number of the 2nd partner station
Phone number of the nth partner station
Text string for transmission; transferred on
execution of service 33.
TCM_rdata”
TCM_rdata”
38
TCM_tdata, TCM_rdata
You must assign a type “ARRAY“ variable at these inputs.
The arrays are used as internal buffers for send and receive
data. These are not accessible. The arrays must be declared
in the POU (Program type).
The Suconet K address is contained in the directly
represented variable. The following example shows
ZB4-501-TC2 as the first station (= Address 2) on line 1.
BOOLThe outputs indicate the communication between the module
and the modem (initialisation, dialling). A call from the
communication partner is not indicated. This event can be
detected on the “message” output (RING code = 2) and on the
“busy” output (= 1).
BOOLConnection is established.
BOOL1. On dialling:
After signal “1“ has been set on the “dial” input, “dial_busy”
shows “1“ until the connection has been cleared. The reset to
“0“ after the connection has been cleared can be delayed via
“dial_wait_repeat”.
In this way a dial attempt can be prevented or delayed if:
– the communication partner is calling or
– a subsequent station is dialled locally and the country wait
time in the modem has not yet elapsed in the modem
(possible error “DELAYED CALL“ or “BLACK LISTED“).
2. Incoming call
BOOLThe output is set if a connection cannot be established after the
specified number of attempts. If the “dial_repeat” input is set
to “0”, the “alarm” function block output is only triggered on
error code H2F.
It is reset on “reset”, “dial” = 0, or when a connection has
been established.
STRINGStatus messages in plain text a page 43.
TIMERemaining time till the next connection attempt.
USINTa table 8 on page 43
40
02/02 AWB27-1300-GB
Parameter function block
Table 7:Outputs for the telecontrol station
Outputs
Data
Description
type
readyBOOLAs soon as the output is active, the connection is established and
the telecontrol function block is ready to perform services.
tra_active
BOOLIndicates that a service that was initiated by the station itself
is in progress. If job processing is terminated, this signal reverts
to “0“.
tra_result
BOOL“tra_result” is updated after a falling edge on the “tra_active”
output. “tra_result” = 0 denotes that there has been an error in
executing the service.
tra_fail
BOOLAn error indicated at a station that has activated a service. It is
updated with every falling edge of the “tra_active” output.
rec_active
BOOLIndicates the processing of a service. If job processing is
terminated, this signal reverts to “0“.
rec_result
BOOL“rec_result” is updated after a falling edge on the “rec_active”
output. On “rec_result” = 0 means that an error has occurred
during execution of a service.
rec_fail
BOOLAn error indicated at a station that has received a service. It is
updated with every falling edge of the “rec_active” output.
rec_length
1)
USINTNumber of data bytes in a data frame activated by the
partner station.
1)
rec_subaddress
rec_offset
1)
rec_flash_
1)
segment
rec_action
1)
USINTSubaddress in a data frame activated by the partner station.
USINTOffset address in a data frame activated by the partner station.
USINTSegment number of the flash memory or RAM memory card to
which the partner station has access.
USINTCode of the service received that was activated by the
partner station.
rec_com_ref
rec_information
1)
USINTCommunication reference for which a frame has been input.
2)
STRINGReceived text string relayed using service 33 by the
OF BYTE
USINTIn the event of errors, when “tra_result” = 0 or “rec_result” = 0,
the error code will be indicated under “fail_code”. The output is
updated with every falling edge of the “tra_active” or
“rec_active” outputs.
42
02/02 AWB27-1300-GB
Parameter function block
1) Reset on incoming or outgoing call with DCD = 1.
2) Filled with an empty string on clearing connection.
3) Updated after execution of services 20 and 21.
4) Updated on connection establishment and after execution of
service 31 Read Status.
“dial_modem_code”, “dial_message”
During communication between the telecontrol module and
the modem, the modem generates status messages. These
messages are indicated at the “dial_message” function
block output in plain text and at the function block output
“dial_modem_code” as a numerical value.
Data connection xxxxBaud
Incoming call
No or excessively low signal reception level
Error (Code a fail_code)
Data channel ready to send/receive
No dial tone present
Busy tone received
Station not reporting (e.g. no modem)
No loop current
43
Function Blocks
02/02 AWB27-1300-GB
dial_modem
_code_message
11BLACKLISTED
12DELAYED CALL
13BREAK
14DISCONNECT
15CUT LINE
17RING DETECTED
18UNKNOW MESSAGE
20RESET
21GET SIGNAL QUALITY
23DIAL
24WAIT MODEM CHECK
Meaning
Automatic dial disable
Automatic dial delay
Dial abort by communication partner
Local disconnect
The monitoring time set via modul_parameter[13]
time_cut_line has expired and the connection was cleared.
Incoming call being processed
Unknown message. The received string is indicated in the
parameter module in “str_modem_response”.
Dial-up module is reset to basic setting
Measure field strength to the GSM node
Dialling communication partner
Wait time for initialising modem
44
02/02 AWB27-1300-GB
Parameter function block
Description of the parameters of array
“b_ar_modul_parameter”
The parameters are defined in the following array of 20
bytes. The array is incorporated in the declaration section of
the TCMT1zxx parameter function block.
b_ar_modul_parameter : ARRAY[0..20] OF BYTE :=
(*-element-no-0---1---2---3---4---5---6---7---8---9--10--11--12--13--14--15--16--17--18--19--20*)
synchronous>> 027,000,070,067,005,030,003,020,100,001,003,006,001,150,002,030,030,003,
They are assigned with default parameters so that a safe
operation is possible with all tested modems. Depending on
the type of use, it may be necessary to adjust the time
parameters.
When using GSM modems the data format must be set to
“8N1”. In order to reach the required level of data
transmission security with long frames, the frame format
must be set to “FT3“. For this the “telegrammformat” input
on the parameter function block must be set to “1“.
45
Function Blocks
02/02 AWB27-1300-GB
Table 9:Parameter setting
Byte
No.
Bit
No.
Parameter
(a table 10)
Function/RangeDefault value
(decimal)(binary)
00 station_type0 = type B, 1 = type A1
1Device_type
0 = fast (PS4-341, PS416),
1 = slow (PS4-150/-200)
2Suconet op_mode
0 = synchronous, 1 =
asynchronous
3cts/gap control
0 = cts_timeout,
1=gap_time
4con_rem_connect
0 = Only GSM modem,
modem type > 3
5 to 7Not assigned
10modem_rts_select0 = normal, 1= active
1modem_typ0 = Analog/ISDN, 1 = GSM
2 to 5Not assigned
6Character_format1 = Only with modem
KE28.8: commands in 8N1,
data in 8E1 format
7Init_repeat
2Baudrate
1 = Repeat Initstring0
68 = 2400, 69 = 4800,
70
70 = 9600
3Character_format65 = 8E1, 66 = 8O1,
67
67 = 8N1, 68 = 8N2
4Time_gap_timeMillisecond x 105
5Time_cts_timeoutMillisecond x 1030
6Time_rts_delay_offMillisecond x 103
7RTS_delay_initMillisecond x 10020
8RTS_delay_init_GSMMillisecond x 100100
9Time_delay_firstMillisecond x 10010
10Time_delay_shortMillisecond x 1003
11Time_delay_longMillisecond x 1006
1
0
1
1
0
46
02/02 AWB27-1300-GB
Byte
No.
Bit
No.
Parameter
(a table 10)
Parameter function block
Function/RangeDefault value
(decimal)(binary)
12Time_clock_adjust
Second1
13Time_dial_timeoutSecond150
14Time_DTR_breakSecond2
15Time_cut_lineSecond30
16Time_wait_repeatSecond30
17Time_systemSecond3
18Time_dial_wait_maxMinute60
19tel_repeatFrame repeats if fail3
20dial_repeatDial repeats if no connect3
Table 10:Description of the parameters
ParameterValue rangeDescription
Station_type0/1Station type 0:
Type B (service 30 not available, station cannot carry
out Reset)
Station type 1:
Type A (all services available)
Device_type
1)
0/10 = PS4-300/PS416 with short reaction time
1 = PS4-150/-200 with long reaction time
Suconet op_mode0/1
modem_rts_select0/1
modem_typ0/1
Suconet cycle 0 = synchronous, 1 = asynchronous
If 4, 5 or 6 is entered at the “modem_type” input of
the parameter function block, modem_rts_select,
modem_typ and the RTS control line on the modem are
set to 1 and CTS is evaluated as “ready to operate”
(a table 4 on page 36).
Character_format0/1
1 = Only with modem KE28.8:
Commands in 8N1, data in 8E1 format
Init_repeat0/1
Baudrate68, 69, 70
Character_format65 to 68
1 = Repetition of initialisation string
Baud rate 2400 = 68, 4800 = 69, 9600 = 70
8E1 = 65, 801 = 66, 8N1 = 67, 8N2 = 68
47
Function Blocks
ParameterValue rangeDescription
02/02 AWB27-1300-GB
Time_gap_time0 to 2550 ms
Time_cts_timeout0 to 2550 ms
Time_rts_delay_off0 to 2550 ms
RTS_delay_init100 to
25500 ms
RTS_delay_init_GSM100 to
25500 ms
Time_delay_first100 to
25500 ms
Time_delay_short
1)
100 to
25500 ms
Time_delay_long
1)
100 to
25500 ms
Time for masking gaps in the receive frame. This is
required when using wireless modems. A value of
50 ms must be set.
Timeout time for monitoring the CTS signal line if:
RTS = 1
If no CTS signal is detected after this time, the send
operation is aborted with “fail_code” = 62. If time
value = 0, the CTS timeout time is set internally to
500 ms.
RTS off delay; The RTS control line is reset after a send
frame with a delay equal to the time set, and the
receive buffer for masking out interference is disabled.
Start delay on autostart after cold or warm start for
bridging the self diagnostics times of modem and
telecontrol modules.
This state is indicated as follows:
– WAIT MODEM CHECK
modem_code=24 (a table 8, page 43)
As “RTS_delay_init”, only for GSM modems
Delay after connection establishment (connect
message) before the 1st service is sent.
48
02/02 AWB27-1300-GB
Parameter function block
ParameterValue range
Time_clock_adjust0 to 59
Time_dial_timeout0 to 255 s
Time_dtr_break0 to 255 s
Time_cut_line0 to 255 s
Time_wait_repeat0 to 255 s
Time_system0 to 255 s
Time_dial_wait _max0 to 255 min
Description
Time correction value in seconds for sychronising the
PLC time.
The value of the time received is added. It must be
calculated depending on the baud rate and the signal
runtime.
Local monitoring time during the communication with
the data module.
The DTR control line is set to 0 for this time in order to
clear the connection.
Maximum bus idle time.
If there is no data traffic for the specified time, the
connection is cleared once this time has elapsed. This
function is deactivated if no parameter is defined.
Wait time between dial repeats.
After each abortive attempt, the time is doubled, the
maximum length of time being, however, 60 minutes.
The maximum time is set at “Time_dial_wait_max”.
After a successful attempt, the time is reset to the
specified value. The minimum wait time must be
30 seconds (national value).
This function is deactivated if no parameter is defined.
If “alarm” = 1, dialling attempts are then continued
with the “wait_time” reached by that time.
System time for calculating the dynamic protocol
monitoring time:
From request to response
Max. wait time between the dial repeats
(a “Time_wait_repeat”)
49
Function Blocks
02/02 AWB27-1300-GB
ParameterValue range
tel_repeat0 to 255Number of frame repetitions in the event of a
dial_repeat0 to 255
1) Device_type, Time_delay_short and Time_delay_long are
Description
protocol error
Number of dial attempts if no connection can be
established due to the following error messages:
– NO CARRIER
– BUSY
– NO ANSWER
– BREAK
–RING DETECTED
If the “dial_repeat” input is set to “0”, the “alarm”
function block output is only triggered on error
code 2F.
parameters that specify the response time of the station.
The parameter “Device_type” is used to determine whether it
is a fast (Device_type = 0) or slow (Device_type = 1)
responding station. “Time_delay_short” and
“Time_delay_long” are parameters that must be specified for
each station. If a station is assigned “Device_type” = 0, it will
respond with a delay time defined in “Time_delay_short”.
“Device_type” = 1 is assigned accordingly to
“Time_delay_long”.
50
If the PS416 is fast, it is only processing short frames with a
fast cycle time. A PS4-200 is always classified as a slow PLC.
After connection establishment, station A (e.g. PS416, fast)
will signal its “Device_type” = 1. In response, station B
(e.g. PS4-200, slow) will signal its “Device_type” = 0.
Station A will then respond to every frame from station B
with the delay time specified at “Time_delay_short”
(e.g. 300 ms), B will respond with a 600 ms delay.
The parameters “Time_rts_delay_off”, “Time_gap_time”
and “Time_cts_timeout” are only transferred at cold starts/
warm starts or when the module is reset.
02/02 AWB27-1300-GB
Telecontrol function
block services
Telecontrol function
block services
After connection has been established between the stations,
the telecontrol function blocks provide the services for data
exchange between the individual telecontrol stations. They
are activated by relaying the corresponding code to the
“command” input of the parameter function block and via a
signal at the “strobe” input.
Table 11:Overview: Telecontrol function block services
Function block TCM_T1
Partner stations
ServiceCode
Remote reset30–xxx
Server reset
Read status31
Server status
Send information string33
Server information string
13
16
B0U0U2U5
11432
–xxx
–xxx
–xxx
–xxx
xxxx
–xxx
xxxx
–xxx
xxxx
–xxx
xxxx
51
Function Blocks
02/02 AWB27-1300-GB
Service 10: Send fixed frame length RAM data
When this service is called, “fixed_length” data bytes from
the “requested_station” send RAM data array from
Station A are transferred to the RAM receive data array of
station B.
Offset
address
219
.
RAM send data array
.
90
80
70
60
50
40
30
20
10
0
Station A
fixed_length
201. . . 255
Subaddress
Figure 6: Service 10: Send fixed frame length RAM data
In all stations using the service, the “fixed_length”
parameter must be identical.
Offset
address
219
.
RAM receive data array
.
90
80
70
60
50
40
30
20
10
0
Station B
201. . . 255
Subaddress
52
02/02 AWB27-1300-GB
Telecontrol function
block services
Service 12: Send variable frame length RAM data
A data segment (specified by subaddresses
“tra_subaddress”, offset address “tra_source_offset” and
data frame length “tra_variable_length”) from the
“requested_station” RAM send data array of the central
station is sent to the receive data array of the outstation.
There, the data segment is stored in the receive data array in
a location with coordinates “tra_subaddress”
(“rec_subadress”) and “tra_destination_offset”
(“rec_offset”).
Offset
address
tra_
source_offset
Station A
219
RAM send data array
90
80
70
60
50
40
30
10
0
01. . . 255
tra_subaddress
Station B
RAM receive data array
tra_variable_
length
2
Subaddress
Offset
address
tra_destination_
offset
219
90
80
70
60
50
40
30
20
0
Figure 7: Service 12: Send variable frame length RAM data
201. . . 255
Subaddress
53
Function Blocks
02/02 AWB27-1300-GB
Service 13: Send variable frame length FLASH/RAM
memory card data
A data segment (specified by “tra_subaddress,
tra_source_offset” and “tra_variable_length”) from the
RAM “requested_station” send data array of station A is
sent to the “tra_flash_segment” of the Flash memory (PS4)
or RAM memory card (PS416) of station B.
If station B is a PS416 controller, the number of segments is
adjustable. The standard arrangement in the user module
consists of 512 segments. If you wish to change the number
of available segments on the memory card, refer to the
section entitled “Function block SetMCFileLength” of the
manual “S40 Language Elements for PS4-150/-200/-300
and PS416” (AWB2700-1306-GB).
If you change the number of available segments, you must
alter the range limit for the “tra_flash_segment” function
block input in the variables declaration for the function
block.
VAR_INPUT
tra_flash_segment : UINT(0..511) ;(*Adjust the number of segments)
END_VAR
a section “Default parameters” from page 15.
h
If station B is a PS4-300 controller, format the memory
card with a recipe range.
54
02/02 AWB27-1300-GB
Telecontrol function
block services
Offset
address
tra_
source_offset
219
90
80
70
60
50
40
30
10
0
Station A
RAM send data array
tra_variable_
length
201. . . 255
Sub address
tra_subaddress
Figure 8: Service 13: Send variable frame length FLASH/RAM
Segment
number
memory card data
Station B
Flash memory (PS 4)
RAM Memory Card (PS 416)
(512 segments at 128 Byte)
511
90
80
70
60
50
40
30
20
10
0
127
tra_flash_segment
0
55
Function Blocks
02/02 AWB27-1300-GB
Service 15: Read variable frame length RAM data
A data segment (specified by subaddresses
“tra_subaddress”, offset address “tra_source_offset” and
data frame length “tra_variable_length”) from the RAM
send data array of station B is sent to the receive data array
of station A. There, the data segment is stored in the receive
data array in a location having coordinates
“tra_subaddress” and “tra_destination_offset”.
Offset
address
tra_
destination_offset
219
RAM receive data array
90
80
70
60
50
40
30
10
0
tra_subaddress
Station A
201. . . 255
Subaddress
Offset
address
tra_source_
offset
219
90
80
70
60
50
40
30
20
0
tra_subaddress
Station B
RAM send data array
tra_variable_
length
201. . . 255
Subaddress
Figure 9: Service 15: Read variable frame length RAM data
Service 16: Read variable frame length FLASH/RAM
memory card data
A data segment with the length “tra_variable_length” from
the segment “tra_flash_segment” of the FLASH memory
(PS4) or RAM memory card (PS416) of Station B is sent to the
RAM receive data array of station A (specified by
“tra_subaddress“ and “tra_destination_offset”).
56
02/02 AWB27-1300-GB
Telecontrol function
block services
If station B is a PS416 controller, the number of segments is
adjustable. The standard setting in the application module is
for 512 segments. If you wish to change the number of
available segments on the memory card, refer to the section
entitled “Function block SetMCFileLength” of the manual
“S40 Language Elements for PS4-150/-200/-300 and
PS416” (AWB2700-1306-GB).
If you change the number of available segments, you must
alter the range limit for function block input
“tra_flash_segment” in the variables declaration for the
function block:
VAR_INPUT
tra_flash_segment : UINT(0..511) ;(*Adjust the number of segments)
END_VAR
a section “Default parameters” from page 15.
Offset
address
tra_
destination_offset
h
219
RAM receive data array
90
80
70
60
50
40
30
10
0
tra_subaddress
If station B is a PS4-300 controller, format the memory
card with a recipe range.
Station A
Segment
number
201. . . 255
Sub address
511
90
80
70
60
50
40
30
20
0
Figure 10: Service 16: Read variable frame length FLASH/RAM
memory card data
Station B
FLASH memory (PS 4)
RAM memory Card (PS 416)
(512 segments at 128 Byte)
tra_flash_segment
tra_variable_length
127
0
57
Function Blocks
02/02 AWB27-1300-GB
Service 17: Send/read fixed frame length RAM data
When this service is called, “fixed_length” data bytes are
transferred in a fixed length frame from the RAM send data
array of Station A to the RAM receive data array of station B.
After transfer from station A to station B, “fixed_length”
data is transferred in the opposite direction from the send
data array of station B to the receive data array of station A.
Offset
address
Offset
address
219
.
RAM send data array
.
90
80
70
60
50
40
30
20
10
219
90
80
70
60
50
40
30
20
10
fixed_length
0
.
RAM receive data array
.
0
Station A
Offset
219
.
address
RAM send data fixed
frame length
201. . . 255
Subadress
Station A
Offset
address
RAM read data fixed
frame length
201. . . 255
Subaddress
RAM receive data array
.
90
80
70
60
50
40
30
20
10
0
219
.
RAM send data array
.
90
80
70
60
50
40
30
20
10
fixed_length
0
Figure 11: Service 17: Send/read fixed frame length RAM data
Station B
201. . . 255
Subadress
Station B
201. . . 255
Subaddress
58
In all stations using the service, the “fixed_length”
parameter must be identical.
02/02 AWB27-1300-GB
Telecontrol function
block services
Service 20: Read PLC clock – partner station
When performing this service, the clock data for station B,
increased by the “time_adjust” value, is relayed to station A
and output at the “rec_clock” function block output of
station A.
Use it in conjunction with the function block “lock_time”
input and you can define whether station A clock time is to
be synchronised.
“lock_time” = 1:Read PLC clock station B
The clock data of station B is increased by the “time_adjust”
value (of station A) and applied to the “rec_clock” function
block output of station A.
Station A
rec_clock
Station B
RAM memory RAM memory
Date and time
Year
Month
Day
lock_time:=1
Station A
time_adjust
Figure 12: “lock_time” = 1: Read PLC clock station B
Weekday
Hour
Minute
Second
“lock_time” = 0:Synchronising to the PLC clock –
partner station
Station B time data is increased by the “time_adjust” value
(of station B). The new time value is output at the
“rec_clock” function block output and overwrites the PLC
clock data of station A.
59
Function Blocks
02/02 AWB27-1300-GB
Station A
Date and time
Year
Month
Day
Weekday
Hour
Minute
Second
rec_clock
Station A
Date and time
Year
Month
Day
Weekday
Hour
Minute
Second
Station B
RAM memory RAM memory
Date and time
Year
Month
Day
Weekday
Hour
Minute
Second
Station A
time_adjust
lock_time:=0
Figure 13: “lock_time” = 0: Synchronisation to PLC clock station B
Service 21: Synchronising the PLC clock – partner
station
Station A time data is increased by the “time_adjust” value
(of station B) and the clock data of station B are then
overwritten. If the “lock_time” function block input of
station B becomes active, no clock time synchronisation
takes place and 42H message code is indicated.
Station B
RAM memory RAM memory
Date and time
Year
Month
Day
Weekday
Hour
Minute
Station B
time_adjust:=
Second
60
Figure 14: Service 21: Synchronisation of PLC clock station B
02/02 AWB27-1300-GB
Telecontrol function
block services
Service 30: Remote reset
This service can be activated only in those stations in which
the “station_type” function block input has the value 1. At
the same time, the partner station must be allocated a
parameter value of 0. If these conditions are fulfilled, the
partner station will have basic status (basic status: error
counters and frame sequence bit are reset).
Service 31: Read Status
When service 31 is executed, the parameters and error
counters of station B are transferred to station A where they
are stored in the “rec_status_array” array.
Receive frames counter
Protocol errors counter
Frame errors counter
Local errors counter
Other errors counter
Dial-up repeats counter
Alarms counter
Figure 15: Service 31: Read Status
61
Function Blocks
02/02 AWB27-1300-GB
Service 33: Send information string
This service is used to relay the string at the
“tra_information” function block input of station A to
station B and to output the “rec_information” function
block output at station B.
Station A
RAM memory
tra_information
Station B
RAM memory
rec_information
Figure 16: Service 33: Send information string
62
02/02 AWB27-1300-GB
4 Operating Behaviour
Startup behaviourAfter a controller warm start or cold start, or after a function
block reset, the interface parameters are relayed from the
PLC to the module. Should the parameters contain incorrect
settings (e.g. invalid transmission rate of 610 baud), the
default parameters are adopted and an error message is
generated (a also “Error Codes” on page 67).
Table 12:Default interface parameters with dial-up line
Baud rateStart bit
(fixed value)
960018None1
If the interface parameters have been transferred to the
module, the modem is initialised with a time delay that was
set in the “rts_delay_init” (GSM) parameter. The module
and the modem are then ready for operation (modem
code = 0).
Data bitParity bitStop bit
Further information on the startup behaviour is given in the
relevant telecontrol hardware manuals (AWBs), in the
chapter “Operation”.
63
Operating Behaviour
02/02 AWB27-1300-GB
Connection establishment After each connection has been made, the active station
checks whether an identical “com_ref_n” communication
reference has been entered at the partner station. Service 31
Read Status is automatically started for this purpose. Once a
connection has been established and the stations have been
identified, the “ready” function block output indicates that
the telecontrol services can now be started.
If the identification is negative, the partner station
acknowledges this and indicates error code “40h“;
no services can then be transmitted.
Data communication between the “tra_dat” and “rec_dat”
now takes place in the range for which a valid
communication reference has been found.
PasswordThere are two ways of protecting a station against
unauthorised access:
64
Communication reference
Once a connection has been established, the stations
automatically check via the dial-up function blocks, whether
identical “com_ref_n” communication references have been
entered for the communication relation. A UINT is provided
for the value range (1 to 65535). Non-matching
communication references generate an error message.
Therefore only those stations sending a communication
reference with a corresponding reference for “com_ref_n”
FB inputs of the partner station can communicate with one
another.
02/02 AWB27-1300-GB
Password
Service 33 – Send information string
Each telecontrol station can protect itself against
unauthorised access by other stations via the “lock_station”
function block input. In these circumstances, all incoming
services other than service 33 are rejected.
Example:
Station A operates as central station and station B as the
partner station. Station B has protected itself from access by
other stations via the “lock_station” FB input. The password
of station B is “Model_station”.
After connection has been successfully established via
station A with the dial-up function block, the station sends
the text string “Model_station”
(tra_information:=´Model_station´) to station B using the
service 33. The text string is indicated there at the telecontrol
function block output “rec_information”
(Model_station:=rec_information).
The text string received is then compared with an internal
password and, if it matches, the “lock_station” function
block input is reset. Station A can now exchange all available
services with station B.
If the connection between the stations is cleared, the
content of the “rec_information” function block output
(empty string) is set and the “lock_station” function is
reactivated.
65
Operating Behaviour
02/02 AWB27-1300-GB
You must activate service 33 in the controlling station via the
user program. At the outstation, you must observe the
following program steps. You must also make any
appropriate entries in the variables declaration.
VAR
lock_station AT %I0.0.0.0.0: BOOL;
password: STRING:=´Model_station´;
line: TCMT1AU0;
END_VAR
ldline.rec_information(*Information string, telecontrol function block
Dial-up function blocksTable 13 describes the error messages that may be output
when the dial-up function blocks are being processed. They
are indicated at the “fail_code” FB output.
Table 13:Dial-up function block error codes
Error codeMessage
hexdec
2032INTERFACE NOKThe telecontrol module is not ready for operation.
2234NO COM REF
2335NO PHONE-
NUMBER
2436LESS SIGNAL
VALUE
2638INVALID
CHARACTER
FORMAT
2739INVALID
BAUDRATE
Meaning
No communication reference.
No communication reference has been entered on the
telecontrol function block for the station number entered on the
“requested_station” FB input. Enter the valid communication
reference.
No telephone number entry.
No telephone number has been entered on the telecontrol
function block for the station number entered on the
“requested station” function block input. Enter a valid
telephone number.
Field strength to the GSM node is too small.
Find a better location or use an external aerial.
Character format parameter error.
An invalid parameter has been entered in
“modul_parameter[03]”. Select a valid parameter according to
the table in the parameter module.
Baud rate parameter error.
An invalid parameter has been entered in
“modul_parameter[02]”. Select a valid parameter according to
the table in the parameter module.
67
Error Codes
02/02 AWB27-1300-GB
Error codeMessage
hexdec
2840COPY ERROR
2941MODEM
INITIALISATION
ERROR
2A42MODEM SIM
CARD ERROR
2B43MODEM PIN
ERROR
2C44MODEM PUK
ERROR
2D45any_string
2E46TCM ERROR
2F47TIME OUT
Meaning
Copy error.
An error has occurred during generation of the initialisation or
dial-up string. The error number of the “TransferArray”
function block is shown in “modem_code”. Check the
operands “init_parameter”, “dial_praefix” and
“phone_number_n”.
The initialisation string contains one or several invalid
parameters.
No or an incorrect telephone card is fitted in the GSM modem.
The PIN code is incorrect.
SIM PIN required!
This status occurs if an incorrect PIN code was entered 3x.
The device is then disabled and can only be unlocked with a
mobile phone by entering the PIN.
GSM Error. An error message was sent from the GSM modem.
The received string is displayed as a message. Allocation of the
message a in the appropriate manual.
An error was reported by the telecontrol function block during
the data transmission. Error type a “fail_code”
Timeout
A timeout has occurred in communication between the function
blocks and the modem and/or the telecontrol module. Proceed
as follows:
– Restart the dial-up procedure.
– Carry out a module reset with “RESET“ input operand.
– Switch the PLC and the modem off and on.
68
02/02 AWB27-1300-GB
Telecontrol function blocks
Telecontrol function
blocks
Error code
hexdec
3149Service invalid
3250
3452
3553
Meaning
The code for the “command” function block input is invalid.
Select a valid code number according to table 11, page 51.
Service disabled
The service set at the “command” function block input is disabled for the type of
station employed (“stationtype”:=0). Choose another service or set the
“stationtype” parameter value 1.
“fixed_length” parameter incorrect
The value entered at the “fixed_length” function block input does not match the
parameter in the card/module. Reset function block or carry out a warm or cold start
in order to transfer the modified value into the module.
Data length in fixed length frame incorrect
The parameter entered at the “fixed_length” function block input is equal to 0 or
exceeds the parameter set for the offset address data array.
Check the parameters and input a permissible value for “fixed_length.
The error codes are displayed via the “fail_code” function
block output.
Local error messages
Table 14 describes the local error messages that may be
output whilst the telecontrol function blocks are being
processed.
Table 14:Error messages of the telecontrol station
69
Error Codes
02/02 AWB27-1300-GB
Error code
hexdec
3654
3755
3856
3957
3A58
3B59
3D61
Meaning
Data length or offset address incorrect
The addition of the parameters entered at the “tra_variable_length” and
“tra_source_offset” and “tra_destination_offset” function block inputs exceeds
the value entered in the variable declaration for the constants “tra_dfl_max or
“rec_dfl_max” .
Check the parameters and enter a permissible value for “tra_variable_length” or
“tra_source_offset” and “tra_destination_offset”.
The impermissible value 0 has been entered at the “tra_variable_length” function
block input. Enter a permissible value.
If the error message appears when accessing the FLASH memory or the RAM memory
card (service 13, service 16), an impermissible value has been used for the data length
(⬎128 bytes).
Subaddress too large
The parameter entered at the “tra_subaddress” function block input exceeds the
value of the constant “tra_sub_max” set in the variables declaration.
Check the parameter and enter a permissible value for “tra_subaddress”.
Baud rate parameter error
The parameter entered at the “baudrate”
function block input is not permissible.
From the module manuals (AWBs) select a valid value for the baud rate.
Character format parameter error
The telecontrol module has been assigned an incorrect character format.
Switch the PLC off and on in order to remove the error.
Frame type parameter error
The telecontrol module has been assigned an incorrect frame type parameter.
Switch the PLC off and on in order to remove the error.
Signal quality error DCD evaluation
The modem signal quality monitoring has reported an error on the DCD line.
Check your telephone line
DSR signal missing
The connected modem is not ready for operation.
Check the functional reliability of the connected modem.
70
02/02 AWB27-1300-GB
Telecontrol function blocks
Error code
hexdec
3E62
3F63
7F127
Error codeMeaning
hexdec
Meaning
Timeout CTS signal
The modem does not respond to the RTS signal of the telecontrol module.
Check the functional reliability of the connected modem and of the connecting lead.
Timeout error
The telecontrol partners are not responding.
Communication error
The data received by the station is unintelligible.
Ensure that
– all stations have the same baud rates,
– there are no faults on the transmission lines
– the modems are operating correctly.
– the time parameters of the program cycle time are adjusted (a page 45 cont.).
Error codes of the partner station
Table 15 describes the error codes that are generated in a
partner station. These error codes are output at the
“fail_code” output of the function block of the telecontrol
station and partner station.
Table 15:Partner station error messages
4064Invalid communication reference
After a connection has been established successfully, no corresponding
communication reference is discovered at the partner station. Check the entries in
the “com_ref_n” function block inputs.
4165
Data access disabled (“lock_data”)
The “lock_data” function block input is activated in the partner station and the
station performs a service whereby data is written to the partner station RAM.
Select the station, choose another service for execution or deactivate the
“lock_data” function block input of the partner station.
71
Error Codes
02/02 AWB27-1300-GB
Error code
hexdec
4266
4367
4468
4569
4670
4771
Meaning
Time access disabled (“lock_time”)
The “lock_time” function block input is activated in the partner station. The station
will perform service 21 whereupon the system clock of the partner station will be
overwritten.
Select another service to be performed at the partner station or deactivate the
“lock_time” function block input of the partner station.
Flash access disabled (“lock_flash”)
The “lock_ flash” function block input is activated in the partner station. The station
will perform service 13 whereupon the data will be written to the FLASH of the
partner station.
Select another service to be performed or deactivate the “lock_ flash” function
block input of the partner station.
“fixed_length” parameter incorrect.
The value entered at the “fixed_length“ function block input does not match the
parameter in the partner station. For all stations, set an identical value for
“fixed_length” and perform a block reset.
Data length of a fixed length frame incorrect
The parameter entered at the “fixed_ length” function block input is equal to 0 or
exceeds the set parameter of the data array.
Check the parameter and enter a permissible value for “fixed_length”.
Data length or offset address incorrect
The addition of the parameters entered at the “tra_variable_length” and
“tra_source_offset” and “tra_destination_offset” function block inputs exceeds
the value entered in the variables declaration for the constants “tra_dfl_max” or
“rec_dfl_max”.
Check the parameters and enter a permissible value for the variables.
The impermissible value 0 has been entered at the “tra_variable_length” function
block input. Enter a permissible value.
Subaddress too large
The parameter entered at the “tra_subaddress” function block input exceeds the
value of the constants “tra_sub_max” or “rec_sub_max” set in the variables
declaration.
Check the parameter and enter a permissible value for “tra_subaddress”.
72
02/02 AWB27-1300-GB
Telecontrol function blocks
Error code
hexdec
4872
4973
4A74
4B75
4C76
4D77
Meaning
Service not enabled
The service 30 performed is rejected by the partner station because the
“stationtype” function block input of the partner station has been assigned 0 value.
Frame sequence bit error
The frame sequence bit is used to prevent communication loss or message
duplication. In the next frame to the partner station, the frame sequence bits of the
stations are synchronised.
Time synchronisation error
A system error has occurred when using service 21 at the polled station.
Check the station CPU.
“Lock_station”
Access to the partner station by other stations is disabled. Deactivate the
“lock_station” function block input of the partner station.
Error when writing to the FLASH/RAM memory card or the FLASH/RAM memory card
is not available.
A system error is encountered in the partner station using service 13.
Check the FLASH memory of the CPU, the CPU of the partner station or install the
FLASH memory/ RAM memory card.
Error when reading the FLASH/RAM memory card or the FLASH/RAM memory card
is not available.
A system error has occurred in the partner station using service 16.
Check the FLASH memory of the CPU, the partner station CPU or install the FLASH
memory/RAM memory card.
73
02/02 AWB27-1300-GB
74
02/02 AWB27-1300-GB
6 Data Transmission Example
The following example shows the PS416 (active station)
dialling a PS4-200 (passive station) via modem and dial-up
line. The PS416 executes service 17: Send/read fixed frame
length RAM data The input and output signals are shown on
the relevant function (parameter) function blocks for this
sequence.
Station A
=
PS416
CPU
POW
>
?
>
Station B
PS4-200
@
Suconet K
Figure 17: Example configuration
a Central station
(PS416 with ZB4-501-TC2 telecontrol module)
b Dial-up modem
c Dial-up line
d Outstation
(PS4-200 with ZB4-501-TC1/-TC2 telecontrol module)
75
Data Transmission Example
02/02 AWB27-1300-GB
Key to figure 18:
a Inputs
b Outputs
executes the
user program
executes the
system
DIS = DISCONNECT
CON = CONNECT
TRA = TRANSMIT DATA
h
When the program is started or the function block reset,
the status display shows the input and output signals in
their basic setting. After the first service has been
executed, the signals have the following form.
dial:
=
strobe:
dial_active
dial_dcd
dial_busy
ready
>
tra_active
tra_result
dial_message
Figure 18: Active station (PS416)
dial_dcd
dial_busy
dial_modem_code
DISDIS DIALCONTRADAT
13
21 5 13
76
ready
rec_action
rec_result
dial_message
rec_action
17 031 17
BREAKRINGCONNECTTRABREAK
Figure 19: Passive station (PS4-200)
02/02 AWB27-1300-GB
Glossary
Application module
Application modules are programs or parts of a program for
the PLC or PC that support a function or completely execute
a function in an application. They provide ready-made
solutions for different applications.
Asymmetrical configuration
Configurations of telecontrol stations consisting of primary
and secondary stations are referred to as asymmetrical
configurations.
Asynchronous transmission
Each communications character is synchronised individually
mainly via start and stop elements.
Central station
The station remotely monitoring and/or remotely controlling
outstations.
Character
Convention for the data format, e.g. 1 start bit, 8 data bits,
1 check bit, 1 stop bit, i.e. 1 character = 11 bits.
DCE
See also under “Modem”.
DEE
Datenendeinrichtungen, German term for data terminal
equipment (DTE).
Dial-up line
A transmission line that is available after a dial-up
connection.
DTE
Data Terminal Equipment may include computers, terminals
or other input/output devices. A DTE which transmits data is
referred to as a data source. A DTE which receives data is
known as a data sink.
77
Glossary
02/02 AWB27-1300-GB
Handshake
A defined sequence of signals for setting up and checking a
connection.
ISO/OSI
The ISO/OSI model describes a model for classifying data
transmission and processing between two computers.
Modem
Abbreviation for “Modulator demudolator”. A device which
converts digital signals into analogue signals and vice versa.
Outstation
A station monitored or controlled and monitored by a
central station.
Parity
Data security process; a check bit added to each character.
Symmetrical configuration
Configurations of telecontrol stations consisting of stations
with equal rights are referred to as symmetrical
configurations. The stations in these configurations combine
the properties of primary and secondary stations.
78
Telecontrol
Telecontrol is the monitoring and controlling of processes
distributed over a wide area by means of coded bit-serial
data transmission.
Telecontrol configuration
The combination of telecontrol stations and transmission
paths between stations.
Telecontrol station
Central station or outstation in a telecontrol system.
Telecontrol system
A telecontrol system is used to control and monitor
processes that are distributed over a wide area. The system
consists of all devices and functions for data acquisition,
processing, transmission and display of the necessary
process information.