Siemens SIMATIC PCS 7 Function Manual
Hide thumbs Also See for SIMATIC PCS 7:
Table of Contents

Advertisement

Quick Links

SIMATIC
PCS 7
S7HMODM3 Modbus – Master –
Communication package
Function Manual
09/2024
Cybersecurity information
Introduction
Installation / Configuration
CFC Programming
Upgrade from CP 341 to
CM PtP
Detailed description of the
function blocks
1
2
3
4
5
6

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMATIC PCS 7 and is the answer not in the manual?

Questions and answers

Summary of Contents for Siemens SIMATIC PCS 7

  • Page 1 Cybersecurity information Introduction Installation / Configuration SIMATIC CFC Programming PCS 7 S7HMODM3 Modbus – Master – Upgrade from CP 341 to CM PtP Communication package Detailed description of the function blocks Function Manual 09/2024...
  • Page 2 Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems.
  • Page 3: Table Of Contents

    Table of contents Cybersecurity information........................7 Introduction ............................9 General ..........................9 2.1.1 License conditions ....................... 9 2.1.2 Hardware..........................9 2.1.3 Software..........................9 2.1.4 Application in the field with CP 341 ..................9 2.1.5 Restrictions........................11 Personal data disclaimer..................... 12 Security concept ........................
  • Page 4 Table of contents Configuration of the basic communication parameter............42 Driver Wizard and Diagnostic concept................. 43 Summary........................... 44 Detailed description of the function blocks ..................45 Overview ........................... 45 Used blocks from PCS 7 Advanced Process Library(APL) and PCS 7 Basis Library....45 Modbus-Master- Communication block: S7HMODM3............
  • Page 5 Table of contents 6.9.3 Called organisation blocks (OBs) ..................75 6.9.4 Alarm reaction ........................75 6.9.5 Error handling........................75 6.9.6 Parameters list ........................76 6.10 Modbus Master receive block for double integer values: MODMR_DI ........77 6.10.1 Type / Number / Symbol ..................... 77 6.10.2 Application field .........................
  • Page 6 Table of contents S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 7: Cybersecurity Information

    Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly recommends that product updates are applied as soon as they are available and that the latest product versions are used. Use of product versions that are no longer supported, and failure to apply the latest updates may increase customer’s exposure...
  • Page 8 Cybersecurity information S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 9: Introduction

    – PCS 7 V7.1 SP2 to V8.2 SP1 (S7HMODM3 V4.9) – PCS 7 V9.0 to V10.0 (S7HMODM3 V7.4) For the use with other PCS7 versions, please contact (mailto:function.blocks.industry@siemens.com). • The usage with a S7-416 and plan-in-plan technique, is not approved 2.1.4...
  • Page 10 Introduction 2.1 General For the realization of a Modbus - Master communication via the CM PtP, the communication processor will be connected via PROFINET IO to a S7-41x, respectively a S7-41x H for the redundant version. As bus physics for the MODBUS link RS 232C, and RS 422/485 are supported. A detailed description of required function blocks is available in chapter : "Detailed description of the function blocks (Page 45)".
  • Page 11: Restrictions

    Introduction 2.1 General 2.1.5 Restrictions A maximum number of one S7HMODM3 block, 9 EXSQ_MOD blocks and 100 read or write parameters are possible per CP. The number of possible parameters can be fewer, if large data packets are to be read or written. The execution time may also deeply vary according to the installation, the type of Modbus slaves, the settings, and the quantity of data to be exchanged.
  • Page 12: Personal Data Disclaimer

    Personal data disclaimer (V1.1.0) Siemens observes the principles of data protection, in particular the principle of data minimization (privacy by design). For this reason, the product only processes / stores technical functional data (e.g. time stamps) and no personal data. If the user links this data with other data (e.g.
  • Page 13: Qualified Personnel

    Note of Usage and Misuse Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems.
  • Page 14: Prevention Of Misconfiguration

    If this functionality isn't handled inside this document, the system behavior of this function blocks can differ from the superior system. For more information about this topic, please mail to: function.blocks.industry@siemens.com. System Hardening To increase the security of the plant, we recommend a system hardening of this system and all other systems (like IEDs).
  • Page 15: Integrity Of Delivery

    2.10 Updates Updates are published on the Siemens SIOS webpage. Alternatively, updates can be requested on our hotline. Depending on the update cause (feature extensions, bug fixing, closing security issues, ...), the installation of the update should be considered. The availability of security updates should be checked permanently, to ensure a proper and secure operation.
  • Page 16 Introduction 2.10 Updates S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 17: Installation / Configuration

    Installation / Configuration Installation The library is installed by the installation file. The installation file will guide you through the following steps. Figure 3-1 Installation – Start screen S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 18 Installation / Configuration 3.1 Installation Figure 3-2 Installation – License Agreement S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 19 Installation / Configuration 3.1 Installation Figure 3-3 Installation – Version of PCS 7 Note For updating PCS 7 from a version earlier than PCS 7 V9.1SP2 to version V9.1SP2 or higher first you need to uninstall the existing version of Modbus Advanced CM PtP. This can be done with the uninstall function of windows.
  • Page 20 Installation / Configuration 3.1 Installation Figure 3-5 Installation - Process Figure 3-6 Installation successful S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 21: Uninstallation

    Installation / Configuration 3.2 Uninstallation Figure 3-7 Installation – License information Uninstallation For uninstallation, please proceed as follow. Figure 3-8 Uninstallation – Selecting App S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 22 Installation / Configuration 3.2 Uninstallation Figure 3-9 Uninstallation – Modify to uninstall Figure 3-10 Uninstallation – Proceeding uninstallation S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 23: Hardware Configuration

    Installation / Configuration 3.3 Hardware configuration Figure 3-11 Uninstallation – Confirm uninstallation Figure 3-12 Uninstallation – Feedback for successfully uninstallation Hardware configuration 3.3.1 Overview • The actual HW-configuration must be loaded in the CPU of the S7-41x (H. • The communication partner connected must be electrically correct. •...
  • Page 24: Example Cp 341

    Installation / Configuration 3.3 Hardware configuration 3.3.2 Example CP 341 Example of a HW configuration S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 25 Protocol of the Loadable Driver • Configure the protocol with "MODBUS Master". You can download the driver at (https:// support.industry.siemens.com/cs/document/27774018/loadable-driver-modbus-master- (rtu)). • Open the protocol window in order to configure the Modbus communication. The settings are explained in the following paragraph.
  • Page 26 Installation / Configuration 3.3 Hardware configuration Protocol settings for the Modbus Master The specific protocol settings have to be coordinated with the Modbus partner. S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 27: Example Cp Ptp

    Installation / Configuration 3.3 Hardware configuration Adjustment of a data flow parameter • Load the drivers (only once). 3.3.3 Example CP PtP In the SIMATIC "HW Config" the CM PtP is placed in PROFINET IO/ET 200SP HA/IM155-6 PN HA Red V1.2/CM/Point-to-Point/CM PtP. S7HMODM3 Modbus –...
  • Page 28 Installation / Configuration 3.3 Hardware configuration HW config catalogue view of CM PtP Figure 3-13 HW config catalogue view of CM PtP Note If the CM PtP for ET 200SP HA is not available in the HW catalogue of SIMATIC "HW Config" it can be installed via hardware support package (HSP).
  • Page 29 Installation / Configuration 3.3 Hardware configuration HW config ET 200SP HA with CM PtP S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 30 Installation / Configuration 3.3 Hardware configuration HW config CM PtP example properties 1 The necessary properties in the SIMATIC "HW Config" can be done in the properties of the CM PtP. HW config CM PtP example properties 2 S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 31 Installation / Configuration 3.3 Hardware configuration CM PtP Edit Symbols 1 For the interconnection to the function block it is recommended to create a symbol for the first input byte of the CM PtP. S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 32 Installation / Configuration 3.3 Hardware configuration CM PtP Edit Symbols 2 S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 33: Cfc Programming

    CFC Programming Principle The Modbus communication is managed by one main function block: S7HMODM3. The main FB sends or receives the data via the CP 341 related to CM PtP by using the Modbus Point-to-Point protocol. Each data sending or data receipt is managed by the main function block but is finalized by the following process blocks: Process block Task...
  • Page 34: How To Send Data

    In case you are not sure which license key you need to enter, please contact our support team and provide the PLCs serial number and the libraries license number which is part of the delivery: function.blocks.industry@siemens.com The PLCs serial number can be identified in different ways: • Printed on the PLCs housing •...
  • Page 35: How To Fetch Data

    CFC Programming 4.4 How to fetch data Example for data to be sent in CFC Note When writing coils with function code 15 • The coils are stored in registers. • Integer values are stored using 16 coils. Double Integer and Real values are both stored using 32 coils.
  • Page 36 CFC Programming 4.4 How to fetch data Example for data to be fetched in CFC S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 37 CFC Programming 4.4 How to fetch data Example of MODMR_I configured to receive coils The received data is available at the outputs iRecv_1 to iRecv127 for further operation. Note When fetching coils (function codes 1 and 2) • The coils are stored in registers. •...
  • Page 38 CFC Programming 4.4 How to fetch data S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 39: Upgrade From Cp 341 To Cm Ptp

    Upgrade from CP 341 to CM PtP Overview This library is designed to switch the existing communication from CP 341 to CM PtP with a minimum of modification. Overview of the necessary steps: • Electrical setup of an ET 200SP HA with CM PtP and change of wiring from CP 341 to CM PtP. •...
  • Page 40 Upgrade from CP 341 to CM PtP 5.3 Hardware Configuration Hardware Configuration of CM PtP Parametrization of CM PtP in the Hardware Configuration Taking over the parameter from CP 341 to CM PtP. S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 41: Installation And Block Update

    Upgrade from CP 341 to CM PtP 5.4 Installation and Block update Start Address of CM PtP in the Hardware Configuration Assigning a symbol for the start address of the CM PtP and save and compile. Installation and Block update Install the library by following the instructions in the topic Installation (Page 17). This updates the block types in the project too.
  • Page 42: Configuration Of The Basic Communication Parameter

    Upgrade from CP 341 to CM PtP 5.5 Configuration of the basic communication parameter Block Update with the new library Version Configuration of the basic communication parameter After performing Block update the parameters for communication are available and can be adjusted based on the hardware configuration. For using the library in demo mode, the parameter KEY_R0 and KEY_R1 can be left free.
  • Page 43: Driver Wizard And Diagnostic Concept

    Upgrade from CP 341 to CM PtP 5.6 Driver Wizard and Diagnostic concept Additional Parametrization of the new S7HMODM3 Block Driver Wizard and Diagnostic concept Connecting the Start Address of CM PtP with the new S7HMODM3 Block For using the driver wizard the Parameter CM_Start must be connected to the start address of the CM_PtP.
  • Page 44: Summary

    Upgrade from CP 341 to CM PtP 5.7 Summary Generating module drivers Compiling the program with "Generate module drivers" for automatic call-up, automatic parameterization and connection of the diagnostic blocks. Summary With the design of the library, a conversion of the existing communication from CP 341 to CM PtP can be done with a minimum modification, thanks to the way the CM PtP support is integrated and the block update functionality.
  • Page 45: Detailed Description Of The Function Blocks

    Detailed description of the function blocks Overview The data exchange between the S7-41x (H) CPU and the CP 341 is implemented via PROFIBUS DP. A parameterization of the link is not required. The CP 341 converts the telegrams by using the Modbus RTU format.
  • Page 46 Detailed description of the function blocks 6.2 Used blocks from PCS 7 Advanced Process Library(APL) and PCS 7 Basis Library Block FB-Number Library Receive_P2P FB 1994 PCS_7_AP_Library_V91 Receive_Reset FB 1995 PCS_7_AP_Library_V91 Send_Config FB 1991 PCS_7_AP_Library_V91 Send_P2P FB 1993 PCS_7_AP_Library_V91 EXSQ_MOD FB 251 S7HMODM3 GET_DBN FC 601...
  • Page 47: Modbus-Master- Communication Block: S7Hmodm3

    Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 Modbus-Master- Communication block: S7HMODM3 6.3.1 Type / Number / Symbol S7HMODM3 (FB 240) V7.4 Figure 6-1 CFC-Function block S7HMODM3 (FB 240) S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 48: Application Field

    Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 6.3.2 Application field The function block manages the communication between a S7-41x / S7-417H CPU and a CP 341. In case of using the CP 341 the module is placed in an ET 200M rack as Modbus-Master (HW- Dongle).
  • Page 49: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 In case the option "Generate module drivers" is not used, the following parameter must be adjusted manually: • Connections from the parameter MS, Mode, DataXchg, DataXchg1, MsgXchg of the S7HMODM3 to the MOD_CM block. •...
  • Page 50: Error Handling

    Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 Depending on the FEATUREBIT.30 (1=internal diagnostic / 0 = external diagnostic) different alarms are enabled. Table 6-1 Alarm_8P of MB_ADV_COM (FB 2240) Alarm Nb. FB parameter Standard settings Alarm class Diagnostic SIG_1 QRACKF 1=Rack Failure Module...
  • Page 51 Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 CFC- Function block FB 240 (S7HMODM3) with Error code 5 S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 52: Parameters List

    Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 6.3.6 Parameters list Input parameters Parameter Description Type Default value LADDR Logical I/O start address of CP; see HW config CHAIN 1 = chain with connected extension block(s) BOOL SeqCycMax Max CPU cycles allowed for executing a se‐...
  • Page 53 Detailed description of the function blocks 6.3 Modbus-Master- Communication block: S7HMODM3 Parameter Description Type Default value QMODF 1 = Module Removed/Out of Order BOOL QPERAF 1 = I/O Module Access Failure BOOL QPARF 1 = Parameter Assignment Error Module BOOL QRED_ERR 1 = Redundancy lost BOOL QCOMACT...
  • Page 54: Extension Block For The Modbus Communication: Exsq_Mod

    Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD Extension block for the Modbus communication: EXSQ_MOD 6.4.1 Type / Number / Symbol EXSQ_MOD (FB 251) Figure 6-2 CFC-Function block EXSQ_MOD (FB 251) S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 55: Application Field

    Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD 6.4.2 Application field If more than 10 tasks (i.e. "send data" or "fetch data") are needed, the main function block S7HMODM3 is not enough and a new FB EXSQ_MOD has to be used. Up to 9 EXSQ_MOD blocks can be connected to one S7HMODM3 block.
  • Page 56: Parameters List

    Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD 6.4.4 Parameters list Input parameters Parameter Description Type Default value LADDR Logical I/O start address of CP; see HW Config INT STRT_SEQ Start sequence BOOL MST_LINK Connection to the master block EXT_LINK Connection to an extension block MST_CONN...
  • Page 57: Example

    Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD 6.4.5 Example The next picture is an example of Modbus communication based on the FB S7HMODM3 and two FB EXSQ_MOD. You will find this example project within the library as well. Blocks connections and configurations The FB S7HMODM3 uses the CP/CM having the I/O start address 512 (LADDR = 512).
  • Page 58 Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD Example of Modbus communication with one S7HMODM3 and two EXSQ_MOD S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 59 Detailed description of the function blocks 6.4 Extension block for the Modbus communication: EXSQ_MOD S7HMODM3 Modbus – Master – Communication package Function Manual, 09/2024...
  • Page 60: All Process Blocks

    Detailed description of the function blocks 6.5 All process blocks Incorrect setup of two EXSQ_MOD blocks to one S7HMOMD3 block Only one EXSQ_MOD configured with MST_CONN = 1 can be connected after only one S7HMOMD3. The setup shown below is incorrect. All process blocks Concerning the blocks MODMR_I (FB242), MODMS_I (FB243), MODMR_R (FB244), MODMS_R (FB245), MODMR_DI (FB246), MODMS_DI (FB247), due to the programming of the block, there...
  • Page 61: Modbus Master Receive Block For Integer Values: Modmr_I

    Detailed description of the function blocks 6.6 Modbus master receive block for integer values: MODMR_I used to extend the range. Indeed, the real starting address calculated and used by the block is Reg_Off + Reg_strt which belongs to the range [1… 82766]. The FB does not check the validity of the starting address calculated with Reg_Off + Reg_strt.
  • Page 62 Detailed description of the function blocks 6.6 Modbus master receive block for integer values: MODMR_I Each partner system (slave) on MODBUS has its own SlaveAdd. With function codes (Fct_code) the analogue and binary values are selected for reading input or output registers or status from the partner system.
  • Page 63: Watchdog Function

    Detailed description of the function blocks 6.6 Modbus master receive block for integer values: MODMR_I Function code 4 "Read Input Registers" According to the Modbus protocol, the quantity of inputs registers is limited to [1…125] and the starting address to [1… 65535]. Here are the values supported by the block. Parameter Meaning Values...
  • Page 64: Error Handling

    Detailed description of the function blocks 6.6 Modbus master receive block for integer values: MODMR_I 6.6.6 Error handling This function block controls some alarm parameters such as limit and plausibility control as well as the watchdog control. Failures are always indicated with the output bit QError = "1" and QRetVal ≠...
  • Page 65: Modbus Master Send Block For Integer Values: Modms_I

    Detailed description of the function blocks 6.7 Modbus Master send block for integer values: MODMS_I Output parameters Parameter Description Type Default value QRetVal General return value QError Error detect BOOL QDB_No Instance data block number QSndStrt Start address of send data QSnd_Len Send length = (6 Byte Add-Header) DINT...
  • Page 66: Application Field

    Detailed description of the function blocks 6.7 Modbus Master send block for integer values: MODMS_I 6.7.2 Application field The output parameter QDB_No, QSndStrt and QSndLen of MODMS_I are linked with the input parameters DBNO_x, SND_ADRx and SND_LENx of FB S7HMODM3 (FB240). Each partner system (slave) on MODBUS has its own SlaveAdd.
  • Page 67: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.7 Modbus Master send block for integer values: MODMS_I Function code 16 "Write Multiple Registers" Parameter Meaning Values Reg_Strt Register start address [0 ... 32767] Reg_Off Address offset [0 … 49999] Reg_No Quantity of registers [0 ...
  • Page 68: Parameters List

    Detailed description of the function blocks 6.7 Modbus Master send block for integer values: MODMS_I 6.7.6 Parameters list Input parameters Parameter Description Type Default value SlaveAdd Slave address Fct_Code Function code; 5, 6, 15, 16 Reg_Strt Register start address Reg_Off Register start offset (0...49999) DINT Reg_No Number of registers;...
  • Page 69: Modbus Master Receive Block For Real Values: Modmr_R

    Detailed description of the function blocks 6.8 Modbus Master receive block for real values: MODMR_R Modbus Master receive block for real values: MODMR_R 6.8.1 Type / Number / Symbol MODMR_R (FB 244) Figure 6-5 CFC- Function block MODMR_R (FB 244) 6.8.2 Application field The output parameters QDB_No, QSndStrt, QSndLen, QRcvStrt and QRcvLen of MODMR_R are linked with the input parameters DBNO_x, SND_ADRx, SND_LENx, RCV_ADRx and RCV_LENx of FB S7HMODM3 (FB240).
  • Page 70 Detailed description of the function blocks 6.8 Modbus Master receive block for real values: MODMR_R Functions code Task Read of up to 63 registers (Real value): Read Holding Registers Read of up to 63 registers (Real value): Read Input Registers The input parameter Reg_Strt defines the first address of data to be read. The default setting of register offset Reg_Off is "0".
  • Page 71: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.8 Modbus Master receive block for real values: MODMR_R Function code 4 "Read Input Registers" Principle According to the Modbus protocol, the quantity of inputs registers is limited to [1 …125] and the starting address to [1 … 65535]. Parameter Meaning Values...
  • Page 72: Error Handling

    Detailed description of the function blocks 6.8 Modbus Master receive block for real values: MODMR_R 6.8.6 Error handling This function block controls some alarm parameter such as limit and plausibility control as well as the watchdog control. Failures are always indicated with the output bit QError = "1" and QRetVal ≠...
  • Page 73: Modbus Master Send Block For Real Values: Modms_R

    Detailed description of the function blocks 6.9 Modbus Master send block for real values: MODMS_R Output Parameters Parameter Description Type Default value QRetVal General return value QError Error detect BOOL QDB_No Instance data block number QSndStrt Start address of send data QSnd_Len Send length = (6 Byte Add-Header) DINT...
  • Page 74: Application Field

    Detailed description of the function blocks 6.9 Modbus Master send block for real values: MODMS_R 6.9.2 Application field The output parameters QDB_No, QSndStrt and QSndLen of MODMS_R are linked with the input parameters DBNO_x, SND_ADRx and SND_LENx of FB S7HMODM3 (FB240). Each partner system (slave) on MODBUS has its own SlaveAdd.
  • Page 75: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.9 Modbus Master send block for real values: MODMS_R Function code 16 "Write Multiple Registers" Parameter Meaning Values Reg_Strt Register start address [0 ... 32767] Reg_Off Address offset [0 … 49999] Reg_No Quantity of registers [0 ...
  • Page 76: Parameters List

    Detailed description of the function blocks 6.9 Modbus Master send block for real values: MODMS_R 6.9.6 Parameters list Input parameters Parameter Description Type Default value SlaveAdd Slave address Fct_Code Function code; 5, 6, 15, 16 Reg_Strt Register start address Reg_Off Register start offset (0...49999) DINT Reg_No Number of registers;...
  • Page 77: Modbus Master Receive Block For Double Integer Values: Modmr_Di

    Detailed description of the function blocks 6.10 Modbus Master receive block for double integer values: MODMR_DI 6.10 Modbus Master receive block for double integer values: MODMR_DI 6.10.1 Type / Number / Symbol MODMR_DI (FB 246) Figure 6-7 CFC- Function block MODMR_DI (FB 246) 6.10.2 Application field The output parameters QDB_No, QSndStrt, QSndLen, QRcvStrt and QRcvLen of MODMR_DI are...
  • Page 78 Detailed description of the function blocks 6.10 Modbus Master receive block for double integer values: MODMR_DI Functions code  Task Read of up to 63 double integer values (126 Registers) Read holding reg‐ isters Read of up to 63 double integer values (126 Registers) Read Input Registers Over Reg_Strt is given the address of the first register (or coil) to fetch.
  • Page 79: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.10 Modbus Master receive block for double integer values: MODMR_DI Function code 4 "Read Input Registers" According to the Modbus protocol, the quantity of inputs registers is limited to [1 …125] and the starting address to [1 … 65535]. Parameter Meaning Values...
  • Page 80: Error Handling

    Detailed description of the function blocks 6.10 Modbus Master receive block for double integer values: MODMR_DI 6.10.6 Error handling This function block controls some alarm parameter – such as limit and plausibility control as well as the watchdog control. Failures are always indicated with the output bit QError = "1" and QRetVal ≠...
  • Page 81: Modbus Master Send Block For Double Integer Values: Modms_Di

    Detailed description of the function blocks 6.11 Modbus Master send block for double integer values: MODMS_DI Output parameters Parameter Description Type Default value QRetVal General return value QError Error detect BOOL QDB_No Instance data block number QSndStrt Start address of send data QSnd_Len Send length = (6 Byte Add-Header) DINT...
  • Page 82: Application Field

    Detailed description of the function blocks 6.11 Modbus Master send block for double integer values: MODMS_DI 6.11.2 Application field The output parameters QDB_No, QSndStrt and QSndLen of "MODMS_DI" (FB243) are linked with the input parameters DBNO_x, SND_ADRx and SND_LENx of FB "S7HMODM3"(FB240). Each partner system (slave) on MODBUS has its own SlaveAdd.
  • Page 83: Called Organisation Blocks (Obs)

    Detailed description of the function blocks 6.11 Modbus Master send block for double integer values: MODMS_DI Function code 16 "Write Multiple Registers" Parameter Meaning Values Reg_Strt Register start address [0 ... 32767] Reg_Off Address offset [0 … 49999] Reg_No Quantity of registers [0 ...
  • Page 84: Modbus-Master-Communication Block: Mb_Adv_Master

    Detailed description of the function blocks 6.12 Modbus-Master-Communication block: MB_ADV_Master Parameter Description Type Default value Reg_Strt Register start address Reg_Off Register start offset (0...49999) DINT Reg_No Number of registers; Fct_Code=6: Reg_Val SlaveAdd_1 Slave address BYTE 16#00 Fct_Code_1 Function code 6,15,16 BYTE 16#10 Reg_Strt_1 Register start address...
  • Page 85: Alarm Reaction

    Detailed description of the function blocks 6.12 Modbus-Master-Communication block: MB_ADV_Master 6.12.4 Alarm reaction This function block has no integrated alarm function. 6.12.5 Error handling Error code Description Remedy 0x0000 No error   0x8380 CRC error Checksum error of the Modbus frame. Check the communica‐ tion partner.
  • Page 86 Detailed description of the function blocks 6.12 Modbus-Master-Communication block: MB_ADV_Master Error code Description Remedy 0x0094 Frame end identified based on   the "Receipt of fixed/maximum frame length" 0x0095 Frame end identified based on   "Message timeout" 0x0095 Frame end identified based on  ...
  • Page 87: Parameters List

    Detailed description of the function blocks 6.12 Modbus-Master-Communication block: MB_ADV_Master Error code Description Remedy 0x8190 Incorrect setting of the CRC cal‐ Select a suitable value for the CRC culation calculation. The following are val‐ deactivated or activated. Check whether the module addressed supports CRC calculation.
  • Page 88: Static Parameters

    Detailed description of the function blocks 6.12 Modbus-Master-Communication block: MB_ADV_Master Static parameters Parameter Description Type Default value SFCSTATUS STATUS of SFC 51 RDSYSST DWord MB_State Internal state of the Modbus master operation Word Blocked_Proc_Time‐ Time to wait upon a blocked Modbus Master in‐ Real stance before setting inactive Extended_Address‐...

Table of Contents