LESSON

Multi-Monitor Clients

Description

Learn how to open additional desktops from a client. Desktops are additional workspaces that share informatinon from a single client. This allows multiple windows to span multiple monitors. Desktops can be created with and manipulated through Python Scripting. Values can be shared across desktops by using Client Tags. Sometimes referred to as multimonitor or multidesktop clients.

Video recorded using: Ignition 7.9

Transcript

(open in window)

[00:00] In this lesson we'll take a look at opening additional desktops. Creating a new desktop gives me some additional workspace for my 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 opened 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. They've got a separate button for that. And here's a different desktop. 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 get fairly redundant. But let's take a look at the multiple windows desktop I created. So I'm going to double-click on the button, and I'm doing this by calling this system.gui.openDesktop here. I'm specifying which monitor the desktop should open on, as well as which window should appear inside of this desktop. I gave it a handle, which is basically a reference I can use from other scripts later on. And then I 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 the button that closes just one of the windows. I'm going to close this scripting window. I'm going to open up the scripting event here on the Close Docked Window button. And you 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 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 it 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. Now I'm going to close the scripting window. 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, 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 onto this window here to create a new component. How about a numeric text field. That way we can see the value from any one of these windows. I'm going to save and publish my changes. My client's configured to automatically update, so the new component is ready. I'm going to open that Multiple Windows desktop. And if I change the value on this numeric value text field here, it changes the value over here 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 could instead user a client start-up script. Back in the designer, under Project, Client Event Scripts, and this startup event here. This way, the desktops will open in the positions you want without making the user manually open them.

You are editing this transcript.

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