GetCtrlAttribute

Hi all

I need to use the GetCtrlAttribute function to see whether a radio button is diammed or not.

I don't see what I put as the fourth argument: GetCtrlAttribute (Panel, PANEL_text_in_situ, ATTR_DIMMED,?)

Best regards

Hello

CVI provides assistance as a variety of examples of programs that are highly recommended

In your particular case, the gray attribute is of type integer, you must use

int is_dimmed = 0;

GetCtrlAttribute (Panel, PANEL_text_in_situ, ATTR_DIMMED, & is_dimmed);

Tags: NI Software

Similar Questions

  • cvicc on Ubuntu 12.04 toolbox.c undefined reference to 'GetCtrlAttribute '.

    I try to use cvicc to compile a GUI using Ubuntu 12.04 64-bit (originally written under Windows).  I had this working fine on RedHat 5 and 6 (the two 64-bit), so I know that the code is very well.  I have also all 32-bit libraries installed.  I also know that this machine will be to compile the code relatively complex, because I was able to compile the code C and C++ CUDA very well.

    I get errors like:

    Toolbox.c (.) Text + 0 x 13581): refers to 'GetCtrlAttribute' the undefined

    After you run

    cvicc project_name.prj

    So far I have not been able to understand the underlying problem.  I have been in charge of research and stumbling autour with this all day.  I'm not an expert of LabWindows/CVI.  Thanks in advance for any help.

    Hi cbrinegar,

    Please try to add the box library to LabWindows/CVI tools so she can access the Toolbox functions.  You can do this by selecting library from the menu bar and choosing Customize... in the resulting drop-down list down.  Customize the Menu library dialog box, click Browse and locate the file: toolbox.fp location: \toolslib\toolbox\toolbox.fp, where xxxx is the version of LabWindows/CVI number you use.  "Select the file and press on Select ' OK to complete the loading of the library.

    After trying this, please let me know if you still encounter errors of definition.

    Kind regards

    Hi cbrinegar,

    I apologize for the misunderstanding earlier.  Having to manually include your libraries should somewhat with CVICC under Linux.  You can find more information about it, here.

    Kind regards

  • Reminders of understanding

    I've been with CVI programming since the days of BASE in the 1990s, went to C-base code but have always programmed of up and down and never used reminders much. I want to change that. So here I am with my first serious attempt and something is not just make sense.

    I have a child Panel (SetupPanel as a handle) with a hot digital control. I want the user to be able to type a number and press ENTER to enter the value and return to the main loop. I know recall events are generated with the entry number, so I have an if statement to get the value of control when he sees a VAL_ENTER_VKEY event. The code runs correctly, but the new value the user has entered into the digital control is not being caught and stored in the variable referenced after executing the GetCtrlAttribute function successfully (returns a 0 indicates success).

    The GetCtrlAttribute same function with the same variables works very well elsewhere in the code, when it is called, it is only in the block of reminder where it is not catch the value of the current digital control. It has to be something fundamental, I do not understand about the use of reminders.

    int MaxDSCallback (int command face, int, int event, void * callbackData, int eventData1, int eventData2)
    {
    If (eventData1 == VAL_ENTER_VKEY) {}
    RET = GetCtrlAttribute (SetupPanel, Setup_AxisMax, ATTR_CTRL_VAL, &ddum);)
    }
    Return (0);
    } / / MaxDSCallback

    After execution, ret = 0, but the value of ddum is what it was before that the user has replaced the control, not the value of newly. Tried a ProcessSystemEvents() after the GetCtrlAttribute, no joy.

    Can someone explain to me what is happening here?

    Now, I am even more confused... Have you tried the following:

    int MaxDSCallback (int command face, int, int event, void * callbackData, int eventData1, int eventData2)
    {
    If (event == EVENT_VAL_CHANGED) {}
    RET = GetCtrlAttribute (SetupPanel, Setup_AxisMax, ATTR_CTRL_VAL, ddum &);)
    }
    Return (0);
    }

    This should return only after you press the Enter key, not after each keystroke...

  • DisplayImageFile() does not change the dimensions of the image control

    Hello

    I put in an image with DisplayImageFile() control image + assigning to the attribute of control ATTR_FIT_MODE = VAL_SIZE_TO_IMAGE. The image size is larger, then the size of the control and I want the control to resize to the size of the image.

    It works fine except when I ask the dimensions of the control with GetCtrlAttribute (panel, control, ATTR_HEIGHT, & height), I get the original size (before calling DisplayImageFile())...

    It seems I missed something basic...

    Environment: LAB Windows CVI 2012, Windows 7

    Thanks in advance

    Ramy

    I don't know if you still experience this problem or not, but I came across this discussion now and wanted to point out that this could happen if your picture controls if it is covered by another control or is it hidden altogether (and there might be other similar situations that I can't think of right now).

    When this happens, the CVI runtime can pull the image directly on the image. Instead, he plans an asynchronous action that will redraw this section of the Panel from the back to the front (if it's just overlapped, not hidden). It is only in the later action that the image is applied to the control, and it is only then that the control is resized to fit the image. This may seem immediate to the casual observer, but, because it is asynchronous, you can't try to get new size immediately after calling DisplayImageFile, because the image is not yet in control at that moment.

    Ironically, this occurs only if the control has already been set to the image size at the time you call DisplayImageFile. If this isn't the case, then the new size is applied when you later change the mode made programmatically. Whereas if the adjustment mode has been already updated the image size, trying to programmatically set the same value of the image size has no effect and nothing happens then.

    If this is what is happening, one way around this would be to call ProcessDrawEvents or ProcessSystemEvents immediately after the call to DisplayImageFile. Unless the control or Panel has been hidden way explicit, which will require the drawing action will take place at this time, and you should then be able to get the new size of control at any time after that.

    Luis

  • People with disabilities control operated even if disabled

    I just encountered a small problem which seems a bug to me.

    If you have a Panel and a knob under the close control, you can close the cover with the Red Cross in the corner, even if the button is disabled!

    It seems to me that in this case the Panel must not be closed instead.

    Attached to a small project that reproduces the situation: run the project, press "Disable exit button", click the x in the top right corner and voila: the Panel closes!

    Tested up to CVI2013SP2

    In the absence of other comments, I post here the solution to this problem, which is quite simple: the recall of control should be amended as follows:

    int CVICALLBACK QuitCallback (int, int int event, control panel,
    void * callbackData, int eventData1, int eventData2)
    {
    int grayed out;

    If (event! = EVENT_COMMIT) return 0;

    GetCtrlAttribute (Panel, control, ATTR_DIMMED, & gray); Test the control state
    If (! grayed) QuitUserInterface (0); Terminate the program only if possible

    return 0;
    }

    This seems a serious mistake for me, for this reason I posted a product suggestion: don't hesitate to support him with congratulations if you second in my opinion.

  • How can I edit programaticly a Panel?

    I have a panel that contains a number of buttons.

    The number of buttons and text in buttons is believed to change during execution of the program.

    I know how to create buttons on the fly using NewCtrl, but have problems erase/edit buttons of filtration.

    Is it possible to access the Ctrl object list in a Panel, investigate Ctrl objects and delete or modify the CTRL?

    For the moment, I use DiscardCtrl, but this forces me to keep track of objects Ctrl.

    Errors in mainting this information are difficult to debug. It would be much simpler if I could access the information that keeps the application.

    A magic rule in the CVI is that everything you can do in the editor of the IUR can be done programmatically ar DURATION: it is enough to know the right way to do it! So:

    Deleting a control: DiscardCtrl () (you have already discovered)

    Aspect of the editing control: almost all operations are performed with SetCtrlAttribute with the appropriate attribute.

    The list of controls can be done in this way:

    GetCtrlAttribute (panelHandle, ATTR_FIRST_CTRL, & ctrlID);

    so that {(ctrlID)

    work on the control

    ....

    Get the next control: 0 if the last control in the Panel is

    GetCtrlAttribute (panelHandle, ctrlID, ATTR_NEXT_CTRL, & ctrlID)

    }

    During the analysis of the controls in a Panel, you can collect more details on the control using the

    GetCtrlAttribute (panelHandle, ctrlID, ATTR_CTRL_STYLE, &style);)

    The list control (buttons, rings...) styles can be found in userint.h

    For example, attached is a function that I developed that:

    -scans all the controls in a Panel

    -all operable controls past between indicator or hot

    -skip controls in a variable argument list

    To call this function to set all control as hot:

    SetParamPanel (panelHandle, 1, VAL_HOT, 0);

    To enable all controls as indicator except button exit:

    SetParamPanel (panelHandle, 0, VAL_HOT, PANEL_QUIT, 0)

    I hope this helps.

  • Additional panel in the panels and controls in the Panel generated .h file

    I have a sign in my project, it is called LO_LVL_PNL.

    The generated header file seems to think that there are more. Here is the 'Panels and controls' section on the generated header file:

    / * Panels and controls: * /.

    #define DITHER 1
    #define DITHER_CLOSE 2 / * callback function: DITHER_CLOSE_CB * /.
    #define DITHER_Dither_Settings 3 / * callback function: DITHER_CONTROL * /.

    #define LO_LVL_PNL 2
    #define LO_LVL_PNL_SENDBUTTON_2 2 / * callback function: DIDsBUTTONcb * /.
    #define LO_LVL_PNL_SENDBUTTON_3 3 / * callback function: EraseBUTTONcb * /.
    #define LO_LVL_PNL_SENDBUTTON_4 4 / * callback function: SENDBUTTON_noe_cb * /.
    #define LO_LVL_PNL_SENDBUTTON 5 / * callback function: SENDBUTTONcb * /.
    #define LO_LVL_PNL_RESET_CAN 6 / * callback function: RESET_CAN_CB * /.
    #define LO_LVL_PNL_UUTRESPONSE 7 / * callback function: UUT_RESPONSE * /.
    #define LO_LVL_PNL_CLEARBUTTON 8 / * callback function: CLEARBUTTONcb * /.
    #define LO_LVL_PNL_EXIT_BUTTON 9 / * callback function: cb_quit * /.
    #define LO_LVL_PNL_Comm_Set_TEXTBOX 10
    #define LO_LVL_PNL_COMMANDBUTTON 11 / * callback: CheckState * /.
    #define LO_LVL_PNL_COMMANDBUTTON_2 12 / * callback function: Select_Files_DID * /.
    #define LO_LVL_PNL_BINARYSWITCH 13 / * callback function: SetProgram * /.

    in my IUR I can find LO_LVL_PNL components, but not parts of DITHERING.

    Then, I renamed my generated header file, so it can regenerate without these additional items, but they get included when I recreate it.

    In the file of the UIR, if I double click on he Panel it opens and displays that the Panel is called LO_LVL_PNL.

    It started because I'm trying to read the value of a switch on the Panel, and in the call, I get a runtime error that follows:

    GetCtrlAttribute (LO_LVL_PNL, LO_LVL_PNL_BINARYSWITCH, ATTR_ON_VALUE, & on_off);

    NO MORTALS RUN - TIME ERROR: 'gui_handler.c', line 135, col 13, thread id 0x0000179C: library function error (return value ==-42 [0xffffffd6]). The handle is not a panel handle

    I don't know if it's two separate issues, or DITHER things cause the error; but I need help to fix both.

    The first parameter to GetCtrlAttribute() must be the handle Panel, not the ID of the Panel. The handle is returned by your LoadPanel() call.

    Do you already have a group called DITHERING? Copied from an earlier project, perhaps? Perhaps the editor of UIR has hidden or placed outside the screen. Try using the option editor find to see.

    JR

  • change of scale of a channel running from the DAQmxSetScaleAttribute task

    Hi all

    simple system configuration: AI channel is configured using OR max and also using a scale that is configured in NI Max.

    Once the system is running, the task of the program started and playback of data acquisition, everything's fine. now I want to do is get the value of a string and reading that the DAQmx reads on the channel by chaning the ordinate at the origin of the linear scale at zero. I tried to get the y-intercept value and the actual value of the existing interception and defining the DAQmxSetScaleAttribute with the new linear value and nothing changes on the sudtracting channel. Possible solutions, I tried shutting down and restarting the task but not clearing and reloading of the task.

    I also tried DAQmxSaveScale, but the value in NImax for interception does not change either.

    is it somehting in the order of calls which must happen, or I can even change the scale on a task without compensation or recharge it the task?

    OK, that's how I got it working again noted that the system is configured using NImax and all the channels to HAVE are in a single task, also an important feature is that I use the DAQmxRegisterEveryNSamplesEvent function. each channel also has its own scale.

    First you need to find is the next shift, you need to recalcualte the max and min to the beach of this channel and save everthing.

    DAQmxGetScaleAttribute ("1Dist", DAQmx_Scale_Lin_YIntercept, & readOffset);  \\get the existing scale value
    stopDAQ();
    GetCtrlAttribute (panelManual, MANUAL_1POS, ATTR_CTRL_VAL, & actualReading);   \\reading off the coast of data acquisition
    newOffset = (actualReading + readOffset) *-1;                                                                     offset \\calcualte
    ERR is DAQmxGetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Max, & max, NULL);.   cahnnel \\get NIMAX Info
    ERR is DAQmxGetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Min, & min, NULL);.      cahnnel \\get NIMAX Info
    newMax = max + newOffset;
    Max = newMax;                  ------It will be ediedited what I did was made max an int to get rid of the decimal points
    newMin = min + newOffset;
    min = newMin;                   ------It will be ediedited what I did was made max an int to get rid of the decimal points
                
    DAQmxClearTask (gDAQTaskHandleAI);                                 \\clear the task due to the attached DAQmxRegisterEveryNSamplesEvent will thow errors because it is attached to the task
    DAQmxLoadTask (DAQMX_TASK_TITLE_AI & gDAQTaskHandleAI);
                
    ERR = DAQmxSetScaleAttribute ("1_Act_Ext_Dist", DAQmx_Scale_Lin_YIntercept, newOffset);
    ERR = DAQmxSaveScale ("1_Act_Ext_Dist", "1_Act_Ext_Dist", "", DAQmx_Val_Save_Overwrite |) DAQmx_Val_Save_AllowInteractiveEditing | DAQmx_Val_Save_AllowInteractiveDeletion);
    ERR = DAQmxSetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Max, max, NULL);
    ERR = DAQmxSetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Min, min, NULL);
            
    ERR = DAQmxSaveTask (gDAQTaskHandleAI, DAQMX_TASK_TITLE_AI, ' ',)
    DAQmx_Val_Save_Overwrite | DAQmx_Val_Save_AllowInteractiveEditing | DAQmx_Val_Save_AllowInteractiveDeletion);
    DAQmxClearTask (gDAQTaskHandleAI);
    DAQmxLoadTask (DAQMX_TASK_TITLE_AI & gDAQTaskHandleAI);
    GetCtrlAttribute (panelDAQ, DAQ_PANEL_SampPerChannel, ATTR_CTRL_VAL, & sampsPerChan);

    DAQmxRegisterEveryNSamplesEvent(gDAQTaskHandleAI,DAQmx_Val_Acquired_Into_Buffer,sampsPerChan,0,EveryNSamplesCallback,);

    startDAQ();

  • a table column sorting

    When sorting by a column of table with the built-in context menu (CVI2010), I came across two issues, I do not understand:

    (1) I start with a table with a single line and other programmatically insert lines, in this case 2 more for a total of 3. I also checked using the GetCtrlAttribute (, ATTR_NUM_VISIBLE_ROWS,) which also results in three rows, see figure below.

    Interestingly, when you use the sorting, it shows a range of cells that extends up to 13... ?

    (2) by clicking on the OK button of yields the result shown in the figure below, i.e. three empty fields...?

    Thanks, Wolfgang

    .. .or simply go to the box to add, cut, paste, modify the line keys, type 1000 in the line number and press the Tab key: it will be converted to the last row number in the table.

  • Thermometer indicator has a high-water mark attribute?

    Can the indicator thermometer place a mark at the highest temperature recorded so far?  My request concerns a fluctuating temperature. I would like to draw a line at the maximum temperature achieved so far. The thermometer 'mercury' will continue to fluctuate below this line. Is this possible?

    Thank you

    Here's a way to do it.

    Have two thermometers, one above the other.  The upstairs has a transparent background, no fill, no ticks or markers.

    The one on top will track your max, one on bottom will track the variable temperature.

    Whenever you update the background temperature, check if it is greater than the previous max and update the higher temperature if it is.

    See the attached example.

    Here are some details.

    Create a thermometer control on your Panel.

    Configure your default, max, and min etc.

    Copy your thermometer.

    Edit the copy to do the following.

    Delete the text of the label.

    Under the appearance of the control, click Show/hide of the parties and set the options of markers of no., no. ticks, no fill and uncheck display a digital display.

    In the quick edit window, select the brush control and do a right-click on the background color at the top of the thermometer to set the T (transparent) color.  Right click on the marker in the middle of the thermometer, and then select a color for your max marker.

    To make editing easier, do not put the controls on top of the other in the Publisher: do it in your code using GetCtrlAttribute() on the original thermometer and SetCtrlAttribute() on the copied transparent thermometer.

    The attached example illustrates this method.

  • Control tab Keypress event

    Hello

    I use a tab control and that you may not know how to handle the following situation.

    We know that when you use a tab control we can jump from tab to tab by pressing .

    When I hold the last tab to jump to other conbtrol and not the first.

    Unfortunately, in this situation does not generate an EVENT_KEYPRESS.

    Is there a way to handle this situation?

    I believe that I have found a workaround. You can use InstallWinMsgCallback to install a reminder for the Panel and locate the WM_KEYDOWN message. It's a little more complicated because you will not receive any eventData1 and eventData2 tell you what key and the modifier is used, then you must check separately for the control key (I use a global flag to specify if CTRL is pressed).

    In hand, you will need to install the callback as follows:

    InstallWinMsgCallback (panelHandle, WM_KEYDOWN, MyCallback, VAL_MODE_INTERCEPT, NULL, &postHandle);
    
    ...
    //in clean-up
    RemoveWinMsgCallback (panelHandle, WM_KEYDOWN);
    

    Then, in the reminder, use the following code:

    int CVICALLBACK MyCallback (int panelHandle, int message, unsigned int *wParam, unsigned int *lParam, void* callbackData)
    {
        int lastTab, control, pageIdx, nextCtrl;
        switch(message)
        {
            case WM_KEYDOWN:
                if(*wParam == VK_CONTROL)
                {
                    ctrlDown = 1;
                }
                else if(*wParam == VK_TAB)
                {
                    if ((control = GetActiveCtrl(panelHandle)) == PANEL_TAB)
                    {
                        GetActiveTabPage (panelHandle, control, &pageIdx);
                        GetNumTabPages   (panelHandle, control, &lastTab);
                        if(pageIdx == lastTab - 1)
                        {
                            GetCtrlAttribute (panelHandle, PANEL_TAB, ATTR_NEXT_CTRL, &nextCtrl);
                            SetCtrlAttribute(panelHandle, PANEL_TAB, ATTR_CTRL_INDEX, pageIdx);
                            SetActivePanel(panelHandle);
                            SetActiveCtrl (panelHandle, nextCtrl);
                            return 1;
                        }
                    }
                }
                break;
            case WM_KEYUP:
                if(*wParam == VK_CONTROL)
                    ctrlDown = 0;
        }
        return 0;
    }
    

    Note: You must call SetActivePanel before SetActiveCtrl to transfer the focus in the tab to the Panel.

  • Enum chopsticks on the specified Panel

    Is given the handle Panel, there a way to get a list of all the controls in the Panel programmatically?

    Yes

    You can use the attribute Panel ATTR_PANEL_FIRST_CTRL to get the first control panel, click the attribute of the control ATTR_NEXT_CTRL to find all other controls:

    GetPanelAttribute (panel_handle, ATTR_PANEL_FIRST_CTRL, & control_id);

    While (control_id > 0)

    GetCtrlAttribute (panel_handle, control_id, ATTR_NEXT_CTRL, & control_id);

  • Digital button & code that must run outside the switch of the event

    I have an interesting situation.  I have a command button which I activated the control via the mouse wheel of the user (thanks to great examples of code herein for one!). To do this I like, I had to put the processing part of the code outside the set event button, such that the value of the output of the control would be updated immediately.

    The only problem with this methodology which is then when the user closes the Panel and the button control is a final reminder, this block of code is executed one last time, which translates into a non fatal error "invalid control ID '.  The solution here is relevant, but is not ideal as shown above.

    My solution feels like a hack, but tell me what you think - trap on EVENT_DISCARD and back at the beginning.  Seems to work, just feels like a patch.  Here is the code:

    int CVICALLBACK KnobCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
    {
        int prevValue = 0;
        int currValue;          // current value of knob control, range = 0-100
        double currMotor = 0;
        double currMeter = 0;
        double idealMotor = 0;
        double currVoltage;
        int max, min, inc;
    
        // find the range values set in the UIR control:
        GetCtrlAttribute(panel, control, ATTR_MIN_VALUE, &min);
        GetCtrlAttribute(panel, control, ATTR_MAX_VALUE, &max);
        GetCtrlAttribute(panel, control, ATTR_INCR_VALUE, &inc);
    
        // load the current control changed value:
        GetCtrlVal(panel, control, &currValue);
    
        switch (event)
        {
            case EVENT_COMMIT:  // any control commit:
                break;
    
            case EVENT_MOUSE_WHEEL_SCROLL:
    
                switch (eventData1)
                {
                    case MOUSE_WHEEL_SCROLL_UP:
                        if (currValue < max)
                            currValue += inc;  // increment 1 step at a time, not eventData2 number of steps (Windows scroll wheel number)
                        else
                        {
                            currValue = max;    // hold at max
                            return 1;   // Swallow event to prevent from updating UIR
                        }
                        break;
    
                    case MOUSE_WHEEL_SCROLL_DOWN:
                        if (currValue > min)
                            currValue -= inc;  // decrement 1 step at a time, not eventData2 number of steps (Windows scroll wheel number)
                        else
                        {
                            currValue = min;    // hold at min
                            return 1;   // Swallow event to prevent from updating UIR
                        }
                        break;
    
                    case MOUSE_WHEEL_PAGE_UP:
                        if (currValue < max)
                            currValue += (inc * 5);  // eventData2 = 0 when PAGE up/down
                        else
                        {
                            currValue = max;    // hold at max
                            return 1;   // Swallow event to prevent from updating UIR
                        }
                        break;
    
                    case MOUSE_WHEEL_PAGE_DOWN:
                        if (currValue > min)
                            currValue -= (inc * 5);  // eventData2 = 0 when PAGE up/down
                        else
                        {
                            currValue = min;    // hold at min
                            return 1;   // Swallow event to prevent from updating UIR
                        }
                        break;
                }
                SetCtrlVal(panel, control, currValue);  // update control with processed value
                break;
    
            case EVENT_VAL_CHANGED:
                if ((currValue < prevValue) && (currValue > min))         // decrementing above floor
                {
                    currValue -= inc;
                }
                else if ((currValue > prevValue) && (currValue < max))        // incrementing below ceiling
                {
                    currValue += inc;
                }
                else if (currValue = max) // TODO: this condition doesn't work as expected; control doesn't trap for wrap-around from max to min, vice versa
                {
                    currValue = max;    // hold at max
                    return 1;   // Swallow event to prevent from updating UIR
                }
                else if (currValue = min) // TODO: this condition doesn't work as expected; control doesn't trap for wrap-around from max to min, vice versa
                {
                    currValue = min;    // hold at min
                    return 1;   // Swallow event to prevent from updating UIR
                }
                SetCtrlVal(panel, control, currValue);  // update control with processed value
                prevValue = currValue;  // update state variable
                break;
    
            case EVENT_DISCARD:
                return 0;   // TODO: bug fix for quitting cleanly, so that the code outside of the event switch doesn't execute one last time when the panel is quit.
                break;
    
        }   // end switch
    
        currVoltage =  (currValue * MOTOR_VOLT_STEP) + MOTOR_VOLT_MIN;
        currMotor = LabJackTimer(LABJACK_TIMER0);
        idealMotor = MOTOR_SLOPE * currVoltage;
    
        if (abs((int)(currMotor - idealMotor)) < MOTOR_TOL)
        {
            SetCtrlVal(panel, MAINPANEL_TEXTMSG6, "GOOD");
            SetCtrlAttribute(panel, MAINPANEL_TEXTMSG6, ATTR_TEXT_BGCOLOR, VAL_GREEN);
        }
        else
        {
            SetCtrlVal(panel,MAINPANEL_TEXTMSG6,"FAIL");
            SetCtrlAttribute(panel, MAINPANEL_TEXTMSG6, ATTR_TEXT_BGCOLOR, VAL_RED);
        }
        return 0;
    }
    

    I suggest to put the code SetCtrlVal fragment in a separate function and call this function for the correct event only; at present, it is called for any event, including the event throwing...

    In addition, there is no need to recall the values min/max/inc of your control each time, once the start programme should be enough

  • access control using the control panel handle

    Is it possible to access the constant name when I only have the panelHandle of the IUR. The control is part of the different project and panelHandle went from the first

    project for the second project. Second project now need to set the value of the control, but doesn't have access to the panelHandle of the first project.

    TIA

    lvrat,

    There are two ways to detect certain characteristics of a control during execution. Wolfgang and I were suggesting was something like this (code written in memory: there may be some mistakes in there):

    int ctrl, mode, style;

    name char [32];

    'panelHandel' has received another application

    GetPanelAttribute (panelHandle, ATTR_PANEL_FIRST_CTRL, &ctrl);)

    all in (ctrl) {}

    through the constant name

    GetCtrlAttribute (panelhandle, ctrl, ATTR_CONSTANT_NAME, name);

    If (! strcmp (name, "NUMERIC1")) {}

    }

    Else if (! strcmp (name, "NUMERIC2") {})

    }

    ALTERNATIVE: other discriminatory features in the

    GetCtrlAttribute (panelHandle, ctrl, ATTR_CTRL_STYLE);

    switch (style) {}

    case CTRL_SQUARE_COMMAND_BUTTON:

    case CTRL_SQUARE_COMMAND_BUTTON_LS:

    GetCtrlAttribute (panelHandel, ctrl, ATTR_CTRL_MODE & mode)

    If (mode == VAL_HOT) {}

    do something on the control...

    }

    break;

    by default:

    do nothing

    break;

    }

    Check to see if there are more controls on the Panel

    GetCtrlAttribute (...,..., ATTR_NEXT_CTRL,...);

    }

    A list of control styles can be found here and in userint.h. Here the list of control modes.

    There are many attributes that makes a distinction between controls in a Panel. But doubt principal remains the same: have you tried to access a control from another application through handle Panel CVI?

  • highlighting a graph link

    Hello

    I want to highlight a section of a data plotted on a graph (i.e. a rectangle area in the Middle graph th).

    is it difficult to achieve methods?

    Thanks for any help

    Sahin

    You can draw a rectangle and set its z-plane order behind the locations of data, using for example

    rectangle_handle = PlotRectangle (...);

    GetCtrlAttribute (panel_handle, PANEL_GRAPH, ATTR_NUM_PLOTS, & plot_handles);

    SetPlotAttribute (panel_handle, PANEL_GRAPH, rectangle_handle, ATTR_PLOT_ZPLANE_POSITION, plot_handles - 1);

Maybe you are looking for

  • iCloud locked

    Recently update my apple ID to @me.com to my @gmail.com but did not stop the find my iphone on my phone feature. Now my phone stuck with the old account. Any advice?

  • IPhone 6 screen freezes even after updating iOS 9.2

    I read all the posts on the thread "iPhone 6 freezes after iOS 9 update" and tried ALL the options mentioned in the thread, including taking the phone to the iPhone "geniuses" (ha! What gumption) and after 3 months of running around they gave me, the

  • Impossible to update the BIOS, winflash.exe accidents

    I downloaded the tool to update BIOS update 1.19, but it crashes immediately when he launched winflash.exe. I'm plugged into the AC adapter and have a full battery. I'm on a x 220 running Windows 7 Professional x 64. Any help you would be much apprec

  • When I re-startup I get a message "no available boot device - HDD internal.

    Original title: start the problem. Recently, my computer hangs in.  Sometimes, when I re-startup I get a message "no available boot device - HDD internal. Can someone tell me what this means? (Doesn't look good!)

  • Add or change usertiles

    In the accounts user/change your account picture I don't like pictures of existing user.  Is there anyway I can add my own or change the existing?