Showing posts with label S7-1200. Show all posts
Showing posts with label S7-1200. Show all posts

Monday, August 26, 2013

Useful Tips When Working With S7-1200

1. What is the range of functions of the S7-1200 App?

2. In STEP 7 (TIA Portal) V11, how do you download a project into an S7-1200 CPU when you have previously downloaded with STEP 7 V12?


3. Where do you find the latest operating system updates (firmware) for SIMATIC S7-1200 controllers?


4. How do you standardize and destandardize analog values with STEP 7 (TIA Portal)?


5. What is the connection between subnet masks and IP addresses with regard to subnetting and supernetting (Classless Inter Domain Routing CIDR)?


6. What is the meaning of the terms "sinking" (German: "P-schaltend") and "sourcing" (German: "M-schaltend") in digital modules of SIMATIC?


7. Which PROFINET nodes support the extended PN diagnostics and what do you have to configure?

Tuesday, August 13, 2013

POPULAR RETURN! CPU1214c @RM899 only!

*AVAILABLE* SIMATIC STEP 7 (TIA Portal) V12 TRIAL

SIMATIC STEP 7 (TIA Portal) V12 SP1 + PLC SIM SP1 Download

Now available for download!
CLICK HERE


HARDWARE SUPPORT PACKAGE for SIMATIC STEP 7 (TIA Portal) V12
CLICK HERE

Thursday, June 27, 2013

SIMATIC STEP 7 (TIA Portal) V12 TRIAL Download

You may now download SIMATIC STEP 7 (TIA Portal) V12 TRIAL !

~DOWNLOAD NOW~

Note: Trial version only lasts for 21 days. If interested, please contact us to purchase the full and licensed version.

Monday, June 24, 2013

NEWSLETTER UPDATE JUNE 2013 (2nd ED.)

Online Support Forum: Premium Campaign

Invitation to the 7th Premium Campaign
Duration :
20th of June 2013 until the 17th of July 2013

Be an active participant in the Siemens Technical Forums NOW to collect premium points and get rewarded for your efforts!
Are you a forum member yet? Register now!! It is free of charge!
HURRY UP!!!
Read more here!

***UPDATE*** Applications & Tools  
Applications & Tools / Task / Technology / Measurement & Sensors

Reading Data Matrix Codes With S7-1200 and Archiving Them in an MS Access Database (Set 27) (2013-06-10) [40603943]
For products: 6AG1211-1AE31-2XB0; 6AG1211-1AE31-4XB0; 6AG12
Task With an unambiguous coding, all the production steps for every part produced can be planned and carried out. The purpose of this application is to identify products reliably with a coding and to trace them after they have been delivered. A reader should read various codes on the surface of the products, and transmit them with RS232 to a SIMATIC S7 station and then to a database.
=> Read More

Applications & Tools / Task / Technology / Communication

Data communication between several S7-1200 with or without Telecontrol Server Basic (Set 31) (2013-06-19) [58099765]
For products: 6ES7211-1AD30-0XB0; 6ES7211-1BD30-0XB0; 6ES72
The task in general terms This application refers to the topic of wireless communication between distributed automation stations via UMTS/GPRS (M2M communication), with and without a control center. The document is broken down into several variants which differ with regard to the transmission protocols and the different hardware components used in the remote stations.


=> Read More

Measuring & Control S7-1200 Set 24: Switching Loads with S7-1200 and SENTRON PAC3200 via MODBUS TCP (2013-06-10) [58856464]
For products: 6AV6647-0AD11-3AX0; 6ES7211-1AD30-0XB0; 6ES72
Problem Power utilities charge industrial electricity customers not only for the active energy consumed (in kWh), but they also make the kilowatthour rate dependent on a power limit (in kW). The power limit is defined as the average of the total electric power imported over a defined measuring period. If this power limit specified by the power utility is exceeded, a higher kWh price
will be charged for the entire accounting period

=> Read More

Thursday, June 20, 2013

Newsletter June 2013

***FAQs***

1) How can you read in the S7-1200 CPU which data has been written by an OPC client to the process image of the CP?
The TC_RECV function of the CP returns always the complete process image. In order to know which values have recently been changed by an OPC Client a flag array “New_Received_TC_Data” has been introduced indicating which values in the process image have been written.  
Read More

