LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LED Indicator

Sorry, I keep hitting space bar...
 
I'm using LabWindows/CVI and put a LED to act as an indicator. 
 
I am generating a discrete pulse and I want the indicator to turn on when it is outputing my waveform.  I have a "Generate" button to initiate the pulse.
 
I put the indicator lines in the Callback function for the Generate button.  It goes something like this:
 
if(event == EVENT_COMMIT)
{
  SetCtrlVal(panel, AO_PANEL_LED_2, 1);
  for(i=0; i<300, i++) //updating 300
     AO_VWrite(1,1,waveir[i]); 
}
SetCtrlVal(panel, AO_PANEL_LED_2,0);
 
I am assuming that the indicator to turn on is 1 and the indicator to turn off is 0.  Is this correct?
 
0 Kudos
Message 1 of 3
(3,347 Views)
Yes, your assumption is correct, but you may need a ProcessDrawEvents () to update the panel before entering the for loop, otherwise your led won't light.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,336 Views)
THANKS!  WIthout the function it wasn't working, but I added it and it appears to work great!
 
I
0 Kudos
Message 3 of 3
(3,329 Views)