Tia Portal Change Hardware Indentifier Name

Fifty-fifty subsequently many years of TIA Portal development, every at present and then I come beyond another cool characteristic that I either was not enlightened of or have never had a chance to try. Recently, I had an opportunity to use Configuration Control - a manner to configure a single project to utilise multiple different hardware configurations.

For OEM's who produce and sell standard machines with a number of customer-selectable options, Configuration Control can allow a single project to be developed and maintained that is capable of supporting multiple options and configurations. The really cool role is that the hardware configuration tin can fifty-fifty be inverse in the field without whatsoever program changes - fifty-fifty from an HMI.

The power to change hardware configuration in the field allows an OEM to use a single plan for every machine built while only using the hardware required for the options selected, which can aid to lower hardware costs while nevertheless allowing for expansion and upgrades. Hardware can exist added in the field, and options tin exist turned on/off from either a configuration screen on the HMI or even a license key that tin can exist provided and entered.

If you oasis't worked with Configuration Control earlier, it'due south worth noting that there are several different Configuration Control features available.

I'yard going to highlight 2 of them: Configuration Control at the Device Level and Configuration Control for IO Systems.

Configuration Command at the Device Level

Within TIA Portal, Siemens provides the ability to configure, at run-time, the hardware modules used within an S7-1200, S7-1500, ET200SP Controller, or ET200SP (PN or DP) Remote I/O Rack. This ways a single project can exist created with a "Master Rack" configuration which defines a superset of all hardware that could be used and that a user tin, at run-time, choose which modules to use and make up one's mind where in the rack they are located.

As a unproblematic example, imagine a motorcar designed to batch and mix ingredients in a system of tanks. As a automobile builder, you provide an pick to your customers to add together a temperature monitoring function. Some customers may experience this feature is worth the actress cost, but it is not a standard characteristic on every machine built. With Configuration Control, you can add a Thermocouple module to your rack and ascertain the module every bit 'Optional.'

Now, you tin can develop a unmarried program which includes the temperature monitoring functionality and build the machine according to your customers' selected options. If they cull to add temperature monitoring, you can include the Thermocouple module in your hardware rack and actuate that option. If not, you leave information technology out. Either fashion, the software (and hardware configuration divers in information technology) are identical.

And then how tin yous fix Configuration Control at the device level?

Let's build a quick instance. While we could use an S7-1200, S7-1500, or ET200SP I/O remote rack, I'm going to use an ET200SP Controller  (S7-1510 1-PN) every bit I accept one sitting on my desk. Additionally, I have one (i) DI 8x24VDC ST and one (1) DQ 8x24VDC/0.5A ST module. So, allow's assume I want to design a arrangement with 4 possible configurations:

  • Option A: Both DI (Slot 2) and DQ (Slot 3) Modules
  • Option B: DI Module Only (Slot two)
  • Selection C: DQ Module Only (Slot 2)
  • Option D: No Modules

Drawing of Option A: Both DI (Slot 2) and DQ (Slot 3) Modules, Option B: DI Module Only (Slot 2), Option C: DQ Module Only (Slot 2), and Option D: No Modules

Step 1 - Create a Master Rack
To starting time with, I've created a "Chief Rack" in my hardware configuration containing all possible modules. The "Main Rack" should contain the maximum options bachelor. In my case, information technology volition include both the DI and DQ modules as shown below.

After adding the modules, go to the backdrop of the PLC and, under Configuration Command, cheque the box for "Permit to reconfigure the device via the user programme."

Configuration Control Setting in TIA Portal

Step 2 - Create a Configuration Control Record
Create a PLC Data Type (UDT) to define the hardware configuration. This UDT will be structured as follows:

Byte 1: Block Length - the total number of bytes in the record. Header Length (4) + 2 * Number of Slots. In this example, there are four slots: Slot ane is the CPU, Slot ii is the DI module, Slot three is the DQ module, and Slot 4 is the server module. Note the default values I've given the UDT are the default positions assigned in the hardware configuration.

Byte 2: Block ID - The data record number being written. For configuring hardware in a rack, it is 196.

Byte 3: Version - This value is different depending on the type of hardware used. For the ET200SP, Version = 2. For an S7-1500, Version = 4. Additional documentation is available for both with help and online examples.