2) How can you read the GSM/GPRS network stuatus of the CP 1242-7 in the S7-1200 CPU?



 The GSM/GPRS network status of the CP 1242-7 can be read in the S7-1200 CPU via the Readrecord function and can be stored in a DB in the CPU
Read More


***UPDATES***

1) Benefits of a Systemwide Migration to the TIA Portal
This set of slides shows the potentials of a migration to the TIA Portal. With the aid of an example system all the components are migrated and the resulting benefits described.
Read More

2) Ports released for Modbus/TCP communication
By default, the protocol uses Port 502 as local port in the Modbus server.
You can set the local port as you wish in the Modbus client. Usually, port numbers starting at 2000 are used.

Read more & View Full table here

***APPLICATION & TOOLS***

1) Measuring& Control S7-1200 Set 22: Data Communication between S7-1200 and SENTRON PAC3200 via MODBUS TCP
Configuration Example describes the data exchange of a S7-1200 controller with one or several SENTRON PAC3200 power monitoring devices based on the Modbus/TCP protocol.
Read More

2)  Industrial Remote Communication S7-1200 Set 30: Data communication between a S7-1200 and Telecontrol Server Basic
Task In a stormwater retention basin, excess water is stored to relieve the sewer system.
Read More 

3) Industrial Remote Communication S7-1200 Set 34: Data communication between a S7-1200 and Telecontrol Server Basic via a temporary GPRS connection
Task A temperature feeler that is connected to the programmable logic controller (PLC) continuously measures the room temperature of a storage room.
Read More

Wednesday, May 8, 2013

NEWSLETTER - 08 MAY 2013

****NEW IMPORTANT DOWNLOADS****

STEP 7 (TIA PORTAL) V11 support packages for hardware catalog in the TIA PORTAL.
Description : New hardware support package to include new models in hardware catalog.

STEP 7 (TIA PORTAL) V12 support packages for hardware catalog in the TIA PORTAL.
Description : New hardware support package to include new models in hardware catalog.

****NEW FAQ UPDATES****
 
What are the requirements for installing STEP 7 (TIA Portal) V12?
Description :  Requirements for installing STEP 7 Basic / Professional V12
Step 7 (TIA PORTAL) V12 is NOW available to be ordered.
Which SIMATIC software can you install in 64-bit operating systems?
Description : Software compatibility with 64-bit operating systems.
>>> Read More Here


*NEW* Release of SIMATIC S7-1217C


The latest release of a powerful new CPU and firmware in the S7-1200 family for compact modular controllers!

• Simatic S7-1217C: New S7-1200 controller for the high-end performance range
• Line driver inputs and outputs to switch stepping motor controls
• New firmware version 4.0 for all Simatic S7-1200 CPUs
• Profinet iDevice functionality and extended access protection

New with Firmware version 4.0 CPU's

• Security Integrated
Protection against unauthorized code or process value changes; which helps to facilitate increased operational availability.
• Know-how Protection
Through password protection unauthorized third parties are not able to open your blocks and thus do not have access to your algorithm.
• Integrated Trace Function
For more effective commissioning and faster problem solving we now have a powerful new integrated tool for analysis of interactions with all CPU tags and analog & digital signals.
• PLCSIM
Complete controller station configuration, programming & testing; and no hardware is required!
Read More
>>> Press Release 08 April 2013 
>>> S7-1200 CPUs




Wednesday, April 17, 2013

NEWSLETTER UPDATES, 17 APRIL 2013


In The News


  1. Mean Time Between Failures (MTBF) list for SIMATIC products
    DESCRIPTION MTBF = Mean Time Between Failures = time between two consecutive failures of a component.
    Click Here
  2. How can you determine the coordinates and synchronize the system time of the S7-1200 using a commercially available GPS receiver?
    Click Here
  3. With which devices can the S7-1200 communicate over the integrated PROFINET interface and which protocols does the S7-1200 support?
    Click Here
  4. How can you use an analog current output with wire break diagnostics on your S7-1200 PLC?
    Click Here
  5. How do you connect a PC station to an S7-1200 with OPC?
    Click Here
  6. How can you use analog 0~20mA signal modules and signal boards with 4~20mA signals?
    Click Here


Wednesday, February 20, 2013

