Moeller S40-AM-TL Manual
Moeller S40-AM-TL Manual

Moeller S40-AM-TL Manual

Telecontrol via leased line application module
Table of Contents

Advertisement

Quick Links

Telecontrol via Leased Line
S40-AM-TL
Application Module
10/00 AWB27-1301-GB
1st published 1998, edition 03/98
2nd edition 2001, edition 10/00
See modifications list on page II
© Moeller GmbH, Bonn
Author:
Peter Roersch
Editor:
Thomas Kracht
Translator:
Terence Osborn
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.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the S40-AM-TL and is the answer not in the manual?

Questions and answers

Summary of Contents for Moeller S40-AM-TL

  • Page 1 No part of this manual may be reproduced in Author: Peter Roersch any form (printed, photocopy, microfilm or Editor: Thomas Kracht any otherprocess) or processed, duplicated or Translator: Terence Osborn distributed by means of electronic systems without written permission of Moeller GmbH, Bonn. Subject to alterations without notice.
  • Page 2 Warning! Dangerous electrical voltage! Before commencing the installation Disconnect the power supply of the Ensure a reliable electrical isolation of device. the low voltage for the 24 volt supply. Only use power supply units complying Ensure that devices cannot be with IEC 60 364-4-41 (VDE 0100 accidentally restarted.
  • Page 3 10/00 AWB27-1301-GB Modifications list for the manual AWB27-1301-GB Edition date Page Description Modifi- cation moved 10/00 Complete Description adapted for the manual ZB4-501-TC2...
  • Page 4: Table Of Contents

    – Accessing data arrays with fixed length frames – Accessing data arrays with variable length frames – “User_status” bits Function Blocks Using the function blocks – Overview of S40-AM-TL function blocks – Type code Installation – Directory structure – Selecting function blocks – Procedure –...
  • Page 5 10/00 AWB27-1301-GB Contents Basic Function Blocks Interface Description of inputs/outputs Services Operating modes Example of basic function block – Primary station (PS416) – Secondary stations 1 (PS4-200) and 2 (PS416) Procedure Universal Function Blocks Interface Description of the function block outputs –...
  • Page 6 10/00 AWB27-1301-GB Contents Example – Primary station (PS416) – Secondary station 1 (PS4-200) – Secondary station 2 (PS416 with ZB4-501-TC2) 89 Procedure Error Codes Primary station Secondary station Glossary Index...
  • Page 7 10/00 AWB27-1301-GB...
  • Page 8: About This Manual

    10/00 AWB27-1301-GB About This Manual This manual describes how to install and program the application modules for telecontrol cards/modules that communicate with one another via leased lines conforming to IEC/EN 60 870-5). Other manuals (AWBs) The following manuals on telecontrol are also available: Hardware and engineering ZB4-501-TC1/TC2 telecontrol module AWB27-1297-GB...
  • Page 9 10/00 AWB27-1301-GB...
  • Page 10: General

    10/00 AWB27-1301-GB 1 General Field of application The S40-AM-TL application module, version 2.0 consists of a range of different function blocks that provide the interface in the PLC between the telecontrol cards/modules and the user program. Only ZB4-501-TC1 telecontrol modules version 03 or higher can be used with this software.
  • Page 11 10/00 AWB27-1301-GB General PS416 ZB4-501-TC1/-TC2 ZB4-501-TC2 PS416 Suconet K Figure 1: Telecontrol system with communication via a leased line. a Master station – primary station (PS416 with PS416-TCS-200 telecontrol module) b Partyline modem c Leased line d Outstation – secondary station (PS416 with ZB4-501-TC2 telecontrol module) e Outstation –...
  • Page 12: Hardware And Software Requirements

    Table 1 provides an overview of the hardware and software requirements requirements of the PS4 or PS416 PLCs. Table 1: Hardware and software requirements Type/Version PS4-150/-200/-300 PS416 S40-AM-TL Function block type TCMTx_xT TCMTx_xT for ZB4-501-TC2, TCMTx_xS for PS416-TCS-200 Sucosoft S40 ZB4-501-TC1 –...
  • Page 13 10/00 AWB27-1301-GB...
  • Page 14: Data Arrays

    10/00 AWB27-1301-GB 2 Data Arrays Data is exchanged between the primary station and the secondary stations using byte data arrays. This means that data that has a different data format in the application must be converted before it is entered in the data array. Conversely, array elements must be converted to the data format of the application before they can be read.
  • Page 15 10/00 AWB27-1301-GB Data Arrays Receive data array Send data array Byte Figure 2: Structure of the send and receive data array of a secondary station in the basic function block Offset address Receive data array Send data array Data array for frames with fixed length (Offset in fixed length frames always 0) Byte .
  • Page 16 10/00 AWB27-1301-GB Organisation Subaddress: Specifies the number of available offset address ranges (for universal function blocks only). Offset address: Specifies the maximum number of bytes in a subaddress. The maximum data array size that can be defined in the primary station is approximately 7.5 Kbyte for the send and receive data arrays.
  • Page 17: Assigning Data Array Parameters

    10/00 AWB27-1301-GB Data Arrays Assigning data array Basic function blocks parameters These data arrays are already set up in the variable declaration of the basic function blocks. They may have to be adjusted, however, if the default parameters are not exactly as required.
  • Page 18: Universal Function Blocks

    10/00 AWB27-1301-GB Assigning data array parameters Basic function block for the secondary station: VAR_INPUT User data length for fixed length fixed_length : USINT(1..20) ; frames Send data array (data array length) tra_dat: ARRAY[0..19] OF BYTE ; END_VAR VAR_OUTPUT Receive data array (data array rec_dat: ARRAY[0..19] OF BYTE ;...
  • Page 19 10/00 AWB27-1301-GB Data Arrays Universal function block for the primary station: VAR_INPUT Secondary station (x = station number requested_station : USINT(1..x) ; according to the selected function block) Subaddress subaddress : USINT(0..0) ; Source offset address source_offset : USINT(0..19) ; Destination offset address destination_offset : USINT(0..19) ;...
  • Page 20 10/00 AWB27-1301-GB Assigning data array parameters Universal function block for the secondary station: VAR_INPUT Subaddress of the ACD data acd_subaddress : USINT(0..0) ; Offset address of the ACD data acd_offset : USINT(0..19) ; User data length for ACD data acd_length : USINT(1..20) ;...
  • Page 21: Range Limits

    10/00 AWB27-1301-GB Data Arrays Range limits If you have not yet incorporated the function blocks into the S40 programming software, start by reading the Section “Installation” on Page 27 and then continue from this section. The following shows which parameters can be adapted in the variable declaration.
  • Page 22: Adapting Parameters

    10/00 AWB27-1301-GB Assigning data array parameters Arrays (primary station): tra_dat, rec_dat: These limits are determined by the limits for the “requested_station”, “subaddress” and “source_offset” or “destination_offset” variables. Arrays (secondary station) tra_dat and These limits are determined by the limits for the “subaddress” rec_dat: and “source_offset”...
  • Page 23: Example

    10/00 AWB27-1301-GB Data Arrays Example 5 secondary stations are connected to a primary station via point-to-point modems. You now want to create a data array with 1 subaddress and 32 offset addresses. To do this, you must make the following settings in the variable declarations for the primary and secondary stations: Primary_station For the parameters listed above, the primary station needs...
  • Page 24 10/00 AWB27-1301-GB Assigning data array parameters Secondary station For the parameters the secondary stations need 64 bytes of memory. You must therefore add the following array definitions and range limits to the variable declaration: VAR_INPUT acd_subaddress : USINT(0..0); acd_offset : USINT(0..31); acd_length : USINT(1..32);...
  • Page 25: Working With Data Arrays

    10/00 AWB27-1301-GB Data Arrays Working with data arrays The next section describes how to read or write data arrays using the example of the send and receive data arrays of a primary station. Ensure that all the array indices are within the limits when accessing data arrays.
  • Page 26: Reading Data Array Elements

    10/00 AWB27-1301-GB Working with data arrays Reading data array elements 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”. VALUE_1 : USINT ; END_VAR Instance_name.rec_dat [2,0,3] BYTE_TO_USINT VALUE_1...
  • Page 27: User_Status" Bits

    10/00 AWB27-1301-GB Data Arrays “User_status” bits “User_status” bits are used to transfer up to four bits of information and are transferred from the secondary station to the primary station. If status changes are detected at the FB inputs “user_status_1” to “user_status_4” of the secondary station while a service is being processed, the inputs will be automatically updated in the array of user_status bits at the primary station.
  • Page 28: Function Blocks

    10/00 AWB27-1301-GB 3 Function Blocks Using the function blocks The function blocks make it easier to program the data transfer between the PLC and telecontrol modules. Some function blocks are used for setting the communication parameters. These parameter function blocks are divided into basic and universal function blocks. The telecontrol function block is another kind of function block.
  • Page 29: Overview Of S40-Am-Tl Function Blocks

    10/00 AWB27-1301-GB Function Blocks Overview of S40-AM-TL function blocks Table 4: Overview of parameter function blocks PS4 with ... PS416 Primary Second- Function block with ... station ary sta- with tion max. Basic Universal function function block block TCMT2-BT TCMT2-UT...
  • Page 30: Installation

    Installation Installation Directory structure All the files of the module are on the S40-AM-TL diskette in the subdirectory “TCM”. The subdirectory “POE” contains the files of the original S40-AM-TL V1.0 module which was described in the 03/98 edition of the manual AWB2700-1301-GB.
  • Page 31 10/00 AWB27-1301-GB Function Blocks Table 5: File overview Module/ Function Station POU file LIB file (*.LIB) card block type (*.POE) type TCMT2_BT Tcm_tl_2 Tcm_tl_3 Tcm_tl_4 TCMT3_BT TCMT2_UT TCMT3_UT TCMT2_BS TCMT3_BS TCMT2_US TCMT3_US *) the ZB4-501-TC1 telecontrol module version V03 or higher can also be used.
  • Page 32: Procedure

    10/00 AWB27-1301-GB Installation Procedure Parameter function blocks (.POE) Copy the parameter function block to the “Source” directory of your project. Choose Edit © Register Sources in the S40 Project Manager to register the function blocks. Telecontrol function blocks (.LIB) Carry out the following steps to import a (library) file into your current project with the S40 Navigator: Specify the PLC type in the selection window shown in the Navigator toolbar.
  • Page 33: General Settings

    10/00 AWB27-1301-GB Function Blocks General settings The settings must be made if the ZB4-501-TC2 module is connected to the PS4 or PS416 via the Suconet K bus. Mode Data transfer is carried out between the PLC and the bus system in synchronous or asynchronous mode depending on the master PLC or primary station involved.
  • Page 34 10/00 AWB27-1301-GB Installation (*Synchronous mode PS4-201/341 with x_bus_mode=0*) LD NKD_1 PLC_message ST fb_line.x_NKD_syn LD 0 ST fb_line.x_bus_mode (*Asynchronous mode PS4-341/416 with x_bus_mode=1 LD 1 ST fb_line.x_NKD_syn ST fb_line.x_bus_mode *) The parentheses must be set as follows for asynchronous mode: (*Synchronous mode PS4-201/341 with x_bus_mode=0 LD NKD_1 etc.
  • Page 35 10/00 AWB27-1301-GB Function Blocks The parameters have the following meaning: rts_select (BOOL): 0 = The control and signal lines of the V24 interface are set for a cable modem. 1 = The control and signal lines of the V24 interface are set for a wireless modem.
  • Page 36 10/00 AWB27-1301-GB Installation cts_gap_time (TIME) This time has two functions: for the ZB4501-TC1/ -TC2 modules – The monitoring the CTS signal line Requirement: RTS = 1 If no CTS signal is detected after this time, the send operation is aborted with “fail_code” = 14. If the time value = 0, the CTS timeout time is set internally to 500 ms.
  • Page 37 10/00 AWB27-1301-GB Function Blocks TCMT2_BT VAR CONSTANT rts_select : BOOL:= 0; (*RTS switched/static-on*) dfn_max : UINT:= 16; (*Number of secondary stations*) tra_dfl_max : UINT:=20; (*Transmit length of data array*) rec_dfl_max : UINT:=20; (*Receive length of data array*) system_time : TIME:=T#500ms; (*System time*) repeat_time : TIME:=T#50ms;...
  • Page 38 10/00 AWB27-1301-GB Installation TCMT2_UT VAR CONSTANT rts_select : BOOL:= 0; (*RTS switched/static-on*) dfn_max : UINT:= 16; (*Number of secondary stations*) tra_sub_max : UINT:= 0; (*Transmit number of subaddresses*) rec_sub_max : UINT:= 0; (*Receive number of subaddresses tra_dfl_max : UINT:=20; (*Transmit length of data array*) rec_dfl_max : UINT:=20;...
  • Page 39 10/00 AWB27-1301-GB Function Blocks TCMT3_US VAR CONSTANT tra_sub_max : UINT:= 0; (*Transmit max. subaddress*) rec_sub_max : UINT:= 0; (*Receive max. subaddress*) tra_dfl_max : UINT:=20; (*Transmit length of data array*) rec_dfl_max : UINT:=20; (*Receive length of data array*) time_tout : TIME:= T#10s; (*Protocol monitoring time*) rts_delay_on : TIME:=T#10ms;...
  • Page 40: Operational Behaviour

    10/00 AWB27-1301-GB Operational behaviour Operational behaviour Startup behaviour Whenever the controller is warm or cold started or the function block is reset, the interface parameters are transferred from the programmable controller to the card/ module. The default parameters will be used and an error message generated if the parameters contain incorrect settings (e.g.
  • Page 41 10/00 AWB27-1301-GB Function Blocks Table 7: Telecontrol services Designation Code Basic Universal Page function function block block Variable access service Send data of fixed frame length RAM – Send data of fixed frame length RAM – broadcast Send data of variable frame length RAM –...
  • Page 42: Basic Function Blocks

    10/00 AWB27-1301-GB 4 Basic Function Blocks The basic function blocks give the user access to service 17 (send/read data of fixed frame length RAM), and poll all the programmed stations in a continuous cycle. The basic function blocks are permanently programmed: •...
  • Page 43: Description Of Inputs/Outputs

    10/00 AWB27-1301-GB Basic Function Blocks Inputs/outputs Basic function block Primary Secondary station station user_status_1 user_status_2 user_status_3 user_status_4 Outputs active active_cyclic – result fail – fail_stationaddress – fail_code life_control – user_status – actual_stationaddress – rec_dat – not available x available Description of inputs/outputs A description of the inputs is provided in Table 11 from Page 56.
  • Page 44: Services

    10/00 AWB27-1301-GB Services Services The basic function block provides service 17 (Send/read data of fixed frame length). Secondary station Primary station RAM receive data array RAM send data array Send fixed length frame RAM data Secondary station Primary station RAM send data array RAM receive data array Read fixed length frame RAM data...
  • Page 45: Operating Modes

    10/00 AWB27-1301-GB Basic Function Blocks When the FB “strobe” input is activated, “fixed_length” data bytes are transferred in a continuous cycle in a fixed length frame from the RAM send data array at the primary station to the RAM receive data array at the secondary station with the address “local_stationaddress”.
  • Page 46 10/00 AWB27-1301-GB Operating modes Continuous cyclical (error-free operation) strobe active result active_cycl ic lifecontrol.x lifecontrol.y lifecontrol.z Figure 6: Timing diagram for the “continuous cyclical” operating mode Continuous cyclical with autostart (error-free operation) strobe active result active_cycl ic lifecontrol.x lifecontrol.y lifecontrol.z Figure 7: Timing diagram for the “continuous cyclical with autostart”...
  • Page 47 10/00 AWB27-1301-GB Basic Function Blocks Continuous cyclical (transmission error on station x) strobe active Unsuccessful frame repetition result lifecontrol.x lifecontrol.y lifecontrol.z fail Address fail_stationaddress Code fail_code Figure 8: Timing diagram for the “continuous cyclical with autostart” operating mode and error transmitting to station x RESET reset...
  • Page 48: Example Of Basic Function Block

    10/00 AWB27-1301-GB Example of basic function block Example of basic function The “Send/receive fixed length data” service is described for block the configuration in Figure 10. It is assumed for the purposes of this example that the PS416-TCS-200 card is mounted in slot “4”.
  • Page 49 10/00 AWB27-1301-GB Basic Function Blocks 8 bytes of user data with frame format FT1.2 are to be transferred cyclically between the primary station and the two secondary stations. No other services are required. The following basic function blocks are selected for the stations and incorporated into user programs: •...
  • Page 50: Primary Station (Ps416)

    10/00 AWB27-1301-GB Example of basic function block Primary station (PS416) Variable declaration “TCMT2_BS” VAR_INPUT User data length for fixed length fixed_length : USINT(1..8); frames Send data array (station number, data tra_dat : ARRAY[1..2, 0..7] OF BYTE; array length) END_VAR VAR_OUTPUT Receive data array (station number, rec_dat : ARRAY[1..2, 0..7] OF BYTE;...
  • Page 51 10/00 AWB27-1301-GB Basic Function Blocks Parameter assignment The basic function block TCMT2_BS is assigned with the following parameters: CAL FW_TLBP( Resets the function block reset:=, If the “strobe” input has been assigned the constant strobe:=, value “1”, the exchange of data starts automatically when the controller is switched on User data length for fixed length frames fixed_length:=8,...
  • Page 52: Secondary Stations 1 (Ps4-200) And 2 (Ps416)

    10/00 AWB27-1301-GB Example of basic function block Secondary stations 1 (PS4-200) and 2 (PS416) Variable declaration “TCMT3_BT” VAR_INPUT User data length for fixed length frames fixed_length : USINT(1..8); Send data array (data array length) tra_dat : ARRAY[0..7] OF BYTE; END_VAR VAR_OUTPUT Receive data array (data array length) rec_dat...
  • Page 53: Procedure

    10/00 AWB27-1301-GB Basic Function Blocks Parameter assignment of TCMT3_BT CAL FW_TLBS( Resets the function block reset:=, Station address of station 1: x = 1, station 2: x = 2 local_stationaddress:=x, User status bit 1 user_status_1:=, User status bit 2 user_status_2:=, User status bit 3 user_status_3:=, User status bit 4...
  • Page 54 10/00 AWB27-1301-GB Procedure The operation is repeated with the secondary station with address “2”. The basic function block now continuously transfers data between the primary station and the two secondary stations. Activating the FB “reset” input will stop the transmission and return the function block to its basic setting.
  • Page 55 10/00 AWB27-1301-GB Basic Function Blocks...
  • Page 56: Universal Function Blocks

    10/00 AWB27-1301-GB 5 Universal Function Blocks Universal function blocks provide various services for exchanging data between the individual telecontrol stations. These services are activated by sending the appropriate code to the “command” input of the FB. Interface Table 10: User interface of the universal function blocks Inputs/outputs Universal function block Primary...
  • Page 57 10/00 AWB27-1301-GB Universal Function Blocks Inputs/outputs Universal function block Primary Secondary station station baudrate watchdog_time – (only with TCMT3_xx) tel_repeat – slotnumber (only with TCMTx_xS) address_of_station_1 – address_of_station_n – tra_dat TCM_tdata (only with TCMTx_xT) TCM_rdata (only with TCMTx_xT) user_status_1 user_status_2 –...
  • Page 58 10/00 AWB27-1301-GB Interface Inputs/outputs Universal function block Primary Secondary station station fail_code life_control – user_status – actual_stationaddress – – acd_stationaddress – acd_subaddress – acd_offset – acd_length – rem_stationaddress – rem_fixed_length – rem_ctrat – rem_crect – rem_cperr – rem_cterr – rem_clerr –...
  • Page 59: Description Of The Function Block Outputs

    10/00 AWB27-1301-GB Universal Function Blocks Description of the Inputs function block outputs Table 11 lists in alphabetical order the function block inputs that can occur in the individual versions. In certain versions, some inputs may not be available on account of the limited functionality of the function block.
  • Page 60 10/00 AWB27-1301-GB Description of the function block outputs Inputs Data Range of Description type values fixed_length USINT 1 to 220 Length of fixed length data frames The value must not be greater than the programmed data array and must be the same for all the stations in the telecontrol line.
  • Page 61 10/00 AWB27-1301-GB Universal Function Blocks Inputs Data Range of Description type values tel_repeat USINT 0 to 255 Number of frames repeated in the event of protocol errors in the “cyclical”, “continuous cyclical” and “continuous cyclical with autostart” operating modes. telegramformat BOOL Selection of the telecontrol frame format 0 = FT1.2;...
  • Page 62 10/00 AWB27-1301-GB Description of the function block outputs receive data. They cannot be accessed by the user. These arrays must be declared in the POU (program POU). The Suconet K address is contained in the directly represented variable. 36 bytes are normally transferred in both send and receive directions.
  • Page 63: Outputs

    10/00 AWB27-1301-GB Universal Function Blocks Outputs Table 12 lists in alphabetical order all the function block outputs that can occur in the individual versions. In certain versions, some outputs may not be available on account of the limited functionality of the function block. Table 12: Outputs Outputs Data type...
  • Page 64 10/00 AWB27-1301-GB Description of the function block outputs Outputs Data type Description life_control WORD (with Life control for secondary stations TCMTx-xT) Bit 0 = 1st secondary station, ... Bit 31: 32nd secondary station DWORD If communication with the secondary station is successfully (with established, the associated bit is active.
  • Page 65: Services

    10/00 AWB27-1301-GB Universal Function Blocks Services The function blocks provide services for exchanging data between individual telecontrol stations. The blocks are activated by transferring the appropriate code to the “command” input of the function blocks and by a signal at the “strobe”...
  • Page 66: Service 11: Send Fixed Length Frame Ram Broadcast Data

    10/00 AWB27-1301-GB Services Service 11: Send fixed length frame RAM broadcast data When this service is executed, “fixed_length” data bytes are transferred in a fixed length frame from the RAM send data array “requested_station” at the primary station to the RAM receive data array of all connected secondary stations.
  • Page 67: Service 12: Send Variable Length Frame Ram Data

    10/00 AWB27-1301-GB Universal Function Blocks Service 12: Send variable length frame RAM data A data segment (specified by subaddress “subaddress”, offset “source_offset” and data frame length “variable_length”) is sent from the RAM send data array “requested_station” at the primary station to the receive data array at the secondary station.
  • Page 68 10/00 AWB27-1301-GB Services SetMCFileLength” in the manual “S40 Language Elements for PS4-150/-200/-300 and PS416“ (AWB2700-1306-GB). If you modify the number of available segments, you must change the range limit of the function block “flash_segment” input in the variable declaration for the function block: VAR_INPUT flash_segment : UINT(0..511);(*Adapt the number of segments)
  • Page 69: Service 14: Send Variable Frame Length Ram Broadcast Data

    10/00 AWB27-1301-GB Universal Function Blocks Service 14: Send variable frame length RAM broadcast data A data segment (specified by subaddress “subaddress”, offset address “source_offset” and data frame length “variable_length”) from the RAM send data array “requested_stationaddress” at the primary station is sent to the receive data array of all connected secondary stations.
  • Page 70: Service 15: Read Variable Length Frame Ram Data

    10/00 AWB27-1301-GB Services Service 15: Read variable length frame RAM data A data segment (specified by subaddress “subaddress”, offset address “source_offset” and data frame length “variable_length”) from the RAM send data array at the secondary station “local_stationaddress” is sent to the receive data array at the primary station.
  • Page 71 10/00 AWB27-1301-GB Universal Function Blocks If a PS416 programmable controller is used as the secondary station, the number of segments can be set as required. The default setting in the application module is 512 segments. If you wish to change the number of available segments on the memory card, read the section “Function Block SetMCFileLength”...
  • Page 72: Service 17: Send/Read Fixed Length Frame Ram Data

    10/00 AWB27-1301-GB Services Service 17: Send/read fixed length frame RAM data When this service is called, “fixed_length” data bytes are transferred in a fixed length frame from the RAM send data array “requested_station” at the primary station to the RAM receive data array at the secondary station.
  • Page 73: Service 20: Read Plc Clock At Outstation

    10/00 AWB27-1301-GB Universal Function Blocks Service 20: Read PLC clock at outstation When this service is executed, the clock data at the secondary station is transferred to the primary station, increased by the value “time_adjust” and output in the primary station at the “rem_clock” function block output. The service takes into account century changes, i.e.
  • Page 74: Service 21: Synchronise Plc Clock At Outstation

    10/00 AWB27-1301-GB Services Secondary station Primary station RAM memory RAM memory Date and time Date and time Year Year Month Month lock_time:=0 Weekday Weekday Hour Hour Minute Minute Second Second rem_clock Figure 21: “lock_time” = 0: Synchronisation with PLC clock at outstation Service 21: Synchronise PLC clock at outstation The clock data at the primary station is increased by the...
  • Page 75: Service 22: Synchronise Plc Clock At Outstation Broadcast

    10/00 AWB27-1301-GB Universal Function Blocks Service 22: Synchronise PLC clock at outstation broadcast The clock data at the primary station is transferred to all the secondary stations. The data is increased by the value “time_adjust” (at each secondary station) and overwrites the clock data at all the secondary stations.
  • Page 76: Service 30: Remote Reset

    10/00 AWB27-1301-GB Services Service 30: Remote reset When service 30 is executed, the function block of the polled secondary station is returned to its basic status (the error counters and frame sequence bit are set to “0”). Service 31: Read status When service 31 is executed, parameters and error counters are transferred from the polled secondary station to the primary station, where they are indicated at function block...
  • Page 77: Service 32: Send Token (Temporary Status)

    10/00 AWB27-1301-GB Universal Function Blocks Service 32: Send token (temporary status) Service 32 is used in conjunction with the “acd” input to ensure an effective exchange of data between the primary station and connected secondary stations. If no high-priority data has been signalled since the last communication (“acd”...
  • Page 78: Behaviour Of The Service When The Fb "Acd" Input Is Connected

    10/00 AWB27-1301-GB Services Behaviour of the service when the FB “acd” input is connected Secondary stations activate the FB “acd” input to signal to the primary station that they have high-priority data for transmission. If an ACD request is detected while service 32 (send token) is in progress, the secondary station responds with ACD data in a variable length frame.
  • Page 79: Operating Modes

    10/00 AWB27-1301-GB Universal Function Blocks Operating modes The universal function block has several operating modes, which are activated via the FB “strobe”, “auto” and “cyclic” inputs. Table 13: Operating modes of the universal function block strobe auto cyclic Function Single call Single call with variable parameters Cyclical One-off polling cycle for all programmed stations (address >...
  • Page 80 10/00 AWB27-1301-GB Operating modes Single call (error-free operation) No effect strobe auto strobe requested_station active result lifecontrol.x Figure 26: Timing diagram for the “single call” operating mode Cyclical (error-free operation) No effect strobe Start 1st cycle Start 2nd cycle Start 3rd cycle auto cycl ic active...
  • Page 81 10/00 AWB27-1301-GB Universal Function Blocks Auto step mode (error-free operation) No effect strobe auto cyclic active result active_cyclic lifecontrol.x lifecontrol.y lifecontrol.z Figure 28: Timing diagram for the “auto step mode” operating mode Continuous cyclical (error-free operation) strobe auto cycl ic active result active_cycl ic...
  • Page 82 10/00 AWB27-1301-GB Operating modes Continuous cyclical with autostart (error-free operation) strobe auto cycl ic active result active_cycl ic lifecontrol.x lifecontrol.y lifecontrol.z Program start Figure 30: Timing diagram for the “continuous cyclical with autostart” operating mode Continuous cyclical (transmission error on station x) strobe auto cycl ic...
  • Page 83 10/00 AWB27-1301-GB Universal Function Blocks RESET reset Reset Parameter setting active result Figure 32: Timing diagram for activation of the FB reset input Two functions are triggered when the FB “reset” input is activated. These functions are processed one after another: •...
  • Page 84: Example

    10/00 AWB27-1301-GB Example Example Various services are described for the configuration in Figure 33. It is assumed for the purposes of this example that the PS416-TCS-200 card is mounted in slot 4. PS416 ZB4-501-TC1/-TC2 ZB4-501-TC2 PS416 Suconet K Figure 33: Example: Read variable length frame data (service a Master station –...
  • Page 85 10/00 AWB27-1301-GB Universal Function Blocks The primary station is to perform the following tasks in response to a rising edge at the “strobe” input: • First signal at the “strobe” input Read 16 bytes of user data in FT3 frame format from station 1.
  • Page 86: Primary Station (Ps416)

    10/00 AWB27-1301-GB Example Primary station (PS416) The primary station uses the TCMT2_US function block. Variable declaration “TCMT2_US” VAR_INPUT Secondary stations requested_station : USINT(1..2); Subaddress subaddress : USINT(0..0); Source offset address source_offset : USINT(0..15); Destination offset address destination_offset : USINT(0..15); User data length for variable_length : USINT(1..16);...
  • Page 87 10/00 AWB27-1301-GB Universal Function Blocks System time system_time : TIME:=T#500ms; Repeat time after job end repeat_time : TIME:=T#50ms; Start delay with autostart start_delay : TIME:=T#2000ms; RTS on-delay rts_delay_on : TIME:=T#10ms; RTS off-delay rts_delay_off : TIME:=T#30ms; CTS timeout cts_time : TIME:=T#500ms; END_VAR...
  • Page 88 10/00 AWB27-1301-GB Example Parameter assignment The parameter assignment of the TCMT2_US universal function block depends on the secondary station with which data is to be exchanged. The following example assigns the function block with parameters for station 1. The parameters for station 2 are shown in parentheses.
  • Page 89 10/00 AWB27-1301-GB Universal Function Blocks Address of the nth secondary station (not used) address_of_station_n:=0, Send data array tra_dat:= Indicates that a service is being processed. :=active, Indicates that a polling cycle is in progress :=active_cyclic, Signal quality evaluation :=dcd, Result after a falling edge at the “active” output. :=result, Result = 0: Error, Result = 1: OK Error indication at a station...
  • Page 90: Secondary Station 1 (Ps4-200)

    10/00 AWB27-1301-GB Example Secondary station 1 (PS4-200) Variable declaration “TCMT3_UT” VAR_INPUT ACD subaddresses acd_subaddress : USINT(0..0); ACD offset addresses acd_offset : USINT(0..15); User data length for ACD data acd_length : USINT(1..16); User data length for fixed length frames fixed_length : USINT(1..16); Send data array (subaddresses, offset tra_dat : ARRAY[0..0, 0..15] OF BYTE;...
  • Page 91 10/00 AWB27-1301-GB Universal Function Blocks Parameter assignment of “TCMT3_UT” CAL sek_sta_1( Resets the function block reset:=, Station address local_stationaddress:=1, Time correction value time_adjust:=, Write protection for RAM memory lock_data:=, Write protection for FLASH memory lock_flash:=, Write protection for PLC clock lock_time:=, User status bit 1 user_status_1:=,...
  • Page 92: Secondary Station 2 (Ps416 With Zb4-501-Tc2)

    10/00 AWB27-1301-GB Example Secondary station 2 (PS416 with ZB4-501-TC2) Variable declaration “TCMT3_UT” VAR_INPUT ACD subaddresses acd_subaddress : USINT(0..0); ACD offset addresses acd_offset : USINT(0..15); User data length for ACD data acd_length : USINT(1..16); User data length for fixed length fixed_length : USINT(1..16);...
  • Page 93 10/00 AWB27-1301-GB Universal Function Blocks Parameter assignment of “TCMT3_UT” CAL sek_sta_2( Resets the function block reset:=, Station address local_stationaddress:=2, Time correction value time_adjust:=, Write protection for RAM memory lock_data:=, Write protection for FLASH memory lock_flash:=, Write protection for PLC clock lock_time:=, User status bit 1 user_status_1:=,...
  • Page 94: Procedure

    10/00 AWB27-1301-GB Procedure Procedure Store the parameters for data transmission from the primary station r secondary station “1” in the function block “TCMT2_US” at the primary station. The exchange of data is started by a rising edge at the “strobe” input of function block “TCMT2_US”...
  • Page 95 10/00 AWB27-1301-GB Universal Function Blocks Primary station Secondary station 1 Secondary station 2 Figure 34: Frame interchange between the primary and secondary station a The primary station starts a data request frame for station 1 (secondary station 1) in response to a rising edge at the “strobe”...
  • Page 96: Error Codes

    10/00 AWB27-1301-GB 6 Error Codes The error codes are always sent in the status message as an acknowledgement from the secondary station to the primary station. They are displayed via the FB “fail_code” output. The “fail” and “fail_stationaddress” outputs provide further information on the error status and the station at which the error occurred.
  • Page 97 10/00 AWB27-1301-GB Error Codes Error code Description Incorrect data length for “fixed length frames” The parameter entered at function block input “fixed_length” is equal to 0 or exceeds the parameters set for the data array offset address. Check the parameters and enter an admissible value for “fixed_length”. Incorrect data length or offset address Addition of the parameters entered at the function block “variable_length”...
  • Page 98 10/00 AWB27-1301-GB Primary station Error code Description CTS signal timeout The modem does not respond to the RTS signal from the telecontrol card/module. Check that the connected modem is working correctly. Timeout error A secondary station is not responding. Communication error Data was received that cannot be interpreted by the station.
  • Page 99: Secondary Station

    10/00 AWB27-1301-GB Error Codes Secondary station Table 15 describes the error codes that are generated at a secondary station. These error codes are displayed at the “fail_code” output of the function block at both the secondary station and the primary station. Table 15: Error messages at the secondary station Error code...
  • Page 100 10/00 AWB27-1301-GB Secondary station Error code Description Data access denied (“lock_data”) The function block “lock_data” input has been activated at the polled secondary station and a service has been executed at the primary station to write the data to the RAM of the secondary station. Select another service to be executed at the primary station or deactivate the FB “lock_data”...
  • Page 101 10/00 AWB27-1301-GB Error Codes Error code Description Subaddress too high The parameter entered at function block input “subaddress” or “acd_subaddress” exceeds the value of the constant “sub_max” set in the variable declaration. Check the parameters and enter an admissible value for “subaddress”. Service not implemented The service created at the primary station (FB “command”...
  • Page 102 10/00 AWB27-1301-GB Secondary station Error code Description PLC NOT RUN The CPU at the secondary station is not in “RUN” mode. Check the operating mode selector switch or the diagnostic LEDs of the CPU. Communication error Data was received that cannot be interpreted by the station. Check whether –...
  • Page 103 10/00 AWB27-1301-GB...
  • Page 104: Glossary

    10/00 AWB27-1301-GB Glossary Application module Application modules are programs or parts of programs for the PLC or PC which either support a function in an applica- tion or execute it entirely. Application modules provide ready-made solutions for a wide range of applications. Asymmetrical configuration Configurations of telecontrol stations consisting of primary and secondary stations are referred to as asymmetrical...
  • Page 105 10/00 AWB27-1301-GB Glossary ISO/OSI The ISO/OSI model describes a model for classifying data transmission and processing between two computers. Leased line A permanently switched transmission line. Modem Abbreviation for “modulator demodulator”. A device which converts digital signals into analogue signals and vice versa. Outstation A station which is monitored or monitored and controlled by a central station.
  • Page 106 10/00 AWB27-1301-GB Glossary Telecontrol configuration The combination of telecontrol stations and the transmission paths between these stations. Telecontrol station Central station or outstation within a telecontrol system. Telecontrol system A telecontrol system is used to control and monitor proc- esses that are distributed over a wide area. The system consists of all devices and functions for data acqui- sition, processing, transmission and display of the necessary process information.
  • Page 107 10/00 AWB27-1301-GB...
  • Page 108: Index

    10/00 AWB27-1301-GB Index Accessing data arrays Fixed length frames ........23 Variable length frames .........23 ACD data ............74 ACD offset addresses ...........17 ACD subaddress ..........17 acd_length ............18 acd_offset ............18 acd_subaddress ...........18 Address, secondary station in telecontrol line ..57 Arrays Primary station ..........19 Secondary station .........19 Assigning data array parameters Universal function blocks ......15...
  • Page 109 10/00 AWB27-1301-GB Index destination_offset ..........18 Directory structure ..........27 Error code .............60, 93 Error indication, with a secondary station ....60 fixed_length ............18 Frame format, selection ........58 Frames repeated Number in the event of protocol errors ..58 Function block inputs Description ...........56 Function block outputs Description ...........60 Function blocks ...........25...
  • Page 110 10/00 AWB27-1301-GB Index Offset address .............13 Operating modes Basic function block ........42 Universal function blocks ......76 Operational behaviour .........37 Organisation ............11 Parameter assignment Example ............20 Procedure .............19 Parameters for user data length .....14, 16 Primary station ............7 Procedure ............91 Range limits ............18 Universal function block data arrays .....15 Reading data array elements .......23 rec_dat ..............19...
  • Page 111 10/00 AWB27-1301-GB Index Service 16: Read variable length frame FLASH/RAM memory card data ......67 Service 17: Send/read fixed length frame RAM data ............69 Service 20: Read PLC clock at outstation .....70 Service 21: Synchronise PLC clock at outstation ............71 Service 22: Synchronise PLC clock at outstation broadcast ........72 Service 30: Remote reset ........73 Service 31: Read status ........73...
  • Page 112 10/00 AWB27-1301-GB Index Universal function block ........53 User data length parameters ....14, 15, 16 User_status bits ...........24 Variable access service ........38 variable_length ...........18 Writing data array elements ........22 Writing of data ............57...
  • Page 113 10/00 AWB27-1301-GB...

Table of Contents