Optix PanelLoader to PLC Tag

Home / FactoryTalk Optix / OptixEdge Advanced Edge Gateway

Description
Learn how to tell the PLC which is the current screen or panel thru PanelLoader in FactoryTalk Optix. This is an adaptation of the example from Optix repository Optix_Sample_ChangeScreenFromTag. Thanks to AutomateSHANE for the advice on Engage discussion on that topic!

Modified code:
https://github.com/xavierflorensa/FactoryTalk_Optix_PanelLoaderToPlcTag

Update code (without script):
https://github.com/xavierflorensa/FactoryTalk_Optix_PanelLoaderToPlcTag_without_script

Rockwell Automation Engage community discussion:
https://engage.rockwellautomation.com/discussion/ft-optix-telling-the-plc-which-screen-or-panel-number-is-active-in-runtime-with-panelloader

Contributed by Xavier Florensa – YouTubeLinkedInGitHub


Transcript
(00:01) Hi everyone. In this video, I will explain you how to make panel wer and inform the PLC of which panel is being loaded. So here we have the factory optics runtime and here at the right we have the PLC with the screen that is being opened. As soon as I open other screens, we have the number here the index of the screen.
(00:39) So how to do this? We can go back to our optics application you have to create first of all a type. So it’s an object of a screen and we will add with this plus sign a new variable. It’s a number for the panel index. Then we will create some screens as instances of this type and on each one we will change the number of the index.
(01:27) Then we create a panel other and some buttons in order to with this mouse click method change panel and select the corresponding panel. Then you need a script to be able to know which panel is open. Uh luckily we have here some scripts. There’s one called change page from t. We can drag and drop until our main window.
(02:16) You will get a script and you have to change some things. You should define one variable as holding the number of the panel, the current panel. Then you click on this script and you will find some input parameters. You can drag and drop your panel over here. your variable for page number here. So you drag and drop this one here and you drag and drop the folder where you have the screens.
(03:09) Just with this you will be able to see in this text box that I point to the page number variable. You can see this current screen. Then we need to write this on the PLC. So to do this you can open the script. We go to Visual Studio Code and here we can create a new variable like this one to hold the screen number inside the script, excuse me, the PLC variable.
(04:11) Then we go to this start program or method and we introduce in this variable the PLC t this way. Okay, this is the name of the PLC T. Then we can go to also go to the place where the screen change is detected is just here and we can perform a PLC right to the T with the same value of the current screen and this is all once you save this compile you execute it and you will see this amazing result.
(05:17) So, I hope you enjoy and thank you very much.