NEWSLETTER 20 FEB 2013

SIMATIC S7-1200 app: new iOS version
With this app, you can connect to an S7-1200, read and write PLC values, call diagnostics information, and much more.
The update for the SIMATIC S7-1200 app allows improved management of SSL certificates for HTTPS communication. Try it out on your iPhone or iPad.
 Free download

S7-1200

Where in STEP 7 (TIA Portal) V11 is there a program for the S7-1200 that lets different bit patterns rotate or flash under time control? (2013-02-08) [67637302]

For products: 6ES7211-1AD30-0XB0; 6ES7211-1AE31-0XB0; 6ES72
Description For testing and commissioning a machine / plant it is sometimes necessary to output defined signal sequences. This entry includes a function block for the S7-1200 in STEP 7 (TIA Portal) V11, with which different bit patterns (flashing / running lights) can be generated. ...
http://support.automation.siemens.com/WW/news/en/67637302?Datakey=47071380

S7-200

Updates
SINAUT Micro SC Declared a Phased-Out Product and Intended End of Production
For products: 6NH9910-0AA10-0AA3; 6NH9910-0AA10-0AA6; 6NH99
The product SINAUT Micro SC will be declared a 'phased-out product' effective March 15, 2013, and its 'end of production' has been terminated for August 15, 2013. SINAUT MICRO SC is a OPC server and communication manager for the connection of S7-200 PLCs to GPRS mobile telephone networks; see entry ID 22727752. ...
 more

Friday, November 30, 2012

FESTIVE YEAR END PROMOTION!!!


*Terms and Conditions applied. ** Promotion period, 1 December 2012 to 31 December 2012 only.

Tuesday, September 4, 2012

Wireless Data Communication via GPRS with S7-1200 and CP 1242-7, Scenario 2, Cross communication

 

The task in general termsThis application refers to the topic of wireless communication between distributed automation stations via GPRS (M2M communication), with and without a control center. The document is broken down into several variants which differ with regard to the transmission protocols and the different hardware components used in the remote stations. It is aimed at providing a selection aid, so as to find the best variant based on the technical parameters and with consideration to the conceptual requirements. Furthermore, this application description focuses on the provision of helpful advise for the configuration and parameter assignment of the selected variant. The task in concrete terms
Each variant is explained in greater detail on the basis of a specific application example. 

  •  Variant 1:
    The filling level of an elevated water tank shall be transmitted to a pump station. For the purpose of remote control and remote visualization, the two distributed stations are already linked to a control center.
  • Variant 2:
    The power supplier and operator of a wind farm shall be able to adjust the output of his wind farm to the current consumption situation in the electricity grid. This shall be effected by means of an I/O connection between several wind turbines and a switching station. There is no control center involved in this system.
 
  •  Variant 3:
    Several oil production fields are equipped with a series of controllers. They are used for simple automation tasks like the control of pumps, for example. Now, the filling level information from all oil production fields shall be transmitted to a higher-level controller with higher performance capacity, so as to enable global releases for oil production. There is no control center involved in this system.
 

Solution 
The variants discussed in this application example (configuration example CE-X21, scenario 2) show, how the given tasks can be solved with the help of SIMATIC components. The central component in this solution is the GPRS modem SIMATIC CP 1242-7. With the help of CPs for the SIMATIC S7-1200 controllers, telegrams can be sent to other CPs or to other IP-capable network participants over a GPRS connection.
A SIMATIC CP 1242-7 GPRS (2) is connected to a SIMATIC S7-1200 controller 1211C (3) via the bus interface. The GSM/GPRS modem is equipped with a SIM card (5) and connection to the air interface is realized with a quad band GSM/GPRS antenna type ANT 794-4MR (4). All components are supplied with power by a SIMATIC PM 1207 power module (1). 


Depending on the specific variant, a further SIMATIC S7-1200 controller in combination with a SIMATIC CP 1242-7, or a SIMATIC S7-300 controller with UMTS/GPRS modem SCALANCE M 873-0 are used.
A UMTS/GSM modem SCALANCE M873-0 (2) is connected to a SIMATIC S7-300 controller 315-2 PN/DP (4). The UMTS/GSM modem is equipped with a SIM card (5) and connection to the air interface is realized with a quad band antenna type ANT 794-4MR (1). All components are supplied with power by a SIMATIC PS307 power module (3). The S7-300 controller is provided with a SIMATIC micro memory card.


    
 













