Confirmation window (system.gui.confirm) and Acknowledge

Hi Everyone,

Hoping someone can help me out with some scripting

I am writing some PLC sequences that involve some steps having Popup Prompts for the user. I have created a UDT that has the following members: Tag.Prompt & Tag.Ack.

What i’m hoping to achieve is as follows:

When Tag.Prompt=1 Then Open Confirmation Box with specific Text.
If Yes in pressed I need to then Oneshot(Pulse for alteast one PLC Scan) the Tag.Ack

Also I only want a Yes button rather than Both Yes and No buttons.

I’m assuming this can all be handled neatly by a Tag Script but am an amateur with Scripting. Any help is greatly appreciated.

Thanks in Advance

There is no builtin popup with only a yes button.
What I would do is create a popup window that has the text and button on it.
Set it so it can’t be closed, on layer 999, then do the tag write on the button with a close statement.

So on the tag change script do something like this:

	if previousValue.value==True: #Only do this on the tag value going false, reverse for on True.

Hi MMaynardUSG,

Thanks for the response, Sorry it took me a while to get back to this one.

I have done as you said and created a popup window with text.

I am using a Client Tag name script (initiated by Prompt.Prompt) to open this popup as follows:

if previousValue.value==0:
system.nav.openWindow(‘Popups/Prompt OK Only’)
system.nav.centerWindow(‘Popups/Prompt OK Only’)

I am using a Client Tag name script (initiated by Prompt.Ack) to Close this popup as follows:

if previousValue.value==0:
system.nav.closeWindow(‘Popups/Prompt OK Only’)

This is working OK.

However, on the Close Popup Script I wish to Write a 0 to the Prompt.Ack Tag that triggered the close event. How do I reference back to the Tag the triggered the script?

system.tag.write(“tagPath”,0) ?

Once I get this working ill try and figure out the simplest way to pass the Text from Tag to Popup.

Any suggestions?

Just create custom properties on the popup window and then pass the values to the window when you open it. Then you can reference the custom property for the tag name and write the 0 to it on the close button click. … pup+Window