When V13 SP1 was first released, one of the features I was most excited about was the ability to multiplex arrays of custom UDTs on a PLC using a simple index tag on an HMI. This feature allowed me to use a single faceplate or screen to display or modify data from multiple objects by simply changing a single tag. I was so excited, I even wrote a blog post about it then! Unfortunately, it was a feature to be short lived and, due to some unexpected consequences, mysteriously disappeared with the release of Update 3.
Now that TIA Portal V14 has been released, the very first thing I did was look to see if it was back. And I'm in luck!
While I've gone into some detail in my previous blog, and all of the same information is relevant, here's a really quick demo to set up multiplexing of an array of UDTs from your HMI.
First, I've created a really simple project with a S7-1200 (FW v4.0) and a TP700 Comfort panel (Version 126.96.36.199). To make things simple, I've grabbed a UDT (udtHMI_VFD_Control) from the Siemens Open Library, and added it as a type to my Project Library (this will allow me to use it within a faceplate later), and then copied from my Project Library to my PLC (under PLC Data Types). Next, create a new data block on your PLC - I've called mine "dbDemo." Inside of my Data Block I've created a single array of VFD's.
Next, open up the Default Tag Table on the HMI. Add a new internal tag called "Index" of type "UINT." Now, in your project tree, select the DB you previously created, and from the details view, drag any one item from your array of VFDs into your tag table to create a new tag of type "udtHMI_VFD_Control" - you can use the blue 'tag' icon that shows up in the detail view to grab the tag. I've named mine "Indexed_VFD."
Note that as of right now, this tag is linked directly to a fixed item within your array - in my case, "dbDemo.VFD." We want to modify this so that our "Index" tag will change which item in the array we want the tag to link to so we can multiplex this tag across multiple VFDs from our HMI. To do this, select the "Address" dropdown under the properties of the tag. For "Index Tag," change the selection to "HMI Tag" and choose the "Index" tag we created earlier.
Notice that in your tag table the address has changed to indicate the position in the array is defined by our"Index" tag. And that's it! Now, we can change "Index," either through a script or by a control on the HMI, and our multiplexed tag will look at a different item in our array. In the screenshot below, note that our "Indexed_VFD" is now linked to any VFD in our array using the "Index" tag.
To take this a step further in your quest for object oriented programming, take another look at my previous blog. It will take you through linking your multiplexed tag to faceplates and popups - which is where this feature will really help you develop better, more powerful, HMIs.
One more helpful hint - you will find that your index on the HMI will be zero based, regardless of the way you define your array on the PLC. For example, if I defined my array (on the PLC) to be [1 .. 20], an "Index" of 0 will actually access the first element, , in my array.
Learn more about DMC's PLC Programming services and contact us to get started on your next PLC Programming project.