Debugging of the callback functions

I'm fine with my comments?

Ordinary (unnamed) callback functions are all listed as (for example) onClick() in ESTK functions pane. In addition, local variables in these functions are not in the data browser. So in my humble OPINION of debugging is not possible.

So I tried the method with named callback functions that avoids these two disadvantages:

Callbacks without a name Named callbacks
myDlg.btn2.onClick = function() {
  $.bp(true);
  aLocal = "gugus";
  if (this.text == 'Disable Him') {
    this.text = 'Enable Him';
    myDlg.btn1.enabled = false;
  } else {
    this.text = 'Disable Him';
    myDlg.btn1.enabled = true;
  }
}
myDlg.btn2.onClick = ActButton2;
// ...
function ActButton2 () {
$.bp (true);
  var aLocal = "gugus";
  if (this.text == 'Disable Him') {
    this.text = 'Enable Him';
    myDlg.btn1.enabled = false;
  } else {
    this.text = 'Disable Him';
    myDlg.btn1.enabled = true;
  }
}
Œuvrant variable does not appear in the data browserVariable Œuvrant is listed in the data Explorer
The functions are named onClick in the functions paneFunctions have separate names in the functions pane
callback functions are within the window functioncallback functions (are) / (maybe) outside the window function

Of course, the names for the named callback functions must be unique for the script.

What version of FrameMaker do you use?

Now, I see your problem:

You can't do something like this:

wPnlN.p0.b1.onClick = Button1p (whatIsThis, outerParm) ;

Means: you cannot pass parameters to this function here. Otherwise, the function is executed immediately.

wPnlN.p0.b1.onClick = Button1p; // no brackets!!!!!!

Tags: Adobe FrameMaker

