LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

haw program an indicator led very simple

haw program an indicator led very simple
0 Kudos
Message 1 of 3
(3,285 Views)
If you have a panel with a constant PANEL and a handle panelHandle and an LED constant LED,
// turn LED on
SetCtrlVal(panelHandle, PANEL_LED, 1);
// turn LED off
SetCtrlVal(panelHandle, PANEL_LED, 0);
0 Kudos
Message 2 of 3
(3,281 Views)
There are two basic ways to interact with controls: read or write values, or read or write attributes.
GetCtrlVal = Get (or read) control value
SetCtrlVal = Set (or write) control value
The value can be 1 (on) or 0 (off) for an LED, a string for a text box, a number for a numeric control, etc.

Attributes can be used to change the way a control looks or acts. Attributes could be color, position, hidden or not, dimmed (disabled) or not, etc.
GetCtrlAttribute = Get (or read) control attribute
SetCtrlAttribute = Set (or write) control attribute

One of the best ways to learn about these functions is from the help on their function panel.
From any source file window, press Shift-Control-P to open the function panel search window.
Enter part of the function name of interest, e.g. GetC.
Select the function panel of interest from the list shown in the search window.
From the function panel window, go to Help >> Function, or Online Function Help (if available).

CVI ships with a wealth of sample programs. Browse through these to see some of the possibilities and methods for CVI. Look for the sample directory under the directory in which CVI was installed.
Message 3 of 3
(3,275 Views)