03-15-2015 07:22 AM
I'm not sure what the question is anymore.
The question is simple: How can I get the monitor # that I feed to FP.MONITOR to agree with the monitor # that the Device Manager assigns?
If they click on the IDENTIFY function in Windows display manager, it will show a "1", "2", "3', "4" on the various monitors.
I was hoping that if I fed a "3" to the FP.MONITOR property, it would come up on the one that everybody else calls #3.
But it doesn't.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-15-2015 07:36 AM
My solution was to not use the LabVIEW Windows Run Time Position property.
--- Well, I am not depending on the Run Time Position property (from the VI PROPERTIES panel), but I am using the FP.MONITOR property in code.
However, I suspect they are the same.
(I just verified that - the RTP property yields the same incorrect results as the FP.MONITOR property).
Of course, the multiple monitors are simply showing sections of one larger virtual screen.
--- Right.
The upper left corner of the Primary monitor sets the 0,0 origin.
--- Right.
Was the position changed using the Windows utility or possibly one provided by the video card mfg?
--- I changed it with the Radeon control panel. However, the only way to do that was to disable some monitors, and then re-enable them in the order I wanted. But that doesn't stick thru a reboot.
I suggest switching the video cables so that Windows finds them in the right place by default. See if they are stable there.
---Switching cables doesn't change how Windows finds the cards.
I DON'T CARE if the monitor numbers are 1,2,3,4 left to right or not.
I just want LabVIEW to agree with Windows as to which one is #2, which one is #3, etc.
And the positions are stable, but only in one state, that the cards determine.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-15-2015 07:54 AM
@CoastalMaineBird wrote:
The question is simple: How can I get the monitor # that I feed to FP.MONITOR to agree with the monitor # that the Device Manager assigns?
I doubt you can. The Monitor property apparently works with the lower monitor list. I have no idea why, as I would also instinctively expect it to use the virtual one, but you can see that that's what it does, so there's no point in arguing with it. I would expect you have one of two options:
03-15-2015 08:43 AM
I doubt you can.
--- Yes, that's my conclusion as well.
The Monitor property apparently works with the lower monitor list.
--- Yes, if that list is in order (1,2,3,4) then everything else falls into place.
So, this is a Windows problem, not really a LabVIEW problem.
Although the question still remains, how does it get hold of that list.
But I'm going to drop the question for now.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-16-2015 04:30 AM - edited 03-16-2015 04:47 AM
CoastalMaineBird wrote:
Here's another pic with that snippet having run:
It's not a generic fix but if you know that your virtual monitors are always numbered from left to right you could simply query the All Monitors list, then observe the Left and Top points of each and sort them accordingly. Then find out the mapping between your original list and the sorted list and you have the translation table from your virtual monitor number to the real device number (and vv).
LabVIEW's multimonitor support was added at a time where Windows was just starting to support this. You didn't have any way of assigning monitor numbers in most setups, except sometimes through the vendor specific video control panel and there was no common API to query the vendor specific configuration. Not even sure there would be such an API now to be honest.
The official multimonitor API in Windows is EnumDisplayMonitors() and that returns the list of monitors in the order as shown in the lower part of your control panel and corresponds with the list as LabVIEW uses it. The virtual device number as specified in your vendor specific control panel seems not to be queriable with any of the official Windows API functions, after an admittingly limited search on MSDN.
03-16-2015 06:24 AM
if you know that your virtual monitors are always numbered from left to right
--- But I don't. The user can arrange them any which way, and all cells may not arrange them the same way.
LabVIEW's multimonitor support was added at a time where Windows was just starting to support this.
I remember using LabVIEW 2 in 1991 on a Mac with three monitors, so it's not like it was a surprise. But, it was all one desktop; there was no FP.MONITOR property.
In any case, my customer has now said to leave it be - they have learned to deal with the shortcomings, and we have bigger fish to fry.
Thanks for your thoughts, Rolf.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-16-2015 10:10 AM
Hello Mr. Bird,
I read the case thoroughly, and i would have to agree with the statement:
"I doubt you can.
--- Yes, that's my conclusion as well."
Although it is possible to configure in which monitor a VI runs, as per using multiple monitors, we can make a list of the things that can make this operation not be fully functional for your case. One can begin with listing native hardware configuration (as per configuration I mean graphic cards etc, that might cause a misconfiguration while using FP.monitor), Windows internal configuration and Labview Properties.
While doing some research on the internal Database, I was able to find basic articles of how it works, but it might be a little basic for the application you are trying to assemble.
For example:
"This example shows how VI server can be used to set the display monitor and position (i.e. maximized or minimized) of a VI at runtime."
Reference: https://decibel.ni.com/content/docs/DOC-29472
Also check :
I hope you do excellent in your application.
If you have further questions regarding this topic or you figure out an appropiate work around for your application, feel free to comment and share the knowledge.
Wishing you well,
Sigi R.
AE National Instruments.
03-16-2015 11:05 AM
OK, that snippet didn't work either - The monitor number did not agree with the IDENTIFY number.
HOWEVER
I found something out.
If I use the WINDOWS - DISPLAY - SCREEN RESOLUTION control panel to arrange the monitors, rather than the RADEON control panel, then things will agree.
Now, if I IDENTIFY from the WINDOWS C.P, I get a different order (1,2,3,4) than if I IDENTIFY from the Radeon C.P. (3,4,1,2)
And LabVIEW now agrees with the WINDOWS version of numbers.
If I swap 1&2 on the Radeon, then 3&4 swap on the Windows C.P.
So, the bottom line is that I need to use the numbers from the Windows C.P. and call it good. Radeon is off the rails....
Blog for (mostly LabVIEW) programmers: Tips And Tricks