Jump to content

Easier/Quicker Method to Change Tags on a Screen? Can I use a Variable to Define a Tag Name?


Roger

Recommended Posts

Is there a way to use variables to define the tags used in objects (buttons, number boxes, etc.) on an HMI screen?

Here is my situation... and I'm sure everyone else has run into this.  I have four identical servos: SRV01, SRV02, SRV03, SRV04.  I have one screen created for the inputs and one screen for the outputs for  SRV01.  I want identical screens for the other servos.  I hate the monotonous task of changing all of the tags one by one.  There has to be an easier and faster way.  I would like to  be able to change a variable (SRV0#) based on which screen I am currently on.  This would be the easiest.  I'd settle for a way to change the tags in a list versus having to click into each and every box and button.  Buttons are the worst with the tags buried in the "collection" and having to change the set and reset.  There has to be an easier way that I have not found.

Link to comment
Share on other sites

dear Roger,

i think that the best way is create a general structure called SERVO that include all the variable types needed...after you have to define 4 global struct SERVO variale (one for each servo) and 1 global struct variable for the HMI...after this in the ladder you will create your flow that will pass/store the servo structure to the HMI servo structure.

I hope that I explained clearly the thing.

Link to comment
Share on other sites

1 hour ago, ORSO2001 said:

dear Roger,

i think that the best way is create a general structure called SERVO that include all the variable types needed...after you have to define 4 global struct SERVO variale (one for each servo) and 1 global struct variable for the HMI...after this in the ladder you will create your flow that will pass/store the servo structure to the HMI servo structure.

I hope that I explained clearly the thing.

That should work.  Thanks!

Still curious if others have additional solutions for this.    Seems like there should be a way to change  tags easier in other cases.

Link to comment
Share on other sites

There are few more ways:

* Duplicate the screens and then use the find and replace in order to replace in the new screen from Servo0 to Servo1.

* Create a custom control that accepts the servo struct as parameter, and then create 4 screens that each of them contains an instance of the custom control linked to a different servo.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...