Just started using Ignition and I've gone through a lot of the University videos. At the end of Lesson: Multi-Monitor Clients it mentions using startup script to place a desktop in each window. I do not know much about Python, so I'm not sure where to start. My goal is to get a seamless display across three monitors that will show all the operations on the floor.
I think you can do this with system.gui.openDesktop
. Never tried it.
https://docs.inductiveautomation.com/display/DOC81/system.gui.openDesktop
edit: just tried, it's super easy. Works just as I'd expect, out of the box.
Just make sure to pass a LIST of windows (even if it's a one element list), not just a window itself.
If it's Vision you can use the following script that i've got either here or in some page of the manual that i don't remember anymore:
# Get the screen information for all of your monitors.
# The getScreens() function returns a dataset of the index (0 based), width, and height for each monitor.
screensDataset = system.gui.getScreens()
# Open the first window of the project in the (current) primary monitor.
screenIndex = screensDataset[0][0]
monitorNum = screenIndex + 1
primaryScreenText = 'Monitor %d' %monitorNum
#NavigationTabs is my primary window, replace it with your own
system.nav.swapTo('NavigationTabs', {'Display':primaryScreenText})
# Step through all of the screen information, starting with index 1 instead of 0.
for screenDetails in screensDataset[1:]:
# unpacks the tuple that is returned for each of the monitors present. Consists of screen index, width, and height of the screen.
screenIndex, screenWidth, screenHeight = screenDetails
monitorNum = screenIndex + 1
screenText = "Monitor %d" %monitorNum
# Open an empty frame on the next monitor.
# Assign a handle and apply the width/height for the monitor you are opening on
handleName = "Monitor %d" %monitorNum
system.gui.openDesktop(screen=screenIndex, handle=handleName, width=screenWidth, height=screenHeight)
# Open the Main Window on this new desktop and pass the parameters needed.
usuario = system.tag.read('[System]Client/User/Username').value
system.nav.desktop(handleName).swapTo('NavigationTabs', {'Display':screenText})
system.nav.desktop(handleName).openWindow('Main Windows/Home')
system.nav.desktop(handleName).openWindow('Main Windows/BannerAlarme')
system.tag.write('[client]Monitor',handleName)
I am not sure how to integrate this so that it will work. I am very new to this.
Well, that depends on what you need exactly.
If you want everything to open when launching the project, You could try using a client event startup script.
If you want extra screens to open under certain conditions, then that will depend on the conditions.
Yes, I would like for the project to open to all three screens on startup. I had already put suggested code into the Client Startup Script already but I'm getting an error. I assumed I would need to change some variables in order to get it to work in my project but I'm not sure which ones.
Well, we'll need the error message in order to help you fix it. Click on the details
tab.
Okay! I think I actually got it to work after looking through the details of the error code. Thank you both for your help.