Similar Questions

  • leak memory with the callback function

    Hello

    I'm pretty new on LabWindows and library ninety, I worked mainly with LabVIEW.

    I am trying to create a basic c++ client (no GUI) that sets up subscriptions to several network publication of a PXI DAQ data variables.

    The data for each variable is sent in a cluster and contains different types of data with a 2D array large int16 for the acquired data (average size of array is 100 k in total, and the average time between the data being sent is 10ms). I have an average of 10 of these variables DAQ.

    I'm passing the same callback function as an argument to all of these subscriptions (CNVCreateSubcription).

    He reads all the correct data, but I have a problem is that I have a memory leak in the callback function in the CNVCreateSubscription.

    I have reduced the line of code one and found the function that actually causes the memory leak, it's a CNVGetStructFields(). At this point in the program data has not yet been adopted for the variables of the customers.

    It is a simplified version of the callback function, where I just unzip the cluster and get data (showing only a field in the cluster in the example, showing also doesn't not the decleration).

    The function is passed in the function to subscribe, as follows:

    public static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData);

    CNVCreateSubscriber (url.c_str (), SubscriberCallback, NULL, 0, CNVWaitForever, 0, & Subscriber);

    public static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData)
    {

    int16_t daqValue [100000];

    unsigned long int nDims;
    unsigned long int daqDims [2];
    CNVData fields [1];
    Type CNVDataType;
    unsigned short int numFields;

    CNVGetDataType (data, & type, &nDims);)
    CNVGetNumberOfStructFields (data, & numFields);
    CNVGetStructFields (data, fields, numFields); //<-------HERE is="" the="" problem,="" i="" can="" comment="" out="" the="" code="" after="" this="" point="" and="" it="" still="" causes="" a="" memory="">

    CNVGetDataType (fields [0], & type, &nDims);)

    CNVGetArrayDataDimensions (fields [0], nDims, acqDims);
    CNVGetArrayDataValue (fields [0], type, daqValue, daqDims [0] * daqDims [1]);

    CNVDisposeData (data);

    The average settings, I use all my memory systems (4 GB) in time.

    My question is, all else have experienced this and what might be the problem/solution to this?

    Thank you.

    I see that you disable only handle memory (data), but not the memory of the structure; Therefore, before calling CNVDispose (data) you should have something like

    While (numFields > 0)
    CNVDisposeData (fields [-numFields]);

  • How to get out of the callback function key before it complete the LabwindowsCVI

    Hi all

    In my program I use the command button (called SCAN) to analyze the setting on the serial port. When I press SCAN button callback fuction starts to send command on the series for the scan on the serial port setting. There are 99 order send and read. It takes about 3 minutes. It works very well. Now, I want to stop scanning and exit the callback function that is called by the button SCAN. Now when I press the SCAN button that it completes all 99 recommend and control then come to the interface user. So I'm not able to stop and get out of this loop. Y at - it a why to exit this loop if the user wants to get out? otherwise it will finish the scan.

    -Vishnu

    Hello

    I'll give you 3 options:

    1. If you want to go programaticly you can use simple break when stopping 'event' occur.

    2. If you want to go with a Cancel button, you can use this post:

    http://forums.NI.com/T5/LabWindows-CVI/few-general-CVI-questions-how-the-compiler-works/m-p/1440984

    where I already asked that it is not the recommended option for the panels.

    3. the best option is to use the multi threading separate each button in thread...

  • How can I build a dll containing that a callback function, the callback function is used in CVI.

    Hello

    Case is that LABVIEW receive external data and produce an interrupt, then sends the data to the CVI.

    Can I generate a dll containing a callback function, use the callback function in CVI. Or there is a better way?

    Thank you


  • Put in command button Mode loses the callback function

    NOR expensive.

    I have a code I want to change the buttons toggle robot (according to different scenarios). However, if I put the command Mode of the button disabling at VAL_INDICATOR or VAL_NORMAL for this button, the callback function ceases to be called when the button is pressed.

    What is the defined behavior?

    I use 8.0.1 (356) CVI

    Kind regards

    Brian

    Yep, the VAL_HOT did the trick.

    A big thanks to dsappet and jr_2005 for taking the time to investigate this.

    Much appreciated!

    Kind regards

    Brian

  • allows you to set the callback function to extension webworks

    I see in BBM webworks API, the callback function (blackberry.bbm.platform.onaccesschanged) is defined as a field variable, then call the register function.

    Is the only way to pass a callback to webworks?

    You can pass a callback function as a parameter to a function call?

    In my exercise, I tried to define an acceptable extension webwork function a ScriptableFunction as one of the parameters.  When I pass the function() {alert("test")} as an argument, the webwork expansion feature does not work. The debugger displays the webworks function is not called when I try to get to the function as an argument.

    June

    Hi June,

    A callback function right at the method as fact in good number of our API, you can actually pass. On the top of my head, take a look at the readFIle API. You can find the source of the code here - https://github.com/blackberry/WebWorks/blob/master/api/io/src/main/java/blackberry/io/file/ReadFileF...

    You should be able to move from the ScriptableFunctions back with no problems

  • incomplete documentation of the Callback function plans

    The third paragraph of (CVI2010) help with callback function plans says:

    The main callback function is the only type of callback function that responds to the EVENT_END_TASK. Windows only, this event occurs when the user tries to exit Windows.

    This information seems incomplete: EVENT_END_TASK also occurs if the program is closed via the taskbar button.

    Thanks, Wolfgang. We'll fix it.

    Luis

  • The callback functions control array?

    My apologies for my basic question.

    I'm experimenting with control arrays and so far able to collect data in controls of a string that is contained in the tables of controls.  Works well.  Of course, none of these controls need callback functions.

    Now, I need a few momentary controls in a control array as well.  So my question is, should I use a single callback for all button controls function in this unique table?  And if so, how can I do to determine which element in the control array called the function?  Reading the forums, it seems as if the use of the data parameter of the callback could happen to me.

    I just wanted to ask before we get off the track.  Thank you!

    Yes, callbackData can be useful in such a situation, but if you can limit to switch to array index to distinguish what to do the recall of your button might be something on this line:

    int CVICALLBACK BtnAttayCallback (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
    {
        int    handle, index;
    
        switch (event)  {
            case EVENT_COMMIT:
                handle = GetCtrlArrayFromResourceID (panel, control);
                GetCtrlArrayIndex (handle, panel, control, &index);
                switch (index) {
                    // Your code here
                }
        }
        return 0;
    }
    

    (No CVI install here so I can't test it: check the code, but it should work reasonably)

  • How to implement a callback to the help function call library function node in LabView?

    I try to call a fuction from a SDK.dll library by using the node call library feature. The SDK has been provided to

    me and I don't have the source code, just the .dll and .h files.

    The SdkSetPropertyEventHandler function has a function of recall as one of its parameters. How to apply the

    callback using the NSI node? I'm a good programmer LabView but this is my first time using the library to call

    Function node. I read all the info I can find on the web site of NOR and the discussion Forum, but can not understand

    This one out. I'm using LabView 8.6.

    The deacribes SDK.h function as:

    Function: SdkSetPropertyEventHandler

    (SdkSetPropertyEventHandler) SdkError SDKAPI
    SdkCameraRef inCameraRef,
    SdkPropertyEvent inEvnet,
    SdkPropertyEventHandler inPropertyEventHandler,
    SdkVoid * context);

    //
    Description:
    Registers a callback function to receive the status
    change the notification events for the States of property on a camera.
    //
    Parameters:
    In: inCameraRef - designate the object camera.
    inEvent - designated one or all the events will be completed.
    inPropertyEventHandler - designate the pointer to the callback
    function to receive the camera property-related events.
    inContext - designated application information must be passed
    way to the callback function. All the data necessary to
    your application can be passed.
    Output: no
    //
    Returns: A sdk errors.
    -----------------------------------------------------------------------------*/

    A separate header called SDKTypes.h file contains the following data:

    typedef SdkUInt32 SdkPropertyEvent;
    typedef SdkUInt32 SdkPropertyID;
    typedef void SdkVoid;

    typedef struct __SdkObject * SdkBaseRef;
    typedef SdkBaseRef SdkCameraRef;

    /*-----------------------------------------------------------------------------
    SdkPropertyEventHandler
    -----------------------------------------------------------------------------*/
    typedef SdkError (SDKCALLBACK * SdkPropertyEventHandler))
    SdkPropertyEvent inEvent,
    SdkPropertyID inPropertyID,
    SdkUInt32 inParam,
    SdkVoid * context);

    Thanks for your help.
    Alejandro

    Andrew_E wrote:

    Hi Rolfk,

    You are absolutely right. This article describes what you were talking about? I'm just trying to get as much information as possible on this thread if the solution is easier to find for the future. Thank you.

    Yes, but I find the idea of using .net to call a LabVIEW VI as callback function C a bit as using a roll of Steam ironing your pants. Why do it? Well the steamroller has extra security guards that make it less likely that you'll break your pants in the process, but it's not elegant IMHO.

    Write a C DLL that translates between a C callback and a user event LabVIEW using the PostLVUserEvent() of the interface of the kernel to run LabVIEW function seems so eleganter for me. Yes, it's a bit of programming in C, but good!

    Rolf Kalbermatter

  • How to change the callback of a GUI button function?

    I would like to change the callback function associated with a GUI button dynamically in the programming track.

    Here is the piece of code that I tried, but it doesn't seem to work:

    const char * pstrLabelSaveJpeg = "SaveJpegCb";

    SetCtrlAttribute (pahel_id, ctrl_id, ATTR_LABEL_TEXT, pstrLabelSaveJpeg);

    int CVICALLBACK SaveJpegCb(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);

    The attribute that you used is the 'label' of the button.

    It is only an appearance attribute. You can write your own name on it, but this does not alter the callback function.

    You must change the ATTR_CALLBACK_FUNCTION_POINTER attribute, and you shall not take the name of the function as a string.

    If your function call will look like this:

    SetCtrlAttribute (pahel_id, ctrl_id, ATTR_CALLBACK_FUNCTION_POINTER, SaveJpegCb);

    Of course, you must declare the function SaveJpegCb somewhere above this line.

    I think you have already done this.

  • How to run progamatically of callback functions

    Title says it all.

    I want to execute a callback to a command by programming button. How is that possible?

    Hello

    It's pretty simple: you call the callback function...

    For example, if it is defined as an int CVICALLBACK QuitCallback (int command face, int, int event, void * callbackData, int eventData1, int eventData2)

    You can call the function as QuitCallback (Panel, control, event, callbackData, eventData1, eventData2), where you will need to use the appropriate panel and control the ID. For the event, you can provide the type of event you want to simulate, for example EVENT_COMMIT. If you do not need a callbackData, eventData1, eventData2, you can specify zero. In summary:

    QuitCallback (panel_ID, control_ID, EVENT_COMMIT, 0, 0, 0);

    Wolfgang

  • CALLBACK functions in cvi

    Hello

    Need a simple clarification on the use of the callback function.

    I have 3 function keys different as reminder starting test, brake test, quit smoking.

    Whenever the start test button is pressed by EVENT_COMMIT, he asked some functions and performs the same. in the middle of the execution of this function, I need to stop the test by pressing the stop test button or I leave the interface. How can I do this?

    I am facing problem like once I press the Start button, that I get another button controls until all the functions available on the inside button start is filled.

    Thanks in advance

    Sleep (1000) and not to call ProcessSystemEvents () are the reasons!

    1. Sleep () completely blocks the program until the time has expired. It is recommended that you don't call him for long intervals!
    2. If you do not (ProcessSystemEvents) you cannot have a stop button

    Try to change the code this way:

    int requestToStop;    This set at the module level

    int CVICALLBACK Btn_Start_Test (int, int int event, control panel,
    void * callbackData, int eventData1, int eventData2)
    {

    switch (event) {}
    case EVENT_COMMIT:

    requestToStop = 0;    Clear the flag to stop and start the test
    If (Tree_getselectedChilditems())

    MessagePopup ('Info', 'operator stopped the test!');

    on the other
    MessagePopup ("Info", "TEST COMPLETED successfully");
    break;
    }
    return 0;
    }

    int btn_stop_test (int, int int event control panel CVICALLBACK,
    void * callbackData, int eventData1, int eventData2)
    {
    switch (event) {}
    case EVENT_COMMIT:
    requestToStop = 1;
    XL_KillWindowsProcess ("EXCEL." EXE"); not exactly excel file, it can be any file that is currently running
    break;
    }
    return 0;
    }

    int Tree_getselectedChilditems (void) //double testcaseno)
    {
    int noOfItems; int val, I have;  int index;
    int noOfChild, index = 1;
    char treelabel [500] = {0};
    char charval; char TCno [100];
    Select int;  char testno [100] = {0};

    tini double;

    for (error = GetTreeItem (panelHandle, PANEL_TREE, VAL_CHILD, 0, VAL_FIRST, VAL_NEXT_PLUS_SELF, VAL_MARKED, &index);))
    index > = 0 & error<=0;error =="" gettreeitem(panelhandle,="" panel_tree,="" val_all,="">
    (index, VAL_NEXT, VAL_MARKED, & index))
    {
    GetTreeCellAttribute (panelHandle, PANEL_TREE,
    index: 0, ATTR_LABEL_TEXT, treelabel);
      
    Scan (treelabel, "%s", TCno);
    strcpy (testcaseno, TCno);
      
           
    Sleep (1000);     Replace this line with the following code
    tini = Timer ();
    While (timer() - tini)< 1.0)="">

    ProcessSystemEvents ();

    If the breach (RequestToStop);     The operator are

    }
      
    readTestcasesheet (ExcelWorkbookHandle, ExcelWorksheetHandle, testcaseno);
    Fmt(treelabel,"%s","");

    If the breach (RequestToStop);     Judgment of the operator
    }
     
     
    Return requestToStop;
    }

  • Clientdata bad pointer in a callback function

    Hello

    I'm trying to pass a data object to a callback function when the load a document.

    This is my code:

    AVAppRegisterNotification (AVDocDidOpenNSEL, gExtensionID, ASCallbackCreateNotification (AVDocDidOpen, (void *) myNotificationCallback), (void *) & aClientData);

    The callback function is the following:

    ACCB1 Sub ACCB2 myNotificationCallback(void *clientData)

    {

    ....

    }

    However my address pointer in the callback function clientData is not the same as the address when I put it in the AVAppRegisterNotification function.

    How is that possible?

    Consider, for example: the recall will need to know what AVDoc is just opened, which is not possible if the only parameter is clientData.

  • Different types of EventListener, same callback function?

    I'm doing so that the user can press any key or click anywhere to continue. I want my KeyboardEvent and MouseEvent listeners have the same callback function to continue, but it won't work because the callback function must have the right kind of event as an argument. Is it possible to do with a reminder function? I can do it with two.

    You can use the event rather than specify keyboardevent/mouseevent in the argument of functions.  then in the body of function test what type of event is received and cast if you need:

    function yourlistenerF(e:Event):void {}

    If (e is KeyboardEvent) {}

    You can use KeyboardEvent (e) .keyCode etc.

    } else if (e is MouseEvent) {}

    You can use MouseEvent (e) .mouseX etc.

    }

    }

  • Access the value of an another file callback function

    I have a callback function, where to get the current value of a control in a main.c.

    GetCtrlVal (panelHandle, PANEL_RINGSLIDE_1, &p);
    

    I have another file (test.c) in the same folder. I need to use the value of & p in the file test.c. How is that possible?

    I have understood #include main.c in the file test.c but not working.

    Any ideas?

    In applications that use multiple source files, it is advisable to have a set of common definitions that covers all of your project. So, for example, you could have a "common.h" file, which is #include'd files test.c both your main.c. In this file common.h, you might have a statement:

    extern int p;

    This indicates to the compiler, for each of your steps in compilation of file c, the variable p is defined somewhere else and do not worry about this. Now, in a few of your .c files (not really matter which), you then have to declare the real variable p:

    int p;

    So now, when you reference an upside in one of your modules, you refer to the same variable across the whole project. (It is probably best to use a longer, more descriptive name for the variable instead of just p - this avoids possible confusion as your program grows in complexity).

    JR

Maybe you are looking for

  • Pavilion HP G62: ERASE win7 home reinstalled win7pro 64 32

    Try to clear win 7 home 32 bits without success I have change my hard drive the a collapst old. Win 7home was istall by hp what is the procedure to remove the 32-bit reinstalled win 7 pro 64-bit

  • 11 s no sound

    Help one day I just opened my yoga 11 s and there suddenly without its good I play an mp3 file or play on a youtube video It has been over a month now

  • HPOfficeJet Pro 8630: Scan to network folder fails

    I have recently reinstalled Windows 7 without password on my computer, although the previous installation did use a password. Now I can not scan to network folder (error message that the user name or password is incorrect), or save faxes on my comput

  • This new facility, remove programs with add/remove program?

    I will upgrade to Windows 7 from Windows xp and need to do a clean install.  My question is can I remove all the programs with the Add/Remove program?

  • HP Scan and print doctor &amp; HP printer Install Wizard freezes

    My HP Officejet Pro 8500 A A910a model works for a year, but recently stopped wireless printing. I am considering a software problem, probably the drivers, because I could spend and print correctly the diagnosis of HP utility hardware test page. I do