キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

GetMonitorAttribute Bug

Hello All

 

I am having an issue with the GetMonitorAttribute function. I am using a dual monitor set up for a test station, and the second monitor will be unplugged and pluged back in quite often. The first go around the call to GetMonitorAttribute works fine. If I unplug the hdmi cable and plug it back in, the data retrived from the function is garbage. I am running LabWindows 2013 f1.

 

Apparently this was a bug in 2012 (See ID 397059):

 

https://www.ni.com/en/support/documentation/bugs/13/labwindows--cvi--2013-bug-fixes.html

 

Any ideas?

 

Thanks!

 

 

0 件の賞賛
メッセージ1/7
5,679件の閲覧回数

Hi bry0n,

 

The bug you pointed out is specifically for the GetMonitorFromPoint, GetMonitorFromRect, and GetMonitorFromPanel functions, so a bug in GetMonitorAttribute may not have been fixed. To report a bug we need steps and a small set of code to reproduce this issue. Could you post those here? We can take a look at it and determine if a new bug report needs to be filed.

 

Thanks,

Kevin Flanagan

Applications Engineer

National Instruments

0 件の賞賛
メッセージ2/7
5,612件の閲覧回数

Hi Kevin,

 

Thanks for the reply. I did not realize the bug I found was for those other functions.

 

Here is a snippet of code that I am using:

 

GetSystemAttribute (ATTR_PRIMARY_MONITOR, &primaryMonitorID);		//Find Primary monitor
GetSystemAttribute (ATTR_NUM_MONITORS, &numMonitors); 			//Get the number of monitors
					
if(numMonitors > 1)							//As long as there is more than one monitor
{
										
	for(loop = 1; loop <= numMonitors; loop++)					//Begin a loop through the monitors
	{
								
		GetMonitorAttribute(loop, ATTR_WIDTH, &width);			//Get the monitor width
		GetMonitorAttribute(loop, ATTR_HEIGHT, &height);		//Get the monitor height
		GetMonitorAttribute(loop, ATTR_LEFT, &posLeft);			//Get the x origin (top left of screen)
		GetMonitorAttribute(loop, ATTR_TOP, &posTop);			//Get the y origin (top left of screen)  

		if( (numMonitors >= 1) && (width == 1280) && (height == 800) ) //Look for specific monitor size
		{
			SetPanelSize(panelLcdHandle, height, width);           //Set the panel to fit monitor
			SetPanelPos(panelLcdHandle, posTop, posLeft);          //Set panel onto screen
			break;
		}
	}

}								 
	

The code works fine the first time through, but if the monitor is unplugged and plugged back in is when the issue arrises.

0 件の賞賛
メッセージ3/7
5,594件の閲覧回数

Thanks for the code, I'm going to attempt to reproduce this on my system and file a bug report if necessary.

 

Kevin Flanagan

Applications Engineer

National Instruments

0 件の賞賛
メッセージ4/7
5,566件の閲覧回数

Any luck with this?

0 件の賞賛
メッセージ5/7
5,282件の閲覧回数

Has this problem been addressed? I am having the exact same issue on Labwindows/CVI 2013.

0 件の賞賛
メッセージ6/7
3,735件の閲覧回数

Hi vicgd,

 

I am sorry that you are experiencing this issue. The LabWindows/CVI development team has run into some obstacles regarding this issue in software version 2013. The behavior has been fixed in CVI 2015. 

 

Best Regards,

 

Mitchell Faltin

Applications Engineer

National Instruments

0 件の賞賛
メッセージ7/7
3,719件の閲覧回数