For more information,please visit SIEMENS website

Monday, September 3, 2012

Firmware V1.3 for CP 1242-7 GPRS Communication Module for S7-1200 Released for Delivery 

 

Summary

The firmware version 1.3 for the GPRS communication module CP 1242-7 (order number 6GK7242-7KX30-0XE0) has been released for delivery.
The new firmware version contains the following enhancements: 

Connection monitoring of GPRS direct connections
In the case of direct communication between stations in the GPRS Direct Mode, both the passive and the active station will now detect a connection failure on the radio network line. This enables a faster response to the connection failure by the program.
The connection failure is detected by means of a connection watchdog time. The connection watchdog time can be configured in STEP7 under:
    - Device configuration -> CP1242-7 -> Telecontrol Interface -> Keep-alive-Waiting time -> Connection watchdog time (the value 0 means disabling the connection monitoring,
       until now this parameter had no meaning in the GPRS Direct Mode)

Please note: The use of connection monitoring will result in increased data volume, because the stations must exchange cyclic Keep Alive messages. 


Support of new SIM card technologies
All currently available SIM cards can now be employed. A changeover of the SIM card technology of some providers caused isolated problems with the identification of the SIM card. 


Missing SIM card has no influence on the S7-1200 CPU
Even if no SIM card is inserted, the CPU program of the S7-1200 PLC will start up normally. S7-1200-based stations can thus be equipped with the CP1242-7 even if the GPRS functionality is not used from the beginning. 


Enhanced SMS diagnostic option:
Authorized mobile telephone units can enquire extended station information via a text message (SMS) with the text "CPDIAG".


In addition, small bug fixes have been introduced to further improve system stability.

New orders will be shipped with firmware 1.3 from end of August 2012 onwards.


The configuration with Step7 is carried out with the same configuration screen form as for the predecessor version 1.0. A differentiation is neither necessary nor possible.

The current firmware version can be enquired in the Step7 Device Manager via the module status (online connection required). 


 Internet document
 A S7-1200 PLC can be connected to a GSM/GPRS mobile phone network with the new CP 1242-7 communication processor. 



The CP 1242-7 uses the globally available GSM mobile phone network to transmit productive data and diagnostic information of the S7-1200 based on the GPRS data service to other mobile subscribers or to control centers via the Internet.

By using the CP 1242-7, you can use the S7-1200 as Remote Terminal Unit (RTU) in telecontrol and remote maintenance applications. Together with the "TeleControl Server Basic" software (ID: 45500914) you are creating the "TeleControl Basic" telecontrol system with perfectly matched components.



1. Product description

The CP 1242-7 communication processor is used for connection of a SIMATIC S7-1200 to the GSM/GPRS mobile phone network and is characterized by the following features.
·                      provides global wireless data exchange between S7-1200 controllers and/or control centers with Internet connection
·                      communication based on the GPRS (General Packet Radio Service) mobile phone service with data transmission
                      speeds of up to 86 kbps in the downlink and 43 kbps in the uplink
·                      GPRS operation with fixed IP addresses with M2M contract as well as dynamic IP addresses with standard
                      mobile phone contract
·                      Time synchronization based on NTP (Network Time Protocol)
·                      Wake-up functionality by call or SMS to activate CP from "standby mode"
·                      Sending and receiving text messages (SMS)
·                      Clear LED signaling for fast and easy diagnostics
·                      Compact industrial housing in S7-1200 design for installation on standard mounting rail
·                      Fast commissioning due to simple configuration with Step 7
Together with the "Telecontrol Server Basic" software available for telecontrol applications, the CP 1242-7 forms a perfectly matched telecontrol system with additional features:
·                      Connection of up 5,000 telecontrol stations to the control center via OPC interface
·                      Data backup in substations in case of connection failures
·                      Central status monitoring of substations
·                      No special provider services required for fixed IP addresses
·                      Teleservice access to substations with Step 7 via Internet 

