Device driven navigation/open popup

#1

Is there a way to navigate windows or open a popup window based on tags from a device (PLC)?
For my application there will be only one client so I potentially could use a tag change event script, but I was wanting to dig a little deeper and see if there was any one who has done something similar in a multi-client scenario where the navigation/popup was restricted to one, or a subset of clients.

In my current application the PLC drives sequence with which the operator has to interface. At a couple of points confirmation popups have to displayed for operator feedback.

Thanks,
Mike

0 Likes

#2

If you have the network knowledge in terms of what range the IP the clients will have, you could base it around if a computer or potentially the host name AND a tag value to restrict it down to a particular set of machines. We have used that before to restrict certain screens.

1 Like

#3

Use client tag change events in the one project that will need this functionality, with a project script called at the top of the event that checks whether this particular client instance is the one that should display this interface. After that, it’s just a bunch of if-elif-else blocks for the various cases.

1 Like

#4

I’m having issues with this popup displaying on every client, not just the desired client.
So here is what I have.
My client event tag change script looks at the Sequence tag value and runs the following script

tagVal = system.tag.read('Valiant Midcon/Sequence/Start_SEQ').value
if tagVal in [15, 70, 80]:
	log = system.util.getLogger("StartupConfirmationPU-DisplayScript")
	clientIP = system.tag.read("[System]Client/Network/IPAddress").value
	clientHost = system.tag.read("[System]Client/Network/Hostname").value
	log.info("Startup Confirmation Popup Script running on " + clientHost + "/" + clientIP)
	print "Startup Competlete Confirm PU, Client " + clientHost + "/" + clientIP
	
	project.navigation.showStartUpConfirmPU(clientIP, clientHost, tagVal)

If the value of the tag is one of the step values that need confirmation, parameters are gathered and the showStartupConfirmPU project script is called.

That script contains the following.

def showStartUpConfirmPU(clientIP, clientHost, tagVal):
	log = system.util.getLogger("showStartUpConfirmPU")
	log.info("Client - IP: " + clientIP + ", Host Name: " + clientHost + ", Step: " + str(tagVal))
	print "Client - IP: " + clientIP + ", Host Name: " + clientHost + ", Step: " + str(tagVal)
	if clientIP == "192.168.10.10" and clientHost == "PumpBench":

		if tagVal == 70:
			log.info("Startup Seq Step: " + str(tagVal) + " - Clean Pump")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 70, 'stepDesc' : 'Clean Pump', 'confirmTagPath' : 'HMI_Prompt_Pump_Used_Clean'})
			system.nav.centerWindow(window)
		elif tagVal == 80:
			log.info("Startup Seq Step: " + str(tagVal) + " - Air Purge")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 80, 'stepDesc' : 'Air Purge', 'confirmTagPath' : 'HMI_Prompt_Air_Purge_Complete'})
			system.nav.centerWindow(window)
		elif tagVal == 15:
			log.info("Startup Seq Step: " + str(tagVal) + " - Choke Pot Check")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 15, 'stepDesc' : 'Choke Pot Check', 'confirmTagPath' : HMI_Choke_Pot_Check'})
			system.nav.centerWindow(window)

The clientIP address and the clientHost values are those for the desired client.
Unfortunately this popup displays on my client and by IP address and Host Name are no where near the values in the if statement. Here is the value of my Host IP and Name from my client diagnostic viewer: "showStartUpConfirmPU - Client - IP: 10.212.134.200, Host Name: D1MEM-AM1, Step: 15
"

I originally had this all in the client event tag change script, but after rereading Phil’s comments I split it out to use the project script. I didn’t think it would make a difference, but chose to try it anyway. In the end it still acts the same as it did when it was all contained in the client event tag change script.

Anyone have any ideas as to why this is misbehaving?

Thanks!

0 Likes

#5

Any chance your staging and published versions are different? Like, the clients are still running an old script?

Aside from that, consider creating a boolean expression client tag, named IDoPopups perhaps, that encapsulates the IP & host comparisons. Then the event script only needs to check if that client tag is true.

0 Likes

#6

Nope, the clients are up to date.
I’ll give the Client tag a try.

Thanks!

0 Likes

#7

Just to follow up, I created the client tag as mentioned.
The expression was basically,
if myIP = “xxx.xxx.xxx.xxx” and myName = “PopupHostName”
I created a simple indicator driven by my IDoConfirmations tag (green if True, gray if False).
On my client on my laptop the indicator was gray (as expected).
On the test bench workstation client the indicator was green (as expected).

In my Client Tag Change Event script I read that tag and if that tag is true process the display of the confirmation popup.

tagVal = system.tag.read(Sequence/Start_SEQ').value
if tagVal in [15, 70, 80]:
	log = system.util.getLogger("StartupConfirmationPU-DisplayScript")
	clientIP = system.tag.read("[System]Client/Network/IPAddress").value
	clientHost = system.tag.read("[System]Client/Network/Hostname").value
	log.info("Startup Confirmation Popup Script running on " + clientHost + "/" + clientIP)
	print "Startup Competlete Confirm PU, Client " + clientHost + "/" + clientIP
	
	IDoConfirm = system.tag.read("[Client]IDoConfirmations").value
	log.info("Tag IDoConfirmations: " + str(IDoConfirm) + ", " + clientHost)
	print "Tag IDoConfirmations: " + str(IDoConfirm) + ", " + clientHost
	
	if IDoConfirm == True:

		if tagVal == 70:
			log.info("Startup Seq Step: " + str(tagVal) + " - Clean Pump")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 70, 'stepDesc' : 'Clean Pump', 'confirmTagPath' : 'HMI_Prompt_Pump_Used_Clean'})
			log.info("Opening Window 'Popups/Startup Step Complete Confirmation' for Step 70, Clean Pump")
			print "Opening Window 'Popups/Startup Step Complete Confirmation' for Step 70, Clean Pump"
			system.nav.centerWindow(window)
		elif tagVal == 80:
			log.info("Startup Seq Step: " + str(tagVal) + " - Air Purge")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 80, 'stepDesc' : 'Air Purge', 'confirmTagPath' : 'HMI_Prompt_Air_Purge_Complete'})
			log.info("Opening Window 'Popups/Startup Step Complete Confirmation' for Step 80, Air Purge")
			print "Opening Window 'Popups/Startup Step Complete Confirmation' for Step 80, Air Purge"
			system.nav.centerWindow(window)
		elif tagVal == 15:
			log.info("Startup Seq Step: " + str(tagVal) + " - Choke Pot Check")
			window = system.nav.openWindow('Popups/Startup Step Complete Confirmation', {'stepNum' : 15, 'stepDesc' : 'Choke Pot Check', 'confirmTagPath' : 'HMI_Choke_Pot_Check'})
			log.info("Opening Window 'Popups/Startup Step Complete Confirmation' for Step 15, Clean Pump")
			print "Opening Window 'Popups/Startup Step Complete Confirmation' for Step 15, Choke Pot Check"
			system.nav.centerWindow(window)

Unfortunately the confirmation popup still displays on my laptop even though the IDoConfirmations tag for my client is FALSE. I will eventually have to figure this out as there is plans for adding another test station to this system.

Thanks.

0 Likes