12-18-2005 09:50 AM
12-19-2005 09:02 AM
12-19-2005 10:10 AM
Thanks for taking the time to look at this.
Yes, the value is set to true. I also experimented with a variety of other things, including turning the value false then true, and trying the Update() member function. Still, no luck.
FYI: Here's the content of my static function:
public static void SetLED( NationalInstruments.UI.WindowsForms.Led led, eGENERALSTATUS eStatus ){
switch( eStatus )
{
case eGENERALSTATUS.Good:
led.BlinkMode = NationalInstruments.UI.LedBlinkMode.None;
led.OnColor = Color.Lime;
break; case eGENERALSTATUS.Warning:new TimeSpan( 0,0,0,250 );led.BlinkMode = NationalInstruments.UI.LedBlinkMode.BlinkWhenOn;
led.BlinkInterval =
led.OnColor = Color.Yellow;
break; default:led.BlinkMode = NationalInstruments.UI.LedBlinkMode.BlinkWhenOn;
led.BlinkInterval =
new TimeSpan( 0,0,0,250 );led.OnColor = Color.OrangeRed;
break;}
led.Update();
}
Best regards,
Dennis
12-19-2005 01:45 PM
led.BlinkInterval = new TimeSpan( 0,0,0,250 );is actually setting the BlinkInterval to 250 seconds. It appears like it isn't working, but it is. You just have to wait 250 seconds (4.16 minutes) to see it blink. There are factory methods on TimeSpan that makes this easier because it is an easy mistake to make. Try using the methods TimeSpan.FromSeconds or TimeSpan.FromMilliseconds. The default BlinkInterval on the led is 800 milliseconds. You don't have to set it if this is reasonable for your application.
12-19-2005 02:14 PM
Oops, a silly mistake!
It should have been this, to set a 250 ms blink rate.
led.BlinkInterval = new TimeSpan( 0,0,0,0,250 );
Thanks a lot for noticing the error!
Dennis
12-19-2005 02:52 PM
Believe it or not, the problem still exists.
Here's a revised version of the code, with the TimeSpan construction fixed. As you can see, I also tried toggling the LED off and on at the end.
The color changes as expected, but the blink does not work.
public static void SetLED( NationalInstruments.UI.WindowsForms.Led led, eGENERALSTATUS eStatus ){
switch( eStatus )
{
case eGENERALSTATUS.Good:
led.BlinkMode = NationalInstruments.UI.LedBlinkMode.None;
led.OnColor = Color.Lime;
break;
case eGENERALSTATUS.Warning:
led.BlinkMode = NationalInstruments.UI.LedBlinkMode.BlinkWhenOn;
led.BlinkInterval = new TimeSpan(0,0,0,0,250);
led.OnColor = Color.Yellow;
break;
default:
led.BlinkMode = NationalInstruments.UI.LedBlinkMode.BlinkWhenOn;
led.BlinkInterval = new TimeSpan(0,0,0,0,250);
led.OnColor = Color.OrangeRed;
break;
}
led.Value = false;
led.Value = true;
}
12-20-2005 10:12 AM
12-20-2005 10:52 AM
Hello Adam,
Thanks a lot for the help.
I'm using V7.1, and tried to use your project, but had a problem with the license file. It references V8.0 components.
I saw what you did, so I created my own simple app in V7.1, and the LED works just fine.
In my original application that exhibits the problem, the form that implements the static function is in a class library. Perhaps that has something to do with the problem I'm seeing.
Best regards,
Dennis