2. Area of application
Areas of application for the CP 1242-7 are typically applications with the following properties:
·                      Widely distributed automation solutions must exchange data or be monitored centrally
·                      Mobile machines/vehicles without permanent location need a permanent or temporary communication link
·                      IT safety requirements prevent direct network access of service providers to machines at the end customer's site
·                      Link for difficult to access outposts without network infrastructure

These applications can be found in a variety of industries:
·                      Water/waste water systems - Pump/valve controls
·                      Traffic technology - Traffic light controllers, illumination controls
·                      Power engineering - Monitoring of transformer stations, meter reading
·                      Mechanical engineering - central remote maintenance of machines operated worldwide
·                      Wind energy - Condition monitoring of wind turbines
·                      Vending machine manufacturers - Monitoring, control of beverage vending machines
3. Other
Additional information is available in the Mall and on the Service and Support pages  
Mobile phone products are subject to import regulations. Specific radio licenses are required for most countries.
A list of currently existing country-specific approvals for SIMATIC NET mobile radio products is available here.  
An application example with sample program (Configuration Example) for use of the CP 1242-7 is available on the Support Pages.

Necessary requirements for using the modules:
o                     SIMATIC S7-1200 as of firmware version 2.0
o                     Engineering System Step7 as of version V11 SP1 + Hardware Support Package (HSP CP 1242-7 1.0)
The Hardware Support Package is available on the enclosed product CD and for download on the Support Pages.
Keep in mind that you need Step7 V11 with Service Pack 1 for installation of the Hardware Support Packages. The download of Service Pack 1 is also available on the respective Support Pages

for more information, please visit SIEMENS website

3-Point Stepper Control with SIMATIC S7-1200
Problem 
The valve of a mixer tap shall be controlled according to a desired given temperature.
A three-way mixing valve with valve actuator is used. The valve is digital controlled in both directions. This is referred to as a 3-point stepper control.
Varying the valve position can yield any mixing ratio of hot and cold entering water and so the water outlet temperature.

Solution
For SIMATIC S7-1200 as of firmware V2.0, the development environment STEP 7 V11 provides the "PID_3Step" 3-point stepper control block.


The application on hand provides quick configuration and commissioning of your mixer tap.
The application also contains a simulation of the controlled system, which enables familiarizing yourself with all functions of "PID_3Step".
The
following
features can be conveniently operated via KTP1000 Basic PN:
  • Switching between automatic and manual mode
  • Transition time measurement of the valve
  • Visualization of the valve position
  • Trend curves of setpoint, process value and output value
  • Switching between the real controlled system and the simulation
  • Disturbance value control in simulation mode
  • Specifying the behavior in the case of errors and their simulation
  • Specifying the deadband width for energy saving operation
  • Manually specified control parameter and automatic tuning
  • Online monitoring of the "PID_3Step" controller block
  • Modifying the configuration during runtime


For more information,please visit SIEMENS website








Monday, July 30, 2012

Wireless Data Communication via GPRS with S7-1200 and CP 1242-7, Scenario 1


Problem   In a stormwater retention basin, excess water is stored to relieve the sewer system. There is a continuous filling level measurement in the stormwater retention basin. An electronically controlled sluice S1 is opened as soon the capacities in the sewage system allow it. The automated plant should be coupled wireless with a control room and should fulfill these requirements for the communication:
  • The measured level will be sent cyclically from the Remote Station to the Central Station
  • In case of maintenance or critical filling levels in sluice S1, an alarm will be sent immediately from the Remote Station to the Central Station
  • The sluice S1 can be opened and closed manually via the Central Station
The wireless data transmission is done via GPRS. A standard PC or ICP will be used as platform for the Central Station. Visualization and operation of the process in the Remote Station will be achieved via a standard HMI-system also installed at the Central Station. A continuously archiving of the process values in the Central Station for further processing is required.
Solution 
This application example (configuration example CE-X21, Scenario 1) shows how the given tasks can be solved with SIMATIC components. The focus is on the GSM/GPRS Modem CP 1242-7 GPRS, the automation system SIMATIC S7-1200 and the Telecontrol Server Basic Software, which allow the communication between Remote Stations and the Control Room (Central Station) based on GPRS.

