# Is there a way to differentiate between HMI panels?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 5, 2023, 12:33am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484 "2023-08-05T00:33:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesus\_Ramiro\_Garcia](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jesus\_Ramiro\_Garcia](https://forum.inductiveautomation.com/u/Jesus_Ramiro_Garcia)\
**Post date:** [August 5, 2023, 12:33am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484/1 "2023-08-05T00:33:13Z")

</div>

Hello. Im working in a cell that has several panels on each side of the machine.  
As you can either control the machine from the left or right side, we created two overview screens with a mirrored version of the layout.

I would like to know if there is a way to know which panel you are opening the project in and create a script so the correct window is automatically opened after the project launches. Is there a client tag or any other way to identify the different panels the system is connected to? Probably by their IP address or something?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [August 5, 2023, 2:13am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484/2 "2023-08-05T02:13:58Z")

</div>

I imagine you could do this with the MAC address. Here is a commonly used example in the forum:

> [@Mobile Client MAC Address](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/10):
>
> In a real Vision client, you can obtain the local MAC addresses with the following script: from java.net import NetworkInterface # Get list of local mac address as strings def myMacIds(): macs = [ni.hardwareAddress for ni in NetworkInterface.getNetworkInterfaces() if ni.hardwareAddress] return [":".join(["%02x" % (b & 0xff) for b in mac]) for mac in macs] Also, again in a real Vision client, you can obtain the outbound network interface and the corresponding local IP address the clien…

Other examples:  
[https://forum.inductiveautomation.com/search?q=mac%20address](https://forum.inductiveautomation.com/search?q=mac%20address)

---

<div class="post-metadata">

**Author:** ![drastura](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@drastura](https://forum.inductiveautomation.com/u/drastura)\
**Post date:** [August 7, 2023, 10:38am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484/3 "2023-08-07T10:38:25Z")

</div>

I do this all the time, but really don't care to try to match an IP, or hardware identifier.

I just use a blank text file, in a directory I name "hmiconfig". If there is no config file there, I open a popup to allow selecting the role of the terminal, and create the file

```auto
def Open_Client_Home():		
	import os
		
	for window in system.gui.getOpenedWindows():
		system.nav.closeWindow(window.getPath())

	dir = "C:\hmiconfig"
	if not os.path.exists(dir):
		os.makedirs(dir)
		system.nav.openWindow("Popups/Role_Select")
		system.nav.centerWindow("Popups/Role_Select")
			
	else:
		
		if system.file.fileExists("c:\\hmiconfig\\E1.txt"): 
		   	windowPath = "Local_HMIs/E1/Startup"
			system.tag.write("[client]Path/Machine/HMI_Role", "E1")	
		   	system.nav.openWindow(windowPath)
			   
		elif system.file.fileExists("C:\\hmiconfig\\E2.txt"):
		   	windowPath = "Local_HMIs/E2/Startup"
			system.tag.write("[client]Path/Machine/HMI_Role", "E2")	
		   	system.nav.openWindow(windowPath)
              
        else:
			system.tag.write("[client]Path/Machine/HMI_Role", "None")	
			system.nav.openWindow("Popups/Role_Select")
			system.nav.centerWindow("Popups/Role_Select")

```

It's easy to implement, easy to set a role, or even modify it on the fly, if you move the terminal, or have a crash of another one

---

<div class="post-metadata">

**Author:** ![Jesus\_Ramiro\_Garcia](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jesus\_Ramiro\_Garcia](https://forum.inductiveautomation.com/u/Jesus_Ramiro_Garcia)\
**Post date:** [August 11, 2023, 5:42am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-differentiate-between-hmi-panels/77484/4 "2023-08-11T05:42:00Z")

</div>

thank you all for your feedback!  
In the end I did something even easier. Just had to put the content of both windows into a container and then copied one of those containers in the other window. Then I just used a simple _if_ expression with the System tag that stores the IP address of the panel to enable the visibility of each container. It's such an easy solution for beginners and also for lazy people. In my case, I am both...

if ({[System]Client/Network/IPAddress.Value} = '_IP ADDRESS_',1,0)
