Roger Posted April 19, 2018 Report Share Posted April 19, 2018 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 More sharing options...
ORSO2001 Posted April 19, 2018 Report Share Posted April 19, 2018 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 More sharing options...
Roger Posted April 19, 2018 Author Report Share Posted April 19, 2018 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 More sharing options...
Saragani Posted April 20, 2018 Report Share Posted April 20, 2018 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now