Central station
The Central Station consists of a Box PC SIMATIC IPC627C (2). The software components Telecontrol Server Basic (3) and WinCC flexible 2008 (4) are installed on the Box PC. The power supply is provided via a SIMATIC PM1207 Power module (1). The IPC is connected to the Internet via a standard DSL-Router.
Remote station
A GSM/GPRS Modem CP 1242-7 GPRS (2) is coupled via a bus interface to the SIMATIC S7-1200 controller 1211C (3). The GSM/GPRS Modem has a SIM card (5). For coupling with the air interface a quad band GSM/GPRS antenna ANT 794-4MR (4) is used. The power supply of all components is provided via a SIMATIC PM1207 power module (1).


For more information,please visit SIEMENS website

Friday, August 12, 2011

New Features for S7-1200 and Step 7 V11
Go to beginning

Step 7 V11 and the S7-1200 CPU firmware V2 provide additional capabilities and features
  • To allow you more control of how you define the data in your user program, S7-1200 provides additional data types, such as pointers, indexed arrays, and structures.
  • The instruction set has been expanded. New instruction include the following:
  1. Communication instruction include S7 communication GET and PUT instructions, Distributed I/O RDREC, WRREC, and RALRM instructions, new PROFINET TUSEND and TURCV instructions, and Teleservice GPRS and TM_MAIL instructions.
  2. A new Calculator instruction allows you to enter an equation directly into your LAD or FBD program.
  3. Additional Interrupt instruction allow you to set and query time delay and cyclic interrupts.
  4. You can also use the new diagnostic instruction to read the LED status or other diagnostic information about modules and devices.
  5. There is also a new easy-to-use PID_3Step instruction.
  • PROFINET UDP is now supported. UDP provides a "broadcast" communication functionality
  • The S7-1200 CPU is a PROFINET IO controller.
  • Step 7 V11 provides an "undo" function.
  • Step 7 provides STOP and RUN button on the toolbar for stopping nd starting the CPU.
  • The "force table" is separate from the watch table and allows you to force inputs and outputs.
  • You an copy-protect your user program or code blocks by binding them to a specific CPU or memory card.
  • You can capture and restore various states for your code blocks.
  • You can capture the values of a DB to set those values as the start values.
  • With a click of a button, you can export the data from tables in STEP 7 into Microsoft Excel. You can also use CTRL-C and CTRL-V to copy and paste between Step 7 and Microsoft Excel.
  • Disconnecting I/O devices from the configured network without losing the configured devices or having to reconfigure the network.
  • Changing the assignment of a DB for an FB or an instruction (such as for changing the association of an FB from a single-instance DB to a multi-instance DB).



For more information, check out Siemens website at http://support.automation.siemens.com/WW/view/en/10805148/130000

Thursday, June 9, 2011

How do you establish MODBUS-RTU communication with STEP 7 Basic V10.5 for the SIMATIC S7-1200?Go to beginning
Display part number

Description
The SIMATIC S7-1200 enables point-to-point communication using the communication modules CM 1241 RS485 and CM 1241 RS232.
You can add up to three communication modules to each S7-1200 controller.
Using the MODBUS library integrated in STEP 7 Basic V10.5 you can define each communication module as a MODBUS master or slave.
If you define the CM 1241 RS232 as MODBUS master, then there is a physical limitation that permits communication with one slave only.
If you define the CM 1241 RS485 as MODBUS master, then it is possible to communicate with up to 32 slaves one after the other.
We will take a sample project to describe the configuration procedure in STEP 7 Basic V10.5 for communication with multiple slaves using the CM 1241 RS485.

Instructions
We have taken the example of MODBUS communication between a master and a slave.
There is alternate writing to the holding register of the slave (function code 16) and reading from the holding register of the slave (function code 03).
Since the RS485 has a two-wire (half-duplex) interface, writing and reading must be conducted consecutively.
By the same principle, the address of the slave to be addressed can be changed between two actions (here writing and reading), thus making it possible to exchange data with multiple slaves.


Fig. 01

The CM 1241 RS485 communication modules are linked to each other using a PROFIBUS cable.
You can continue with the PROFIBUS cable to connect up to 31 additional MODBUS slaves to the master.
The configuration is done in STEP 7 Basic V10.5 SP2. The program code is transferred to the controllers with the switch CSM 1277.

MB_COMM_LOAD
The configuration block MB_COMM_LOAD is required on both sides (master and slave) for MODBUS communication.


