I was trying to do this:
Upon starting the VI 'Monitor' shows 0 no metter which monitor I run the VI on.
Any way LabView can know which monitor the VI is currently on?
Solved! Go to Solution.
That invoke node returns the values that are set in the VI properties, not the actual real-time properties. Use the property node FP->Monitor to get the realtime monitor.
That doesn't work either unfortunately... The indicator simply doesn't change no matter which screen I launch the VI on.
I run the VI on my laptop screen and I also have a monitor plugged into the HDMI port of the laptop, if that helps.
That's an important detail. I'm not sure how laptops handle an attached monitor. If you open the screen properties by right clicking the desktop, does it show two side by side monitors that can be customized? What happens when you click Identify?
That works ok, I can see that the screens are identified correctly according to the graphical settings.
The laptop is Dell's 7559 inspiron. It has an nVidia GPU, if that matters. I noticed also that the windows display settings don't necessarily match Intel's graphic settings. Not sure if that matters to Labview but could be...
Any ideas what to do?
Can you share your code (2012 if possible) or show a picture of your VI properties.
Also you said that FP.Monitor did not work. Drop this snippet into a new vi by itself and run it on both screens and see if it works properly.
If the Front Panel -> Monitor node doesn't update live on your system (it does on mine, but like you say you may have a setup that doesn't detect it...)...
Can you see if the "Application" property Display -> All Monitors outputs an array containing one cluster for each of your monitors? If it doesn't, then the issue is based on the fact that it's not detecting the second monitor as a distinct monitor at all.
If it does find the second monitor, then maybe you can use the VI property Front Panel Window -> Window Bounds values to calculate which monitor it's on based on its coordinates.
OK, it finally works.
At first I isolated the snippet as you suggested and it worked, then I dug deeper into the code and found that somewhere later I reinitialized the indicators. Silly bug that wasted quite a bit of my time !
Thanks for all the tips!