Byte 4: Subversion - Zero for the ET200SP.

Byte 5: Slot ane - For the ET200SP Controller, the CPU is e'er in slot 1 (where it is configured).

Byte 6: Boosted Part for Slot 1 - Nil for the ET200SP CPU.

Byte seven: Slot 2 - The value of this specifies where the module configured in the hardware configuration is installed. If the module is used in the station pick, this will be the slot in which it is installed. If a module is not used, put a 0 here. If the module is configured to be empty, enter the slot number of the module + 128.

Byte 8: Additional Part for Slot two - If you replace a dark colored base unit with a light colored base of operations unit of measurement (new potential grouping), enter i. Enter 0 if the base unit installed in this slot matches the hardware configuration.

Byte 9: Slot iii

Byte 10: Additional Office for Slot 3

Byte xi: Slot 4

- in this example, the Server Module

Byte 12: Additional Function for Slot four

Screenshot of the Control Record.

Step 3 - Create Configuration Options
For this case, I've created a Global DB with an array of four (4) of the control records we only created and set up values corresponding to the four possible configurations listed above.

Note in the get-go that each module matches the configuration. The second removes the DQ module and moves the Server module up. The tertiary option removes the DI module and moves the DQ and Server modules upwardly. The concluding configuration eliminates both the DI and DQ modules and moves the Server module up to Slot 2.

Screenshot of the dbConfiguationControl selections.

Step four - Add in OB100 (Showtime-up)
In the startup OB, yous will need to write the configuration choice tape to define the hardware used.

To do this, yous can use the code below. Notice that I've created an "Index" tag to switch between the different options I've configured.

OB100 Startup Code to Load the Selected Hardware Configuration

Step 5 - Configuration from HMI
There are many means you could do this, just I've created a unproblematic HMI screen to permit a user to select which hardware option to use.

It'due south very simple - a choice of a configuration sets the "Alphabetize," or a retained tag on the PLC, of the hardware option to be used.

Note that to switch hardware configurations, the PLC needs to exist stopped and started so that OB100 is executed.

HMI Selection of Hardware Configuration

If you lot're interested in learning more than, Siemens provides a thorough system manual for the ET200SP Controller.

Configuration Command for I/O Systems

In add-on to controlling the configuration (location and beingness) of modules inside a PLC or Remote I/O Rack, TIA Portal also provides the ability to configure an I/O organization dynamically. This means yous can create a "Master Configuration" with multiple remote I/O racks. You tin can then programmatically (at run-fourth dimension) define the utilize and configuration of those racks.

Optional I/O Network Configuration

Every bit another uncomplicated example, consider a motorcar with modular components such as a multi-cell vacuum press. As a machine architect, you can create and offer a system capable of controlling, for example, anywhere from 2-8 cells. Each of those cells may accept their own control panel and remote I/O rack.

With Configuration Control, you can develop a single project capable of decision-making, for case, viii cells and define at runtime how many (and which) cells are in use. Furthermore, because information technology's at runtime, your customer could choose to add an additional cell at a later engagement.

Because of Configuration Command, you could evangelize the new cell, connect the I/O rack to the PLC, and then from the HMI activate the jail cell - all without making whatsoever software changes. By using a single project, the need for maintaining and supporting multiple versions of control code is eliminated assuasive you to provide a flexible, modular, and scalable product without the need for troubleshooting and testing of each combination.

Then how tin can you ready Configuration Control for IO Systems?

Let'due south expect at how simple information technology can be.

Outset of all, there are a number of ways in which we tin set this up. The TIA Portal Help Files incorporate some splendid application examples.

Siemens production support too has application examples for the unlike options. Merely I'thou going to configure an ET200SP Profinet I/O rack (IM155-6 PN HF) to exist an optional I/O device. While simple to configure the hardware, information technology is slightly more than circuitous from a programming perspective.

Step 1: Add an IM155-6 Rack to the Network Configuration
I added an ET200SP I/O rack with a single DI module. Under the backdrop of the interface module, aggrandize the Profinet interface options and expect under Advanced Options. Select "Optional IO-Device. This volition define this device as optional and volition only be used if programmatically added to the Profinet network.

Note that if booting a PLC without whatsoever special code to activate this network device, it will not exist automatically added to the I/O network.

