CVICALLBACK, name of constant

Hello

I stated a same callback function (edit control< call="" back="" function)="" for="" few="" controls="" (x,y,z)="" in="" the="" *uir="">

am able to run the same callback function when the command is pressed. but I can't find what kind of control is operated (x, y or z)

Please suggest a solution

concerning

Phani

switch (command) {}

case PANEL_COMMANDBUTTON:

break;

case PANEL_NUMERIC:

break;

... and so on

}

Tags: NI Software

Similar Questions

  • How to set the name of resource VISA as a constant?

    I'm properly communicates with a device series using ModBus. The drop-down list on the front displays correctly COM3. I would like to remove from the drop-down list and set default COM3 on the block diagram. Can someone tell me how to do it please? Thank you very much

    Hello

    Right click on this drop-down list and select replace by, constant...

    So you can see the name of constant of Visa on the block diagram and no need to pull down...

    Pals

  • How to get the name of the control rappelling, fucntion

    in my sampleGUI.h it has this value

    PANEL_LOGO 60

    ...

    I have a callback as function below:

    sample CVICALLBACK int (int Panel, int controlID, int event, void * callbackData, int evenData1, int Data2 event);

    The controlID value is 60

    In this callback function, how to get back the name of constant PANEL_LOGO?

    Thank you

    Thank you, Luis

  • How do I get the name of a duplicated or created control and add a reminder

    Hi all

    According to the number of entry points I need, I duplicate a digital or an input string to the DuplicateCtrl function. My question is, how do I get the name and id of the control that has been created, and how can I assign a callback to it? Alternatively, it would be better to create a fresh ctrl instead of duplicate?

    Thanks in advance!

    Hi TurboMetrologist,

    Why are you trying to get the name of constant control? Remember that you cannot use this name to address control; control names are in fact simply the macros in the file associated with the UIR, include in other words, the preprocessed compiler code and everywhere where the names of PANEL_CONTROL replaces the digital value as parameters to functions (and therefore 'control' parameter is an int value and not a char *)

    That's why NewCtrl () or DuplicateCtrl () functions return a control ID: this is the handle to the new object, the only way to handle it. You will need to store this handle in a nonvolatile memory so that you can access durng life program.

    In addition, there are other ways to assign a meaning to a control to pass on the name of constant control. For example, you can use the callbackData parameter to differentiate the different copies of a control.

    Let me explain with an example. You said that you need several entries (dynamically created that you don't know in advance how many of them use); a solution could be:

    • Design a master copy of a control in the IUR Editor, where it is easy to customize; also assign a callback function, if it must be common to all copies of the control
    • Assign a value to this control callbackData, programmatically for example SetCtrlAttribute (...,..., ATTR_CALLBACK_DATA, (void *) 1);
    • Duplicate the control, and then assign a different callbackData
      for (i = 2; I have< 5;="" i++)="">
      handle = DuplicateCtrl (...);
      SetCtrlAttribute (..., handle, ATTR_CALLBACK_DATA, (void *) I);
      }

    By operating this way, whenever the reminder of control is triggered by any control, it will receive the callbackData assigned, and you will be able to differentiate your code with a simple switch:

    switch (callbackData (int)) {}

    case 1: / / the master controls

    break;

    case 2: / / first dual control

    break;

    }

  • SQL dynamic update shape names

    Hi all

    Using CFloop update SQL table with two or more records.

    This page prints invoice Subscriber user.

    GRAPHIC INTERFACE;

    CFOUTPUT QUERY = "PT".

    A HREF = "" PtDemo.cfm? bill_id = #PT.bill_id # "target ="_self"> #subscriber #"

    TD align = "center" > #ptnum #.
    TD align = "center" > #re #.
    TD align = "center" > < font color = "# FF0000" > #phone # < / make >

    < cfset ptamount = 0 >

    < td align = "center" >$ < color = "# ff0000" > #ptamount # < / police > < table >

    < td align = "center" > #psdate # align = "center" > #peDate #.

    < color = "# FF0000" > #TV # < / make >
    $ < color = "# ff0000" > #ttamount # < / make >

    THE QUANTITY FIELD BELOW IS THE AREA IN NEED OF UPDATE IN SQL
    input type = "text" name = "amount" value = "#tBilledAmount #"

    input type = "Checkbox" name = 'bill' value = "" #bill_id # ""

    < / CFOUTPUT >

    FORM HANDLER

    < cfset pdate = dateformat (now (), ' mm/dd/yyyy') >

    CFSET billedVar = "O" >
    CFIF isdefined ("form.bill") >
    cfoutput

    CFLOOP INDEX = 'isid' LIST = "" #form.bill # ""

    < cfquery name = "prcPna" datasource = "wCast" >

    billing update

    the invoiced value = 'Y', billed_date = ' #pdate # ', amount = ' #form.amount # ', paid = 'y', paid_date = "#pdate #

    where bill_id = #bill_id #.


    < / cfquery >


    <!-< cfoutput > #form.bill # < / cfoutput > amount = ' #form.ptnum # ', ->
    < / CFLOOP >

    < / cfoutput >
    < / cfif >

    Using the loop of the list, I can update the table with the field names are constant.

    I need to update the amount calculated with;
    input type = "text" name = "amount" value = "#tBilledAmount #" this will create a list; (#tBilledAmount # ex: "10,11,12")
    OR
    input type = "text" name = "" #amount # "value =" #tBilledAmount # ", this will display"unknown domain name""

    All the ideas will help.

    Thank you
    T Jones

    I just do a presentation about it at my local CFUG. It's thin, but not exactly your scenario.

    Shows another use of the rating table. The scenario is the the user sees a bunch of files and can add a date to one of them. This will update the db table.

    On the form page.


    Select id
    of sometables
    where everything what




    etc.

    On the action page





    Update SomeTable
    set SomeField =
    where TheIdField =

  • An array of strange command error

    Code of the model (from help document):

    GetNumCtrlArrayItems(ctrlArray, &count);)
    for (i = 0; i
    SetCtrlVal (panelHandle, GetCtrlArrayItem(ctrlArray, i), I have 2%);

    My Info to user interface:

    I would define 2 control, here is my Panel arrays and tables

    My OK button call return code:

    int CVICALLBACK (int, int control, int event Panel Ok,
    void * callbackData, int eventData1, int eventData2)
    {
    int, temp_control, County;
    switch (event)
    {
    case EVENT_COMMIT:
    GetNumCtrlArrayItems(CTRLARRAY_2, &count);)
    for (i = 0; i
    {
    temp_control = GetCtrlArrayItem (CTRLARRAY_2, i);
    ResetTextBox (panelHandle, temp_control, "test");
    }
    break;
    }
    return 0;
    }

    Here's the problem:

    I want to change the text in the text box, as defined by the control array, we should call it

    GetNumCtrlArrayItems (CTRLARRAY, &count);) and GetCtrlArrayItem (CTRLARRAY, i);

    but, when I click on ok, funtion GetNumCtrlArrayItems back-4.

    And, I use CTRLARRAY_2 instead of CTRLARRAY, when I click the ok button, the result is like this

    Who can explain this to me?  Is this a bug of Labwindows/CVI 2013? Thank you very much.

    As you can read in the help, you do not use the name of constant control in this function; Instead, you must call GetCtrlArrayFromResourceID to obtain the handle to be used in the following functions on this component.

    The error you receive correctly indicates invalid handle.

  • Replace all in Script DIAdem

    Hello

    I have several scripts that do some jobs. In each of them, all I want to do is change a few channel names. Can I change the name of each channel individually by pressing Ctrl + F to bring up the dialog box find and replace and selecting replace with - replace all. Anyone know if I can do it manually the same functions as Ctrl + the function F of the script editor?

    Thank you

    Hi Kevster,

    I would have said that using script IS keyboard manual drafting.  But it seems that what you should do instead uses some variables of channel name instead of string for the name channel constants.  Then you would have a place in your script (usually on top) where each channel name string is assigned to the variable of channel name - this one short spot in your script will be super easy to modify.  The rest of your code will use the variables name of channel instead of string constants and must never be changed.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • data transmitted from dequeue function measure file incorrect

    Hello

    I'm under Labview Base 2013 and have a vi that reads data from a RS232 port and a digital port OR-USB6002.  I decided to split the loops in consumers/producers, using the functions of the queue, but ran in four snags with the loop of data recovery.

    (1) the digital pulses are displayed correctly in the USB Signal loop, but the recovery loop data does not display data RS232,

    (2) combined in the loop of data recovery in the file of measurement data to write, but are not properly separated in their columns, i.e. a column is displaying data or loops

    (3) stop button is throwing error 1, incorrect path

    (4) thumbs real control when it is plugged into the loop of data recovery and in signals combine to measure file causes the vi runs correctly.  It runs but does not display the data in the tables on the part of the loops and no data is written to the file of measures.

    I added an indicator in the loop of RS2323 and it appears the data correctly on the front panel, but does not appear in the graph.

    I am able to run this vi without the functions of the queue and simply write data files of two separate measures, but these are forces me to synchronize the data set later.  Not quite what I need.

    Image attached vi.

    Thoughts?  Will be streaming to TDMS work better to keep separate data streams?

    You think that you have two queues, but you don't actually have.  You named your queues with the same name, so they are the same queue.  So you have race conditions including dequeue will get the data.  Just remove the string names for constants, and it should work perfectly.

  • SetCtrlVal on "control of the string" request execution 'int' data

    Hello

    We at KPIT Cummins use LabWindows for one of our automotive projects. We have a GUI with multiple tabs and one of our boxes of string text is emerging the error (also attached jpeg) below.

    FATAL ERROR: 'Temp.c', line 2642, col 38, id thread 0x00000F4C: invalid argument type: found "pointer to char", should "int".

    We tried to debug this project, and we believe that the line which gives us a question is:

    ret_val = SetCtrlVal (h_Tab_Intgd [INTGD_CFG_DATA_TAB], INTGDTAB_ACCXSCALE, aa_uc_Temp_Array);

    where,

    h_Tab_Intgd [INTGD_CFG_DATA_TAB] is an array of handles of the form (stores all handles to the tabs)

    INTGDTAB_ACCXSCALE is the name of the string object (exactly the name of constant as it appears in the file .h created constant LabWindows GUI)

    aa_uc_Temp_Array is an array of characters. ("0.000000\n" which currently occupies)

    There is another form in our code with similar functionality, but with a different constant ID... and the SetCtrlVal seems to work for this form. We do not understand why it gives an error of execution for this particular form.

    The code in this project is a big piece of code, and we cannot currently share the project because of a confidentiality clause. You can help us find exactly the problem with what little information shared us?

    Thanks for the snippet of code... the error was in the tab page handles... we are grateful for your help.

  • Make a right click table

    Hello

    I am trying to set up a "right-click menu" on a table with menu items associated with the cell (or at least the line) where the right click was hit.

    For example, two of the menu items will be 'Add a new line after' and 'add new line before '.

    For this reason, I have to get the cell (or at least the line) x and are position numbers where the click is affirmed. I tried to change the example that can be found here: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E8FF56A4E034080020E74861&p _...

    without success. It works very well with the left click, but not with the law.

    Please also note that I got how to hide the built in menu items right associated with a control table and how to insert mines with the respective functions. What Miss me is just how retrieve the cell coordinates in the table after a right click on it.

    Thanks a lot for your suggestions.

    Marco

    Ah, I see!

    Well, the ID to pass to RunPopupMenu is the combination of the prefix constant bar menu and the name of constant menu highlighted in the editor Panel:

    So in this case you pass Menu_smp the function to programmatically display the menu.

    I'm not laughing because I had some problems to identify the correct id to use when I started to use this feature.

    Greetings

  • knowledge of the limited definition

    Hello

    I just discovered the following problem with the IDE: CVI provides a nice feature "Go to definition", surprisingly it seems to not always work...

    The test scenario: in the call to viFindRsrc (), I tried the following regular expression:

    "ASRL? * INSTR {VI_ATTR_ASRL_WIRE_MODE == VI_ASRL_WIRE_232_DTE |} VI_ATTR_ASRL_WIRE_MODE == VI_ASRL_WIRE_232_DCE | VI_ATTR_ASRL_WIRE_MODE == VI_ASRL_WIRE_232_AUTO}.

    It did not work as expected so I started debugging; right click on VI_ATTR_ASRL_WIRE_MODE with going to definiton correctly jumped into the right line of the visa.h file.

    As expected. However, to do the same thing for, for example, VI_ASRL_WIRE_232_DTE does not work, although this definition is found a few lines below the definition of VI_ATTR_ASRL_WIRE_MODE.

    So I thought it could be a typo and cut/pasted the name of constant since the include file, same result.

    Somehow, go to definition doesn't seem to work in these cases.

    I'm doing something wrong?

    Hello Wolfgang,.

    ICB does not generate browse info of macros that are not referenced.

    For example, if you have

    #define MY_MACRO 1

    No info browse for MY_MACRO is generated. But if you have

    #define MY_MACRO 1
    ...
    x = MY_MACRO;

    then browse info is generated for MY_MACRO.

    In your example VI_ATTR_ASRL_WIRE_MODE and VI_ASRL_WIRE_232_DTE are part of a chain, no references for these macros.

    I assume you are using in your code that does Browse beeing of information generated for her but not for VI_ASRL_WIRE_232_DTE VI_ATTR_ASRL_WIRE_MODE somewere.

    Constantin

  • two two signs calling even third round table

    Hi there, I'm designing a new application.  I have two main panels, each displayed on a single PC monitor.  I have a third panel that displays detailed data common to both of the first two panels.  This third panel is a Panel, such that it must submit its fields updated in the Panel of the appellant.

    I prefer open this same third panel from the first two panels.  But to do this, I need to know which of the two panels opened the third.

    How would I go to do this withouth making a global variable?  This would be a case of use callbackData?  If so, I'm not clear how to on this subject.

    Hi ElectroLund,

    I see a problem in your code.

    In the reminder of the appellant, you set the callbackData Panel.

    This means that, in a reminder of command, you should retrieve this value, which is different from the callbackData command you receive in the callback. To recover the callbackData Panel you must do something like this (I have no installation CVI for now to test):

    void  *cbkd;
    
    GetPanelAttribute (panel, ATTR_CALLBACK_DATA, &cbkd);
    if (cbkd) {
      // The panel has some callbackData installed
    }
    else {
      // No callbackData installed on the panel
    }
    

    Finally, comparing callbackData value (that you set for a simple '1') of PANEL_1, which I assume is a name of constant sign is not good: PANEL_1 can be equal to '1' by accident and this can change if you change the order of z-plan of the panels.

  • context menu

    Hello

    I'm trying to create a menu popup that popsup on a right click on a Panel.

    I created the menu in the editor IUR

    I checked the .h file associated with the file .uir that I found here:

    #define POPUPMENU 1
    #define POPUPMENU_TEST1 2 / * callback function: PopUpMenuCB * /.
    #define POPUPMENU_TEST2 3 / * callback function: PopUpMenuCB * /.

    I load the menu and get a value valid in "PopUpMenuHandle".

    PopUpMenuHandle = LoadMenuBar(0,"MyUIR.uir",POPUPMENU);

    When later I try to run the menu of

    RunPopupMenu (PopUpMenuHandle, POPUPMENU, 0, 30, 60, 0, 0, 0, 0);

    I get a runtime error-40 "the id passed was not a valid menu code."

    If I pass the panelhandle where I call RunPopupMenu() the result is the same

    Thanks in advance

    In the menu editor, you set the constant prefix in the CONTEXT menu, ok.

    THEN press the button "Insert an element" and set it in this way:

    Name of constant = MENU

    The element name = Menu 1

    No reminder

    THEN, press the button "Insert a child element" and then set the element in this way:

    Constant name = TEST1

    Name of the item = Test 1

    No reminder

    After that, you can run RunPopupmMenu from POPUPMENU_MENU as the ID of the menu.

  • Re: Reading data from a data packet

    We didn't find a driver for our instrument as we try to enter the data using the method I explained before. Here is an example of the data packets we receive in our serial port monitoring software.

    First data packet 13 88 04 4 00 00 01 00 00 7 b 37 02 EE F3

    Second data packet 13 88 04 EE 4 00 00 01 00 00 79 D9 02 EE

    Third package of data 13 88 04 4 00 00 01 00 00 78 BA EE 02 EB

    Here, as we have seen above 13 88 (5000 = frequency in decimal) 04 4 (represents1100 = voltage in decimal) is constant and the endpoint is represented by 02EE.  Put apart is the rest (for the first package 01 F3 = 499 asuuming current and 7 b 37 = 31543 its seizure of power continues to change now in each package and they all have a different scaling). The 00 00 just represents the filling between them. Now we read the values in value mean in different boxes and produce them in LabVIEW front pannel. Here, I have attached a picture of the instrument for reading side by side with the monitoring series reading software. How do I do that? I read something called visa read and write but they only accepts strings, not in bytes. Any kind of help is appreciated.

    gvcjgzj wrote:

    I've read that something called visa read and write, but they only accepts strings not in bytes.

    I don't understand what you're trying to say here. The strings ARE bytes!

    Apparently, you read the 14 byte strings. Easier to analyze would be type conversion, because your data is already big-endian. (cutting the chain as suggested above seems tedious).

    Here's a quick example that includes the padding assuming current I32 and power. To read them as I16, add two of the elements of the cluster and make all 16 bits and make sure that the cluster command is correct. Use obvious names for constants. Most likely, you need to do a few other adjustments. Also for other values, you need to know if they are whole signed or unsigned.

    Of course, that you can access individual data to aid ungroup by name... For example, I graph current vs power on a xy chart. An entry is an array of strings, one element for each line.

  • Add more dynamic events registration refnum

    Hello

    I have a wire that passes Event Registration refnum to my structure of the event. This thread is from VI, that I don't want to touch. He spent recording for the cluster of user events.

    I would add more dynamic events to the refnum (but not to the cluster), so I would like to re-record with the addition of new events.

    When I'm passing this refnum to block 'Register for events', LabVIEW does not allow me to expand this block and add new events, which I think is understandable.

    How can I add more dynamic events to the refnum?

    Close, but no cigar.  When you add user events, you want to be sure that every event has a unique name, then name your constants defining the events differently (as shown here).

    Bob Schor

