LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

March Multi-Monitor Madness

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 31 of 38
(1,905 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 32 of 38
(1,897 Views)

@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:

 

  1. Get the two lists in the control panel to agree with each other, which will presumably sort your LV problem as well. I would suggest Google for that, but I don't know if that's possible or not.
  2. Forget about the monitor numbers and come up with another way to get the window where you want it. If you really care about showing them the monitor numbers, simply replace the monitor number display with your own - open a VI with a big number on each monitor for a few seconds.

___________________
Try to take over the world!
Message 33 of 38
(1,890 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 34 of 38
(1,883 Views)

CoastalMaineBird wrote:

 

Here's another pic with that snippet having run:

Monitors 2.PNG

 

 


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.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 35 of 38
(1,843 Views)

 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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 36 of 38
(1,827 Views)

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."

 

SetMonitor.png

 

 

 

Reference: https://decibel.ni.com/content/docs/DOC-29472

 

Also check :

 

http://forums.ni.com/t5/LabVIEW/VI-Window-Run-Time-Position-in-executable/m-p/440347/highlight/true#...

 

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.

"everything is achieveable through technology'
0 Kudos
Message 37 of 38
(1,791 Views)

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.

 

Monitors 3.PNG 

 

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....

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 38 of 38
(1,775 Views)