Creating a Custom Popup with Multiple Commands in InTouch

Question:

Are you unsure where to start when it comes to creating a popup with multiple commands? In the past, I used Citect for this purpose, so I know it can be done. Typically, these commands include actions like open/close, trip/close, start/stop. In the popup, there are usually 5 buttons: 2 "SELECT" command buttons, a "CLEAR" button to reset the selected command, an "EXIT" button, and an "EXECUTE" button for confirmation. Additionally, a text box displays the selected command or status. I want to streamline this process by creating a single popup that can be reused. For example, when selecting 52T1 breaker commands from the main page, the popup titled "52T1 Breaker" would display commands like "TRIP" and "CLOSE". After selecting a command like TRIP, a message would confirm the selection and set a memory integer to 1, indicating the chosen command. Pressing "EXECUTE" would send the command to the PLC, display a confirmation message for 1 second, and then reset values. I have a general idea of what needs to be done, but I need guidance on the best way to implement the code, especially since I'm not familiar with InTouch script syntax. How can I specify which button opens the popup, and how should I structure the script within the popup? Any examples or suggestions would be greatly appreciated. Thank you.

Top Replies

Several years ago, I implemented a feature for a valve control system where a number could be passed when activating a popup, such as through a parameter or text input when a function key or touch area was pressed. Each valve and motor had a designated touch area that would bring up a control dialog with the corresponding valve number details passed as a parameter. Unfortunately, I no longer have access to Intouch documentation to provide a guide on how to replicate this feature. Similar functionalities can be found on various Scada systems available in the market today.

I have successfully initiated a task: Displaying a "POPUP" message, setting POPUP_CMD_SEL to 1. The real challenge lies ahead when dealing with script syntax.

In the scenario where I have two breakers, 52T1 and 52T2, on my main 1-Line page that open the same popup page named CMD_POPUP, it's important to determine which button triggered the popup. To achieve this, consider utilizing "Indirect" tags in your InTouch scripting. By creating the CMD_POPUP with tags like "Breaker_Execute" as an indirect tag, you can set the Breaker_Execute tag to 52T1_Execute in the action script that opens the popup. This allows the popup to inherit properties and actions from the specific button that triggered it, such as a link to a PLC register or a descriptive text like "52T1 TRIP COMMAND SELECTED". Repeat the process for the other breaker, 52T2, by using its trigger script to open the same popup with its unique properties. For further guidance on using Indirect tags in InTouch, refer to the help pages for a more detailed explanation. Good luck with your scripting!

Indirect tags serve as "pointers" to other tags, allowing you to display data from multiple sets of tags in a single InTouch window. Rather than creating separate windows for each piece of data, you can utilize indirect tags to showcase values from different source tags associated with individual pumps within a single window. By utilizing a QuickScript or operator action, you can assign indirect tags to source tags. For instance, the script statements below demonstrate how to link two PumpRPM tags to an indirect analog tag named IndPumpRPM based on the value of the PumpNo tag: IF PumpNo == 1 THEN IndPumpRPM.Name = "PumpRPM1"; ELSE IndPumpRPM.Name = "PumpRPM2"; ENDIF; When an indirect tag is equated to a source tag, it behaves as if it were the source tag itself. The values of the original source tag and the indirect duplicate tag are synchronized, ensuring that any changes in one are reflected in the other. Indirect tags come in discrete, analog, and message types, similar to various memory and I/O tags. For further details on indirect tags, refer to the guide on Defining Indirect Tags. Ready to experiment with indirect tags and enhance your application's efficiency.

After working on my popup script, I have implemented a section in the Window that houses all my command tags. One specific part of the script checks for certain conditions (such as POPUP_CMD_NUMBER being equal to 1, POPUP_CMD_BUTTON_INT being equal to 2, and POPUP_CMD_SEND being equal to 1) and if these conditions are met, it executes the ESTOP command and displays a message. I would like to add a 1-second pause before hiding the "P10_CMD" element so that the operator can see the command execution message. Do you know of a simple way to achieve this? I am not an expert in scriptwriting.

I’ve worked extensively with InTouch in the past and it is really quite intuitive once you get into the swing of things. Regarding specifying which button opens the popup, you should be able to use an event like a Button script in InTouch WindowMaker, set to Click/Release, and then utilize the function ‘ShowWindow("YourPopupWindowName")’ to display the appropriate popup window. As far as structuring the script within the popup, judging from what you've shared, you might benefit from using local tags within the popup to track and manage your button states. Then, you could use conditional statements (if-else) to assign memory integers to your command buttons, which in turn send signals to your PLC. Lastly, by using a delay function and an appropriate update function, you could facilitate the brief confirmation message followed by a reset. I don’t have any specific script examples on hand, but those are some general directions that should hopefully get you started. And don’t forget to manage error cases to avoid conflicts in command inputs. You got this, bit by bit practice and experimentation will make it easier.

Your goal of creating a reusable popup in InTouch is absolutely achievable. To specify which button opens the popup, you'd usually use the 'ShowWindow' function in the click event script of the button on your main page. For structuring the popup, InTouch visual script/QuickScript is fairly straight-forward. Here is an example: let's say you have a button on your main window, Button1 - its script could be something like 'ShowWindow("PopUp");' which would call your popup. Inside the popup, you could script the buttons to set a memory integer to signify a command (e.g., Button_Trip could have a script 'MemoryInteger = 1;' and so on). As for the execute button, it would read the MemoryInteger and send the appropriate command. For instance, 'if MemoryInteger == 1 then SendCommand('Trip');'. Additionally, you could set up your clear and exit buttons such that they reset the MemoryInteger and close the window respectively. Try to play around with that logic, and test incrementally. Wonderware InTouch help files are quite elucidative; they should be helpful to get used to the syntax and commands!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. How can I create a custom popup with multiple commands in InTouch?

Answer: - To create a custom popup with multiple commands in InTouch, you can start by defining the commands and buttons you want to include in the popup. Consider using buttons like "SELECT," "CLEAR," "EXIT," and "EXECUTE" along with a text box to display the selected command or status. You can then write the necessary script within the popup to handle button actions and interactions with the PLC.

FAQ: 2. Can you provide an example of how to implement a reusable popup for selecting breaker commands in InTouch?

Answer: - To implement a reusable popup for selecting breaker commands in InTouch, you can create a popup titled "52T1 Breaker" with buttons for commands like "TRIP" and "CLOSE." Upon selecting a command, you can confirm the selection, set memory integers, send commands to the PLC upon pressing "EXECUTE," display confirmation messages, and reset values as needed. Structuring the script within the popup is essential for handling these functionalities efficiently.

FAQ: 3. How do I specify which button opens the custom popup in InTouch?

Answer: - In InTouch, you can specify which button opens the custom popup by assigning the appropriate script or action to the button's "OnPush" event. By defining the behavior for opening the popup upon button press, you can ensure that users can access the popup when needed within your application.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’