Maybe you are looking for

  • How can I access Siri on my iMac without using the icon?

    How can I access Siri on my iMac without using the icon?  Can I say "Hey Siri"?

  • How can I reinstall MS OneNote2003 after installing Vista?

    Hello everyone, I was a bit confused of the 'ExpressUpgrade' action, because I first thought I would geta DVD-Windows Vista upgrade, but as I can see in ModusLink he is named "Windows Vista Home Premium 32 bit DVD"... OK, it's done now, but that's wh

  • Time to repair guaranteed in Poland

    I would be grateful for any info on Toshiba political about guaranteed repair times. Their service company licensed in Poland kept my A300 for 3 weeks and keeps telling me to wait a few more days. Y at - it any policy of Toshiba set only if they are

  • HP Zeen: HP Zeen battery bulging / explosion

    Hello I'm having a problem with my HP zineb (tablet to the HP eStation printer) where the internal battery has expanded/bulging/exploded causing the support zineb to go out and make the unusable Zeen. This problem has been identified in this other po

  • Satellite L300D (PSLC8C-06T01R) - upgrade of BIOS 1.80 stopped my wireless

    Ok. So, my fan was going constantly at high speed, and I know that the BIOS upgrade is a fix for this. So, I updated my BIOS to version 1.80, who on the site Web of Toshiba for my model, says that it is for all models of L300D. The update went well a