Fig. 02

The MB_COMM_LOAD block is used to select the communication module, set the communication parameters and establish the connection with the master or slave parameters.
The MB_COMM_LOAD block must be called in the first program cycle (by activating the system marker M1.0 in the hardware settings or by a call in Startup OB 100).
After inserting the communication module in the hardware configuration you can select the symbolic name of the communication module at the PORT parameter.
The communication parameters BAUD (transmission rate) and PARITY (parity) must be identical for all nodes. The port configuration of the RS485 interface in the STEP 7 V10.5 device view is irrelevant here.
The instance data block of the master or slave block is transferred at the MB_DB parameter and thus defines the communication module (PORT parameter) as MODBUS master or slave.

MB_MASTER
You use the MB_MASTER block to define the communication module selected with the MB_COMM_LOAD configuration block as MODBUS master.


Fig. 03

The MB_MASTER block is used to select the MODBUS slave to be addressed, select the function code (read/write, MODBUS start address and data length) and define the local data storage area.
The communication is triggered by the REQ parameter.
The MODBUS-RTU station address to be addressed is transferred at the MB_ADDR parameter.
The MODE parameter specifies the direction of transmission ("0" = read, "1" = write or additional diagnostics functions).
The MB_MASTER block must be called in the first program cycle (by activating the system marker M1.0 in the hardware settings or by a call in Startup OB 100).
The DATA_ADDR and DATA_LEN parameters are for setting the MODBUS start address and the data length (bits or words depending on the MODBUS start address selected).
The DATA_PTR parameter defines the local receive and send data storage areas of the master. DATA_PTR must refer to a global data block created with the "Symbolic access only" option disabled. When multiple elements are to be transferred (bits or words), the symbolic name of an array or struct that covers this data storage area (DATA_ADDR and DATA_PTR) must be transferred here.

MB_SLAVE
You use the MB_SLAVE block to define the communication module selected with the MB_COMM_LOAD configuration block as MODBUS slave.


Fig. 04

The MB_SLAVE block is used to define the MODBUS-RTU station address and specify the local data storage area for the holding register data transfer.
The local MODBUS-RTU station address is transferred at the MB_ADDR parameter. The MODBUS master identifies the slave with this.
The MB_HOLD_REG parameter defines the local holding register data storage area of the slave. MB_HOLD_REG must refer to a global data block created with the "Symbolic access only" option disabled. When multiple registers (words) are to be transferred, the symbolic name of an array or struct that covers the specified data volume of the master (DATA_ADDR and DATA_PTR) must be transferred here. The first word of this array or struct corresponds to the MODBUS holding register start address 40001.

The parameters can be switched with the inputs and outputs of the blocks or by accessing the instance data block concerned.

Sample project
In the master project, the alternate writing to / reading from the holding register of the slave is done using a sequencer.


Fig. 05

The MB_COMM_LOAD configuration block is called in the initialization step 0.
In Step 1 the MB_Master with the communication parameters for writing to the slave (MODE = 1) is called and executed (REQ = 1).
The transition to Step 2 is made by the positive (DONE) or negative (ERROR) confirmation from the MB_MASTER.
The transition resets the execution of the MB_MASTER (REQ = 0).
In Step 2 the communication parameters for reading from the slave (MODE = 0) are written using the MB_MASTER in the same instance data block as from Step 1 (MB_DB parameter of the MB_COMM_LOAD block).
Execution and transition are the same as in Step 1.

The figure below shows a step (networks 6 and 7) with transition (network 8).


Fig. 06

The MB_ADDR parameter (see Network 6) can therefore also be used to change the slave to be addressed per step, which permits data to be exchanged with up to 32 slaves.

Download
The compressed file "MODBUS_RTU.zip" contains the sample project "MODBUS_RTU.ap10" for alternate data transfer between a master and a slave.
Unpack the "MODBUS_RTU.zip" file and open the sample project "MODBUS_RTU.ap10" with STEP 7 Basic V10.5 (>= SP2).
The version of the firmware of the SIMATIC S7-1200 controllers used is V1.0.2.
Download the project folders ("Master" and "Slave") into the controllers.
You can track the data transfer in the monitoring table.


For more information, check out Siemens website at http://support.automation.siemens.com/WW/view/en/47755811