LESSON

Multi-Monitor Clients

Description

Learn how to open additional desktops from a Client. Desktops are additional workspaces that share information from a single Client. This allows multiple windows to span multiple monitors. Desktops can be created and manipulated through Python scripting. Values can be shared across desktops by using Client Tags (sometimes referred to as multi-monitor or multi-desktop Clients

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] In this lesson, we'll take a look at opening additional desktops. Creating a new desktop gives some additional workspace for vision windows. You can see that I have a client open here as well as a bunch of buttons on this one window. Desktops are open with a Python script and I have several ready on these buttons here. If I click on the open single desktop button here, another desktop appears. Obviously I can reposition it, I can also resize it if I like, or even move it to a completely different monitor. Now, while I can make those changes manually, I can actually automate them on the button press. So say I wanted to open a desktop down here on the lower left corner of this monitor. I've got a separate button for that, and here's a different desktop.

[01:03] I can also create a new desktop with multiple windows open. So if I click this button here, there's another desktop that has a docked window as well as a main window inside of it. Additionally, one desktop may make navigational changes to another desktop. So I could close this docked window here from my primary desktop on this single button press here. And once I'm done, I can close all of these additional desktops. So let's take a look at how I'm doing this. I'm going to bring up my designer. I'm not going to show you the scripts on all of the buttons here as they will get fairly redundant, but let's take a look at the multiple windows desktop I created. So I'm gonna open the script on the button and we can see I'm doing this by calling system.gui.open desktop here. I'm specifying which monitor the desktop should open on as well as which window should appear inside of this desktop.

[02:04] I gave it a handle which is a reference I can use from other scripts later on. I then specified the position as well as how large the desktop should be. So this is how I opened the desktop with multiple windows. Let's take a look at that button that closes just one of the windows. I'm going to close this scripting window here, and I'm gonna open up the scripting window on the close docked window button. You can see I'm calling this system .nav.desktop which just gets a reference to some desktop that's open. And here's where I pass in my handle. That handle comes in handy if you plan on having desktops interact with each other. So it's a good idea to give your desktops meaningful handles. Once I have a reference to that desktop, then I can tell her to go ahead and close this one specific window. Now, if you're looking for information on all of these scripting functions, check out the multi-monitor clients page in the user manual or the scripting appendix.

[03:07] Now say I wanted to pass a value from one desktop to another desktop. The easiest way to do this is actually with a client tag, while desktops appear as separate windows, they're all part of the same client instance. This means they share client tag values. So for example, I have this another window over here. This is one of the windows I'm opening on those additional desktops. It has a numeric text field component and it's bound to this my client tag here. So I'm going to go back to that desktop window and I'm just going to drag and drop this tag onto the window to create a numeric text field. That way, we can see the value from any one of these windows. I'm going to save my changes. My client's configured to automatically update, so the new component is ready.

[04:04] I'm gonna open that multiple windows desktop, and if I change the value on this numeric text field here, it changes the value over there as well. So again, it's really easy to pass values between multiple desktops. Now, in this video I've been using buttons to open the new desktops, but if you want the desktops to open automatically when the user logs in, then we can instead use a client startup script. Back in the designer under project client events scripts, here's the start-up event. This way the desktops will open in the positions you want without making the user manually open and configure them.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.