G_DeMark

Tag Data Update

10 posts in this topic

Hello All,

I have a PLC program (AB Logix 5000) where I have an array of my custom UDT.  My UDT contains all the parameters for the various parts that will be run at my station.  When a new part needs to be added I go into the tags table and fill in the new values.  This is easy for me.  However, my customer is not very PLC trained.  I am wondering if there is a way to streamline this process. 

My first though was to setup some sort of Add/Edit screen using the Panel View HMI.  However, I fear that any changes made to Tags from the HMI at runtime would be lost after a power cycle.  I am not sure if there is a way to save tag values from the HMI screen.

My second thought is to find some way to import Tag values from a CSV/excel file.   Perhaps even from a database using Ignition software down the road.

Does anyone have any suggestions for this case?

Thanks

Figure 1 - Array of Part UDT.

Share this post


Link to post
Share on other sites

Unless something changed in a newer version (I have much higher versions but my most recent experience was with 21) you can't update a tag value with a CSV import. You can add and document tags that way

You could make a button on the HMI that when pressed it turns on a bit.

In the program (I would use structured text) do something like:

If HMI Button true;

Tag in PLC := HMI tag value;

HMI Button False;

End_IF;

Otherwise the HMI might come up with zero values and hose up the world

I map almost all of my IO and write the program with the UDT defined tags. I can make IO changes easily and the mapping is done in Excel.... 

 

Share this post


Link to post
Share on other sites

1) Adding a tag from a .csv import seems like a reasonable option.  I will need to look into this option as it is completely new to me.

2) Any thoughts on if you can save tag edits after they are made from the HMI screen?

Thanks for your reply.

1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, G_DeMark said:

1) Adding a tag from a .csv import seems like a reasonable option.  I will need to look into this option as it is completely new to me.

2) Any thoughts on if you can save tag edits after they are made from the HMI screen?

Thanks for your reply.

Export your database before you try it. That way you can import it and put it back PLUS all you have to do is insert a row under a tag with the same properties (Boolean, DINT, INT), do a copy paste and change the name. It's just the tag, As far as I know you can't import / export values.

Saving the PLC program saves tag edits but if the HMI reboots and you aren't controlling the writes from it it'll overwrite with zeros. The thing I'm most sketchy on is the HMI. It may very well preserve the values.

 

Share this post


Link to post
Share on other sites

When I handle recipes in the PLC, I have a storage array of UDTs. The HMI "recipe" screen scrolls through the array by indexing an integer register that the PLC uses to copy the data from the storage array tag into a "view" tag. Sometimes it's element 0 of the storage array, other times it's just a separate "view" tag. The HMI can do whatever it wants to those tag values, since they're not the actual storage tags. The PLC would transfer the data from the "view" tag into the storage array when the "save" button is pushed (password protected, of course).

In my experience with AB PLCs, tag values are non-volatile and are retained through power cycles. When online with the PLC, you can save the project and it will prompt you to upload & save the tag values, which will give you an offline backup. Downloading from the PC file to the PLC will overwrite the tag values in the PLC unless you use the "data preserved download tool", which I've never used so I can't vouch for its reliability or usability.

1 person likes this

Share this post


Link to post
Share on other sites

I wish I had the opportunity to work in your environment when I was younger Joe. I feel like I could have learned something that would help us in the business I'm in.

I took his question to mean did the HMI hold the setpoint values if it's power cycled. I don't think it does that since it's writing to the PLC (and reading back for the display) but it's been a while since I actually wrote a Panelview program.

Share this post


Link to post
Share on other sites

Hmmmm...

His mention of a UDT array made me think the recipe information is stored in the PLC. The PV+ has a built-in recipe system, but I've never used it so if he's using that instead, my comments aren't useful.

1 person likes this

Share this post


Link to post
Share on other sites

My current method is as follows:

I created a UDT that has several members corresponding to the various part parameters.  Then I made an array consisting of these UDTs.  Next, I expand out each array element and enter the parameter values for each part.  When new parts/edits are needed I must access the PLC file, open the Tag editor and make the changes.

I have heard about using recipes within the HMI but I have never used them.  Sounds like I need to research recipes as this may provide a better method for managing my part parameter data.

Ultimately, I want to provide a better interface for the user so they can make basic edits without directly accessing the PLC.  In many cases the users either don't have the logix 5000 software or do not know how to use it.

Some of my colleagues that use PC based programming (like VB or LabView) typically can just use some sort of text file that can be loaded to extract part parameters, so they have an advantage in that regard.

I appreciate the good discussion.

Share this post


Link to post
Share on other sites

That clarifies what you're up to. You're using recipes stored in the PLC. I generally prefer this method, at least in AB PLCs. The values in your storage array should be safe through power cycles of the PLC and HMI. You can also go online with the PLC and save the file. You'll be prompted to upload data values. If you do, your ACD file will contain all of your current recipes.

Here's how I've done recipes in the past. You already have an array of your UDT, so now create a new tag that's a single instance of it. So you'll have an array called "storage" of type UDT[x], where "x" is the number of elements. Now create a new tag called "display" of type UDT. The HMI will read/write only to the "display" tag. You can add buttons to increment/decrement an "index" register or just type in the number you want to look at. Or add some buttons that jump to the highest, lowest, by 5 or 10, or whatever. The PanelView+ also has a piloted list control that can be useful, but I found it a little cumbersome to use.

You would then use a COP instruction in the PLC to transfer information from storage to display so the HMI will display the selected recipe.

If you want to be able to edit the values, use data entry controls on the HMI. Then add a button to the HMI called "save" that will trigger another COP instruction to copy the information from "display" to "storage[index]".

I threw together a quick example in a CompactLogix. I excluded code for controlling the "index" tag, but that should be pretty straightforward.

Here's my UDT:

Recipe01.PNG.3ff8924f18b48e33a242c76f60c

Here are the tag declarations:

Recipe02.PNG.99c14b3a24e76d63f25a6dfc79e

Some mock values:

Recipe03.PNG.11ec483006ee75b5cde0779a5ca

Here are the COP instructions to read/save the selected recipe:

Recipe04.PNG.383bfefa7d68d20663d218e9882

As with any use of indirect addressing, you will DEFINITELY want to limit-check the value of "index" to make sure it's valid. Since my UDT array is 50 elements long, index must be between 0 and 49, inclusive.

 

1 person likes this

Share this post


Link to post
Share on other sites

Great example.  I really appreciate all of the help/feedback.  I will attempt to apply this lessons to my project soon.   Thanks again!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now