mr_electrician

NA5 Screen Mirroring

18 posts in this topic

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.

Screen Mirror.jpg

Screen Mirror Ladder.jpg

Global Events.jpg

Edited by mr_electrician
typo

Share this post


Link to post
Share on other sites

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

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
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

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
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
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
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?

Screen Mirror Ladder 2.jpg

Edited by mr_electrician

Share this post


Link to post
Share on other sites

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
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

@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

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
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
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

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
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. 

5f3ef397b655f_ScreenShot.thumb.png.cd364

 

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.

error.thumb.png.7cd957de33e86bb5c1e62cc9

Share this post


Link to post
Share on other sites

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
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

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