Posted 13 Aug 2020 (edited) Hello group. I am struggling to mirror screens on a machine that will have 2 NA5 HMI's. I want to have it so the screens match no matter where the initial screen change started, For example if an operator selects a screen by way of a GoTo button, I want the other HMI to also follow to that screen. I am trying to use the _HMI_CurrentPageIndex and the _HMI_IsPageSwitching tags in each HMI. Each HMI has it's own name and IP address. I can see the registers updating in the PLC so i know that the page index is being sent to the PLC. What I cannot get to happen is commanding the other HMI to change to a page index. I also have logic to flag who is leading, or in other words.....who to follow. Could someone give me a suggestion or hand what I need to do. I have attached some screen shots. One is trying with ladder logic which did not seem to work so I falsified it so i could try doing it as a sub routine that is called when the page switching is active. Edited 13 Aug 2020 by mr_electrician typo Share this post Link to post Share on other sites
Posted 13 Aug 2020 Just an update......I have made some progress with the screen switching. Just need to massage the PLC logic. I will post when complete. Still open to recommendations and experience of others. Share this post Link to post Share on other sites
Posted 14 Aug 2020 OK. So I think this is fairly simple, but I have not tested it. See the attached sample program. I am tracking the screen names for the 2 HMIs in the PLC, not in the HMIs. Screen Mirroring Updated.smc2 Share this post Link to post Share on other sites
Posted 17 Aug 2020 On 8/14/2020 at 9:40 PM, PMCR said: OK. So I think this is fairly simple, but I have not tested it. See the attached sample program. I am tracking the screen names for the 2 HMIs in the PLC, not in the HMIs. Screen Mirroring Updated.smc2 Thanks. This seems very similar to what I am doing except that I am using page index. The issue I am having right now is the page seems to be lagging and always one screen behind. I noticed you are using the page name. I don't think it matters if I am using page name or page index? Any idea on what is causing the screen to lag behind by one button push? Share this post Link to post Share on other sites
Posted 17 Aug 2020 I am not sure why your code is always 1 screen behind. I loaded the code that I posted into an NX102 and a pair of NA5 HMIs, and it tracks correctly, regardless of which HMI switches pages. I only tested with 3 pages, but I don't think the number of pages matters. Share this post Link to post Share on other sites
Posted 17 Aug 2020 1 minute ago, PMCR said: I am not sure why your code is always 1 screen behind. I loaded the code that I posted into an NX102 and a pair of NA5 HMIs, and it tracks correctly, regardless of which HMI switches pages. I only tested with 3 pages, but I don't think the number of pages matters. Are you using any global event in the HMI? For example, the PLC only knows what screen the respective HMI is on when I set up a global event called interval, set at 100ms, and set variable Current Screen = _HMI_CurrentPageIndex Share this post Link to post Share on other sites
Posted 18 Aug 2020 3 hours ago, PMCR said: I am not sure why your code is always 1 screen behind. I loaded the code that I posted into an NX102 and a pair of NA5 HMIs, and it tracks correctly, regardless of which HMI switches pages. I only tested with 3 pages, but I don't think the number of pages matters. I think I see how you did it now. Once I looked into the variable mapping I seen how you tied it to _HMI_CurrentPage. I was trying to use global events. I will try your method tomorrow as it's time for some Inductive University #Ignition training!!! Share this post Link to post Share on other sites
Posted 18 Aug 2020 (edited) 23 hours ago, PMCR said: I am not sure why your code is always 1 screen behind. I loaded the code that I posted into an NX102 and a pair of NA5 HMIs, and it tracks correctly, regardless of which HMI switches pages. I only tested with 3 pages, but I don't think the number of pages matters. I am getting close. I have one screen now following the other, however, the other screen will not change even though the _HMI_CurrentPageIndex number has updated. I noticed in your example that your HMI's are both the same IP address?????? How is this possible without getting a conflicting ip address error msg? My system had dedicated ip addresses for each piece of hardware. for the screens they are 10.3.65.2 and 10.3.65.4 I do notice when the screen that does not respond has it's Ethernet cord unplugged and then plugged back in, it will then update the other screen to where it is currently at???? Hopefully some others can chime in and give some clues. Perhaps @Michael Walsh could chime in? Edited 18 Aug 2020 by mr_electrician Share this post Link to post Share on other sites
Posted 18 Aug 2020 Is it possible you have accidentally mapped both screens _HMI_CurrentPageIndex to the same global variable? or left the global event in? Share this post Link to post Share on other sites
Posted 19 Aug 2020 15 hours ago, chelton said: Is it possible you have accidentally mapped both screens _HMI_CurrentPageIndex to the same global variable? or left the global event in? Nope, I have mapped the _HMI_CurrentPageIndex separate in each HMI under its respective HMI name. I have also deleted all my Global Events that I was trying before. Share this post Link to post Share on other sites
Posted 19 Aug 2020 @mr_electrician, I don't have 2 NA screens to test with. Everything that I have tried seems to work in simulation (1 screen at a time). Can you share your code? Share this post Link to post Share on other sites
Posted 19 Aug 2020 I don't have 2 x NA's to test, but why cant you have a single global DINT in the PLC that both _HMI_CurrentPageIndex are mapped too? I can't see why the ladder code is needed at all? 1 person likes this Share this post Link to post Share on other sites
Posted 19 Aug 2020 39 minutes ago, chelton said: I don't have 2 x NA's to test, but why cant you have a single global DINT in the PLC that both _HMI_CurrentPageIndex are mapped too? I can't see why the ladder code is needed at all? Good point. It seems like that should work. Share this post Link to post Share on other sites
Posted 20 Aug 2020 14 hours ago, chelton said: I don't have 2 x NA's to test, but why cant you have a single global DINT in the PLC that both _HMI_CurrentPageIndex are mapped too? I can't see why the ladder code is needed at all? I elected to use ladder code instead as I will also be mapping the current screen over to a CJ PLC that will allow some functions to work in it's code based on what screen the user is at. Share this post Link to post Share on other sites
Posted 20 Aug 2020 Just an update…..I finally got it working at 10 o’clock last night using my code. This issue was somehow I had _HMI_CurrentPageIndex instead of _HMI_CurrentPageIndex . What’s the difference you ask…….well one of them has a space after the word Index and the other did not. Thanks @Michael Walsh. Once again you have saved my day!! Share this post Link to post Share on other sites
Posted 20 Aug 2020 10 hours ago, mr_electrician said: I elected to use ladder code instead as I will also be mapping the current screen over to a CJ PLC that will allow some functions to work in it's code based on what screen the user is at. This part of the code would be the same as pointing both screens at a single DINT register. 10 hours ago, mr_electrician said: This issue was somehow I had _HMI_CurrentPageIndex instead of _HMI_CurrentPageIndex . What’s the difference you ask…….well one of them has a space after the word Index and the other did not. Thanks @Michael Walsh. Once again you have saved my day!! Strange. It won't allow me to do that. Share this post Link to post Share on other sites
Posted 21 Aug 2020 Where I saw the extra space was in the equation for the Global Event that he had. I think it just triggered him to just remove all references to the _HMI_CurrrentPageIndex and start over. Share this post Link to post Share on other sites
Posted 21 Aug 2020 1 hour ago, Michael Walsh said: Where I saw the extra space was in the equation for the Global Event that he had. I think it just triggered him to just remove all references to the _HMI_CurrrentPageIndex and start over. That's exactly what I did. I deleted all the global events I created and re mapped the registers. I wanted to give a shootout to @PMCR as well. My code worked but I think his code example was cleaner! Thanks everyone for your extra set of eyes!!! I knew it was something simple but as we know, sometimes the forest drowns out that one tree you need to see! Share this post Link to post Share on other sites