I'm going to grab a simple valve from the toolbox (under "Elements - Symbol Library") and add an indicator for the valve name. Let's start with the first task - our simple P&ID. Let's also imagine we want to allow a user to click on a valve and open a pop-up so that they can get more information as well as control it manually. Let's say we want to put together a simple P&ID of our system showing each of the valves and their status. I've created a FB ( fbValves ) to contain all of my valves, instantiated 10 valves (multi-instanced versions of fbValve ) within it, and dropped fBValves into OB1. The final step on our PLC is to add our newly written code. As you can see below, I've entered configuration values in each valve's data structure. Within this data block, I can set configuration values, including valve names, for each of the valves I am going to use. In it, I am going to create an array of udtValve. I'm going to create a Global DB and name it dbValves. Now that we've developed a re-usable function block for our valves, let's create a DB to contain all of our valve data. I find breaking things up like this makes it much easier to find the right tag you're looking for when programming.įor our valve Function Block, fbValve, let's say we have something like this: The control group has the open/close and fault reset requests. The status group contains all status information about the valve and is used both within the PLC and the HMI. The configuration group of parameters defines the valve's physical behavior and its unique name. We've broken our data type into three structures: configuration, status, and control. So, what is in our 'valve' data type? For this simple example, let's create the following PLC data type, udtValve: In addition to eliminating the amount of code to be written, this allows us the additional advantage of keeping our future valve logic updates to a single place. Our FB has a few inputs including the feeback signals for open/close, an in-out for our 'valve' data type, and an output for the open/close command. Of course we like to save time, so we're going to develop a special FB to handle our valves: auto/manual control, alarms, etc. And let's face it, the less time we all spend on repeating tasks and minutiae, the more time we can spend actually programming.Īs an exercise, let's pretend we have a project with a large number of simple valves. Having come from an object-oriented programming background, I really appreciate what the Function Block/Data Block paradigm will allow you to do in a PLC - it really does push PLC programming towards object-oriented programming. I'm going to focus today on a series of updates that were added in SP1 that make it even simpler to take advantage of the nested data structures we can create in our Data Blocks - specifically, the ability to share UDTs between a PLC and HMI, link UDTs to Faceplates, multiplex arrays of UDTs, and create simple, powerful pop-ups.īefore we get started, let me say that if you're not already taking advantage of PLC data types and Global DBs to build rich data structures in your project, you're missing out. There are a few new features included in TIA Portal V13 SP1 that I have found to be incredibly useful in the past few months and have allowed me to be even more efficient in my programming. While we program systems of all types and flavors, I'm personally most experienced with Siemens (TIA Portal) and Rockwell (RSLogix5000/FactoryTalk View). Here at DMC, we spend a lot of time programming PLCs and HMIs. Hopefully the rest of the information will be still be helpful to you! Some of the functionality shown was removed in Update 3, specifically the ability to multiplex UDTs. PLEASE NOTE: This blog was written using features available in TIA Portal V13 SP1 Update 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |