Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

LED rendering error

Hello,

 

I have encountered a rendering issue with the LED component of a .NET Winforms application I am developing (NationalInstruments.UI.WindowsForms.Led).  The LEDs appear to be functioning correctly throughout my application, but I am seeing an occasional error with the rendering at different times during the program.  Has anyone seen this issue before?  Here is what I am seeing:

 

Rendering Error:

Rendering Error

 

Normal:

Normal

 

Thank you for your assistance!!

 

-Eric

0 Kudos
Message 1 of 8
(6,353 Views)

Hi EricJay,

 

Which version of Visual Studio/Measurement Studio are you using? There has been some rendering issues with some of the UI controls. Also, does this rendering issue happen at specific times/intervals?

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(6,336 Views)

Hello Humphrey,

 

I am using VS2010 with MS2012 Enterprise.  All service packs are installed and up to date.  I notice that the LEDs all render properly at design time and at run time.  Only when an LED changes from off to on do I notice the problem.  Some of these LEDs are changed from another thread, using the Invoke method, which has worked well in the past.  However, most of the LED controls are changed from within the UI thread.  Once a LED control mis-renders (the white outline), it never reverts back to its correct display.

0 Kudos
Message 3 of 8
(6,331 Views)

Are the LEDs that render incorrectly the same specific ones or in a specific location on the UI (any tabs?)? How intensive is the code in the UI thread? I'm wondering if this problem shows up in a simpler case as well.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(6,324 Views)

I noticed the LEDs would render properly at startup, then they would change to the undisplayed state when they were signaled on or off from an event handler, on the main form of my application.  On a child form, the LEDs did not render at all at runtime...they were not visible on the form, whether they were changing states or not.  The main form does handle many events when the system is running, but nothing costly on the CPU.  The child form only has a timer to sync read from DAQmx every few seconds, but the LEDs are triggered by events.

 

As of today, all of the LEDs are rendering properly.  I am not sure what I did, since I added more events today than there were yesterday, but nothing impacting the LEDs.  I have noticed, however, a rendering issue with one of my child forms (not containing any NI elements), that appears intermittently.  Maybe this is a .NET 4.0 bug?

 

-Eric

0 Kudos
Message 5 of 8
(6,321 Views)

I'm not sure.
So there are LEDs on the main form as well as several child forms and all the LEDs are triggered by events? I wonder if there is anything overriding the rendering instructions or not allowing enough time for a refresh/redraw.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(6,311 Views)

I found the cause of my other rendering issues, and they may be related to the LED issue.  The child forms seemed to have rendering issues when I would set the main form (containing all of the events) as the owner of the child forms.  I explicitly set the owner of the child forms using code such as:

 

FORM_CALIBRATION fCalibration = new FORM_CALIBRATION;

fCalibration.Owner=this;

...

 

Once I removed the Owner statement, the rendering issue was solved.  This may have also affected the LED objects.  I hope this information helps, but it may end up being a .NET issue and not an NI issue, since the native TextBox controls also had rendering problems.

 

-Eric

0 Kudos
Message 7 of 8
(6,307 Views)

Interesting, good to know. I guess we'll wait to see if the Measurement Studio LEDs still have issues rendering.

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(6,296 Views)