Defining a Remote Rack to be Optional

Footstep two: Configure Topology
While we could do this in other ways, I've used Topology to simplify management of the Profinet network configuration for our Configuration Control sit-in. If you haven't used Topology in the past, information technology is similar to your network configuration, only it defines specific port-to-port connections betwixt devices.

These connections must match the exact ports used when the hardware is networked together. While adding some complication, there are a lot of cool things you can do with Topology - including automatic assignment of Profinet proper name and IP Address. Here, it will permit u.s.a. to create a simpler configuration record in the next few steps.

In this demo, I've defined a connection between P2 on the PLC and P1 on the IM155-6. I've left the others undefined - meaning they can utilize whatever network connexion available.

Defining network topology

Stride iii: Create Network Configuration Options
In this example, I but have one optional device. So I will define two options: One with the IM155-6 and one without. The Control Records needed to reconfigure the I/O network are structured as follows:

Word 1 - Version: For reconfiguring the I/O system, this is sixteen#0100.

Word ii - Number of Optional Devices to exist used: The total number of optional devices that volition be used in this configuration option.

Word iii - Optional Device to Activate: the hardware identifier of the device to exist activated (HW_DEVICE). You tin can find this in the system constants of the default tag table. For this example, it is 262.

Word four -> Word Northward-one: Optional Devices to Activate

Word N - Number of port interconnections: Since we already defined the network topology, this is 0.

For the two options (with and without the rack), my configuration records are shown below.

Notation that I've used a generic struct to define the configurations. Too, note that I've added an empty give-and-take to the end of the second configuration (WithoutRack) even though it isn't needed. It volition exist apparent why a little after.

Step iv: Write Logic to Reconfigure the I/O
The I/O network can exist configured at any point without restarting the PLC, unlike the previous example of configuring hardware inside a rack. It just requires three steps:

a) Telephone call "ReconfigIOSystem" with Mode 1 to Deactivate all Optional I/O Devices.

b) Call "ReconfigIOSystem" with Fashion 2 (and the configuration record) to Reconfigure/Activate the used I/O Devices.

c) Call "ReconfigIOSystem" with Mode three to Restart the I/O.

For this demo, I wrote a uncomplicated state auto to sequence through the 3 steps off of a starting time command (from the HMI). The user tin can select a configuration and restart as needed.

A Few Tricks Worth Nothing...

Then I'll exit you lot with some demo code.

Offset, the "ReconfigIOSystem" system office block requires writing the control record every bit an array of words.

We could have defined our Configuration Records as an array, but I liked the Struct amend. However, nosotros do need to take the selected configuration and move information technology into an array.

To practice this, I created a static Assortment [0-3] of Words and a Struct CTRL_REC using an AT construct for the Array. Now I tin move my Struct into CTRL_REC and still use the array of Words as the input to the block.

be foundSecond, the Logical Address used (LADDR) on the "ReconfigureIOSystem" phone call is the Hardware Identifier of the PROFINET interface of the IO controller. Again,this canbe found inthe system constants tab of the default tag listing .

Finally, I played around with a few options (defining port connections vs. configured topology) and institute the topology method easier to demonstrate. The other absurd thing virtually this is that because the topology is defined, the IM155-6 PN does not demand to be commissioned (Profinet proper noun, IP Address assignment) in advance.

The PLC will automatically assign a Profinet name and IP Address and autoconfigure the rack wWhen the I/O system configurationis updated with the rack activated! Yous can test this be resetting the rack to manufacturing plant default and and then reconfiguring the network to activate it. Y'all'll notice that since the topology matches what was defined, the IP Address and Profinet Name volition be automatically assigned and the rack will be auto commissioned and activated.

The Lawmaking

Here'southward the code I used for my quick exam. I am running this FB from OB1 and have buttons on the HMI for Starting/Resetting and selecting which configuration to use. This allows a user to, while the system is running, add or remove the remote I/O rack from the Profinet network.

I hope this is helpful! Cheers for reading!

For those of yous who made information technology this far, I've attached a sample project for you lot if you lot'd like to effort it yourself!

Learn more most DMC's TIA Portal programming expertise or Contact Usa to go started on a project today.

0 Response to "Tia Portal Change Hardware Indentifier Name"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel