Callback function for network events

Hi all,
I'm working on a project, and I need to be able to respond to network events. I receive the data through a BufferedInputStream from a socket. What I want is a callback-type thing, i.e. When new data is sent to the socket, a function is called to receive that data. I've looked through the documentation, I can't find anything that could be used for that. The only thing I can think of is linking it to a JTextArea/JTextField, and attaching a change listener to that, but I'd prefer not to have to do that. My current method involves a loop, which I don't like at all:
while (true) {
if (server.Available()) {
do stuff here
I don't like it because it wastes processor cycles that really should go elsewhere. So what can I do?
-ReKleSS

When you read from a socket and there is no data available, it just blocks until something does become available. While the thread is blocked waiting for I/O it won't take up any processor time.

Similar Messages

  • Anonymous callback function for JSValue callWithArguments:

    Hi, I'm trying to create an iOS7 app using JavaScriptCore, where the core of app is written in JS (which communicate with API). The problem is, I can't get to work anonymous callback functions. Is something like that even possible? Simplified example code below:
    .js
    function getArray(errorCallback, successCallback) {
         loading = api.getArray();
         result.waitOnSuccess(loading, function(list) {
              return successCallback(list);
        result.waitOnError(loading, function(error) {
              return errorCallback(error);
    Obj-C
         JSValue *getArray = _context[@"getArray"];
         [getArray callWithArguments:@[^(id error) {
              NSLog(@"%@", error);
         }, ^(id success) {
              NSLog(@"%@", success);
    I know I can do this, when I map native methods to JS context, but I would really like to do this anonymously. Thank in advance.

    1: Please explain what is happening, how, when and where you got this error. We need details to be able to help.
    2: Please do not paste straight into the original message, use PasteBin or other pasting websites when asking for someone to check an error code etc.

  • Callback Functions for the Enterprise API

    I'm using VB to write some API functions to pull journal detail from Enterprise 6.0, but having trouble with the callbacks. I did find some syntax errors in the toolkit.bas file, correct those and am able to pull specific data points, but the enum functions just crash. Because the documentation is scetchy at best, I'm not sure if my functions are wrong, if there are other syntax errors in the .bas file or if the dll's are corrupt.<BR><BR>I'd really appreciate some help from someone who has experience writing callback functions to the Enterprise API.<BR><BR>Thanks in advance.

    Hey there...
    I think part (if not all) of your question can be answered by abstracting it a level. Think of all the tools that are available through PL/SQL or JAVA in the database. For instance...
    * Heterogeneous Services that allow you to access any ODBC/JDBC data source directly from within the Oracle database.
    * DBMS_JOB that allows the scheduling of jobs to run at a given time/interval.
    * DMBS_FILE_UTL that allows Oracle to interact with the file system.
    That doesn't even take into account the things you can do with Java in the database.
    In short, just about everything you mentioned can be done in one shape or form with tools that reside in or around the oracle database.
    HTMLDB is a front end interface tool that has access to all of the tools available to you at database level.
    So in short (and in my opinion): Yes, it is capable of creating Enterprise level applications. I'm building a fairly complex one right now that interfaces with 2 external (non-oracle) databases via Heterogeneous services, and which used DBMS_JOB to schedule jobs to collate data from an external file system.
    I hope this helps..
    Doug Gault
    TXI

  • Callback function for addtocart()

    Hi everyone,
    I need to setup a callback function after addtocart(). Is there a way to do this?
    Thanks.

    Official one coming soon. You would have to override the addtoCart with your own currently (Standard overriding of javascript functions method)

  • Callback functions to handle events for a specific system build block

    I have two questions about customized event handling in Systembuild:
    1- The SystemBuild Utility "sysbldEvent" can bo used to specify additional actions for the "openblock" and "navigate" events. However, it will be applied to all systembuild blocks.
    Is there a way to limit its scope to a specific block or block type?
    This has been done for the Altia block (which is a customized UCB block) - a double-click will open a special dialog box. Is this feature implemented using publicly available systembuild features or there are other special features used?
    2- Is there any way to assign callbacks to other type of block events: copy, paste, etc ...
    Thanks.

    Farshid,
    There are a couple of options for creating custom dialogs/blocks.
    SysbldEvent can be used. As you noted it will generate and event for all the blocks. You can not generate an event only for a specific block. However the Xmath function has two values sent to it. One is the type of event (blockopen or navigate) and the blockId. You can use blockId together with SBA commands to find out which block generated the event. If it is a block that you are not interested in then return 0 and SystemBuild opens the normal dialog. If it is the right block then you can open your own dialog or perform what ever action is needed. Finally return a 0 if you want SystemBuild to still open the normal dialog, or you can return 1 and no dialog is opened.
    The Altia
    block is a custom block. It is a standard UserCode block that has been customized to have differnt default parameters and different icon. In the SystemBuild editor (not catalog browser) select a block and the go to Edit>New Custom Block. The custom block can a have a MathScript function associated with it that gets called when the block is created. For more information on custom blocks see chapter 18 of the SystemBuild Users Guide (Help>Search MATRIXx Bookshelf from Xmath).
    The final method is creating a component. For a component percent vars can remain internal or they can be available to the user. You can also provide a different set of parameters that are available to the user, and then provide equations for how they map to the internal percent vars. Information on Components is in Chapter 17 of the SystemBuild User's Guide.
    Carl L
    National Instruments

  • Create Callback VI for IMAQdx Event - Broken Wire

    My application is using IMAQdx to communicate with a Basler camera. When my camera is triggered with a digital trigger, it sends out an event when exposre finishes. I can use this event to know when to grab an image.
    I have a working VI that uses an event structure to handle this event and pull the image. Using an event structure in my main application will not work for my arcitecture, though, so I need to do a callback VI upon event generation.
    I have been trying everything to get a callback VI to work, but it seems LabVIEW thinks that the callback VI doesn't match the input to the "Register Event Callback." I have tried everything ranging from making my own VI to match the exact inputs to just using "Create Callback VI" by right-clicking. No matter what I do to the VI, there is a broken wire.
    See attached VI's. The callback VI is unnecessary because it is just a blank VI that was generated.
    Any help with this would be highly appreciated!
    Thank you,
    James
    James
    LabVIEW Professional 2014
    Attachments:
    Callback VI.vi ‏8 KB
    Initialize Camera Triggering.vi ‏24 KB

    It looks like your code is looking for a TypeDef called CtlRef.  I don't know if this is part of the IMAQdx spec, or something you need to provide, but providing it should get rid of the broken arrow.

  • Use event function for multiple events

    I've got several movieclip buttons on stage. For one of those buttons I've started of with:
    button1.buttonMode = true;
    button1.useHandCursor = true;
    button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
              button1.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
              button1.stopDrag();
    Which works. But I would like to have that fl_ClickToDrag function excuted for all my other buttons too, so I don't have to duplicate that several times for each button. So I thought I use something like:
    button1.buttonMode = true;
    button1.useHandCursor = true;
    button2.buttonMode = true;
    button2.useHandCursor = true;
    button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    button2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
      event.target.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
      event.target.stopDrag();
    But that gives an error. What's the correct way?

    Actually I got it working by using:
    button1.buttonMode = true;
    button1.useHandCursor = true;
    button2.buttonMode = true;
    button2.useHandCursor = true;
    button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    button2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
      event.currentTarget.startDrag();
    stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
      stopDrag();

  • Standard ABAP functions for creating events?

    Hi,
    I'm a little bit confused which ABAP functions to use for creating academic events with schedules (e.g. lecture takes places each Friday at 4 pm), rooms and instructors attached.
    Data transfer documentation SAP team recently released ("SLCM Data Transfer" archive, "Intro" document, page 18) suggests <b>HRIQ_CREATE_EVENT</b> as a solution. However, after experimenting for a while, I noticed a note attached to this function that "DO NOT USE ANYMORE, USE <b>HRIQ_EVENT_CREATE</b>".
    So which one is the correct/recommended one? Also, if possible, I would prefer an RFC-enabled one.
    Thanks
    Janek

    Hi Janek,
    We've created a custom RFC enabled function module to wrap the SAP function module HRIQ_CREATE_EVENT in.  We are on a 4.7 system.  Here is our code.  Hope it helps.
    FUNCTION zcep_event_create .
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(VTASK) TYPE  HRRHAP-VTASK DEFAULT 'V'
    *"     VALUE(EVENTPACKAGEID) TYPE  HROBJID
    *"     VALUE(ACAD_YEAR) TYPE  PIQPERYR
    *"     VALUE(ACAD_SESSION) TYPE  PIQPERID
    *"  TABLES
    *"      MEETING_PATTERN STRUCTURE  ZCEP_MEETINGPATTERN
    *"      EVENT STRUCTURE  ZCEP_EVENT
    *"      RETURN STRUCTURE  BAPIRET2
      DATA: is_schedule TYPE bapisched,
            schedule TYPE bapisched OCCURS 0 WITH HEADER LINE,
            capacity LIKE hri1024,
            wa_capacity LIKE hri1024 OCCURS 0 WITH HEADER LINE,
            location LIKE bapilocdat-locid OCCURS 0,
            new_event_package LIKE p1000 OCCURS 0 WITH HEADER LINE,
            objid  LIKE hrrootob OCCURS 0 WITH HEADER LINE,
            parent LIKE hrhctobjc OCCURS 0 WITH HEADER LINE,
            eventid TYPE hrobjid,
            event_id_out LIKE bapievdat-eveid,
            lt_1739 TYPE TABLE OF p1739,
            ls_1739 TYPE p1739,
            ls_error_record TYPE bapiret2,
            ls_nnnn TYPE wplog,
            open_resources_exits TYPE xfeld.
      DATA:  it_1035 TYPE piq_p1035_t,
             it_pt_1035t TYPE piq_hrt1035_t,
             it_daysoff TYPE piq_pt1035_t,
             it_daysfree TYPE piq_pt1035_t,
             ls_daysfree TYPE pt1035,
             ls_1035t TYPE hrt1035.
      DATA: it_bapiresou TYPE TABLE OF bapiresou,
            is_bapiresou TYPE bapiresou,
            resources TYPE bapiresou OCCURS 0.
      DATA: it_pa0002 TYPE TABLE OF pa0002,
            is_pa0002 TYPE pa0002,
            it_hrp1000 TYPE TABLE OF hrp1000,
            is_hrp1000 TYPE hrp1000,
            lv_dayoff(1),
            bp(12),
            im_begda LIKE sy-datum,
            im_endda LIKE sy-datum,
            sobid LIKE hrp1001-sobid,
            event_counted_dates TYPE dayct,
            event_counted_hours TYPE hrsct,
            ndays TYPE p1035-ndays,
            nhours TYPE p1035-nhours.
      FIELD-SYMBOLS: <ls_1035t> LIKE LINE OF it_pt_1035t.
      CLEAR gt_error_record[].
      SORT event BY short.
      SORT meeting_pattern BY eventname.
    *************************  Get Calender Date  *************************
      SELECT SINGLE begda endda FROM hrt1750 INTO (im_begda,im_endda)
              WHERE peryr = acad_year
                AND perid = acad_session
                AND timelimit = '0100'.
    ***************************  Create Event  ****************************
      LOOP AT event.
        CLEAR resources.
        LOOP AT meeting_pattern WHERE eventname = event-short.
    *********************  Create Schedule for Event  *********************
          CALL FUNCTION 'HRIQ_EVENT_SCHEDULE_BUILD'
            EXPORTING
              plvar                = '01'
              istat                = '1'
              event_begda          = event-begda
              event_endda          = event-endda
              monday               = meeting_pattern-monday
              tuesday              = meeting_pattern-tuesday
              wednesday            = meeting_pattern-wednesday
              thursday             = meeting_pattern-thursday
              friday               = meeting_pattern-friday
              saturday             = meeting_pattern-saturday
              sunday               = meeting_pattern-sunday
              event_beguz          = meeting_pattern-start_time
              event_enduz          = meeting_pattern-end_time
              frequency            = '1'
              event_location       = meeting_pattern-location
            IMPORTING
              pt_1035              = it_1035
              pt_1035t             = it_pt_1035t
              pt_daysoff           = it_daysoff
              pt_daysfree          = it_daysfree
            EXCEPTIONS
              no_date_number       = 1
              frequency_is_initial = 2
              OTHERS               = 3.
          LOOP AT it_daysfree INTO ls_daysfree.
            CALL FUNCTION 'HRIQ_CHECK_MODULOFFER_DAYSOFF'
              EXPORTING
                iv_date             = ls_daysfree-evdat
              IMPORTING
                ev_dayoff           = lv_dayoff
              EXCEPTIONS
                otype_not_supported = 0
                OTHERS              = 0.
            IF lv_dayoff = space.
              MOVE-CORRESPONDING ls_daysfree TO ls_1035t.
              APPEND ls_1035t TO it_pt_1035t.
            ENDIF.
          ENDLOOP.
    * no double entries
          SORT it_pt_1035t.
          DELETE ADJACENT DUPLICATES FROM it_pt_1035t.
          DESCRIBE TABLE it_pt_1035t LINES event_counted_dates.
          CLEAR event_counted_hours.
          LOOP AT it_pt_1035t INTO ls_1035t.
            nhours = ( ls_1035t-enduz - ls_1035t-beguz ) / 3600.
            event_counted_hours = event_counted_hours + nhours.
            ADD 1 TO ndays.
          ENDLOOP.
          LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
            MOVE-CORRESPONDING <ls_1035t> TO schedule.
            APPEND schedule.
          ENDLOOP.
    *Room
          IF NOT meeting_pattern-room IS INITIAL.
            SELECT SINGLE short stext FROM hrp1000
                     INTO (is_hrp1000-short,is_hrp1000-stext)
                    WHERE plvar = '01'
                      AND istat = '1'
                      AND otype = 'G'
                      AND objid = meeting_pattern-room
                      AND begda LE sy-datum
                      AND endda GE sy-datum.
            SELECT SINGLE sobid FROM hrp1001 INTO sobid
                    WHERE otype = 'G'
                      AND plvar = '01'
                      AND istat = '1'
                      AND relat = '020'
                      AND rsign = 'A'
                      AND sclas = 'R'
                      AND objid = meeting_pattern-room
                      AND begda LE im_endda
                      AND endda GE im_begda.
            IF sy-subrc = 0.
              is_bapiresou-retid = sobid(8).
            ENDIF.
            LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
              is_bapiresou-resht = is_hrp1000-short.
              is_bapiresou-resxt = is_hrp1000-stext.
              is_bapiresou-resbg = <ls_1035t>-evdat.
              is_bapiresou-resed = <ls_1035t>-evdat.
              is_bapiresou-beguz = meeting_pattern-start_time.
              is_bapiresou-enduz = meeting_pattern-end_time.
              is_bapiresou-resid = meeting_pattern-room.
              is_bapiresou-restp = 'G'.
              APPEND is_bapiresou TO resources.
            ENDLOOP.
          ENDIF.
    * Instructor
          IF NOT meeting_pattern-instructor IS INITIAL.
            SELECT SINGLE nachn vorna FROM pa0002
                     INTO (is_pa0002-nachn, is_pa0002-vorna)
                    WHERE pernr = meeting_pattern-instructor
                      AND begda LE im_endda
                      AND endda GE im_begda.
    **************************  Meeting Pattern  **************************
            SELECT SINGLE objid INTO is_bapiresou-retid FROM hrp1000
                    WHERE plvar = '01'
                      AND langu = 'E'
                      AND otype = 'R'
                      AND mc_short = 'INST-CM'
                      AND begda LE im_endda
                      AND endda GE im_begda.
            LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
              is_bapiresou-resht = is_pa0002-nachn.
              CONCATENATE is_pa0002-vorna is_pa0002-nachn
                     INTO is_bapiresou-resxt
                SEPARATED BY space.
              is_bapiresou-resbg = <ls_1035t>-evdat.
              is_bapiresou-resed = <ls_1035t>-evdat.
              is_bapiresou-beguz = meeting_pattern-start_time.
              is_bapiresou-enduz = meeting_pattern-end_time.
              is_bapiresou-resid = meeting_pattern-instructor.
              is_bapiresou-restp = 'P'.
              APPEND is_bapiresou TO resources.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
        wa_capacity-kapz1 = event-mincapty.
        wa_capacity-kapz2 = event-optcapty.
        wa_capacity-kapz3 = event-maxcapty.
        capacity = wa_capacity.
        CALL FUNCTION 'HRIQ_CREATE_EVENT'
          EXPORTING
            planversion     = '01'
            event_id_in     = '00000000'
            event_short     = event-short
            event_stext     = event-stext
            status          = '1'
            begin_date      = event-begda
            end_date        = event-endda
            language        = sy-langu
            eventtype       = event-betype
            capacity        = capacity
            location        = meeting_pattern-location
            check_resources = ' '       "'X'
            vtask           = 'B'
          IMPORTING
            event_id_out    = event_id_out
          TABLES
            schedule        = schedule
            resources       = resources
            return          = return.
        IF sy-subrc NE 0.
          CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
          CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
          return-type = 'E'.
          return-message = 'Error during save'.
          APPEND return.
        ENDIF.
        LOOP AT return WHERE id = 'HRPIQ000'
                         AND number = '846'.
          return-type = 'E'.
          return-message = 'Resources already in use'.
          APPEND return.
          EXIT.
        ENDLOOP.
    **********************  Create Session offering  **********************
        MOVE-CORRESPONDING ls_nnnn TO ls_1739.
        ls_1739-mandt = sy-mandt.
        ls_1739-plvar = '01'.
        ls_1739-otype = 'E'.
        ls_1739-objid = event_id_out.
        ls_1739-istat = '1'.
        ls_1739-begda = event-begda.
        ls_1739-endda = event-endda.
        ls_1739-aedtm = sy-datum.
        ls_1739-uname = sy-uname.
        ls_1739-infty = '1739'.
        ls_1739-peryr = acad_year.
        ls_1739-perid = acad_session.
        APPEND ls_1739 TO lt_1739.
        PERFORM create_infotype USING lt_1739
                             CHANGING ls_error_record .
        APPEND ls_error_record TO return.
        READ TABLE return  WITH KEY type = 'E'.
        IF sy-subrc <> 0 AND vtask = 'V'.
          CALL FUNCTION 'HRIQ_UPDATE_DATABASE'
            EXPORTING
              vtask          = 'D'
              commit_flg     = 'X'
            EXCEPTIONS
              corr_exit      = 1
              internal_error = 2
              OTHERS         = 3.
          IF sy-subrc NE 0.
            CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
            CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
            return-message = 'Error during save'.
            APPEND return.
          ENDIF.
        ELSE.
          CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
          CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
          EXIT.
        ENDIF.
    *********************  Create Relationship(E-SE)  *********************
        parent-objid = event_id_out.
        parent-otype = 'E'.
        APPEND parent.
        PERFORM create_relation TABLES parent
                                 USING 'B512'
                                       'SE'
                                       event-begda
                                       event-endda
                                       eventpackageid
                              CHANGING ls_error_record.
      ENDLOOP.
      IF vtask = 'V' AND ls_error_record IS INITIAL.
        PERFORM update_database CHANGING ls_error_record.
      ELSE.
        APPEND ls_error_record TO return.
        CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
        CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
      ENDIF.
      DELETE return WHERE type IS INITIAL.
    ENDFUNCTION.

  • Missing Calendar Function for PRIVAT Events

    Hi,
    can't set an event as privat. How can this be done. Don't like to make this visible in our company.
    I'm syncing to exchange via Air.
    Thx
    HW

    I just bought and synced my iPhone yesterday - same issue. I noticed that all the exceptions in my recurring appointments dropped the notes. If I changed the note itself, or the date of one of the recurrences, it deleted the note entirely. I tried deleting the series and recreating and then syncing and editing, but still the same issue. I can't find anything on the web or in the forums.

  • Does no one else care about a "snooze" function for calendar events

    This is something that would really help me.

    Hey TRICKorDEVICE,
    You can request features or leave feedback on the iPhone here:
    http://www.apple.com/feedback/iphone.html
    Jason

  • How to implement a callback function using LabView's Call Library Function Node?

    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    The SDK.h deacribes the function as:
    //  Function:   SdkSetPropertyEventHandler
    SdkError SDKAPI SdkSetPropertyEventHandler(
                SdkCameraRef                    inCameraRef,
                SdkPropertyEvent                inEvnet,          
                SdkPropertyEventHandler         inPropertyEventHandler,
                SdkVoid*                        inContext );
    //  Description:
    //       Registers a callback function for receiving status
    //          change notification events for property states on a camera.
    //  Parameters:
    //       In:    inCameraRef - Designate the camera object.
    //              inEvent - Designate one or all events to be supplemented.
    //              inPropertyEventHandler - Designate the pointer to the callback
    //                      function for receiving property-related camera events.
    //              inContext - Designate application information to be passed by
    //                      means of the callback function. Any data needed for
    //                      your application can be passed.
    //      Out:    None
    //  Returns:    Any of the sdk errors.
    A separate header file called SDKTypes.h 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 *               inContext );
    Thanks for your help.
    Alejandro
    Solved!
    Go to Solution.

    alejandroandreatta wrote:
    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    Basically you do not do that. LabVIEW does not know pointers and certainly not function pointers. What you should do instead is writing a C DLL that implements the callback and also exports a function to be called by LabVIEW that translates between the callback and a LabVIEW user event. Look for PostLVUserEvent() here on the NI site to find examples how to do that.
    Rolf Kalbermatter
    Message Edited by rolfk on 02-11-2009 08:00 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Control array of callback functions?

    Apologies for my basic question.
    I am experimenting with control arrays and so far am able to collect data in string controls that are inside control arrays.  Works well.  Naturally, none of these controls need callback functions.
    Now I have need of some momentary command buttons in a control array as well.  So my question is, should I use a single callback function for all of the button controls in that single array?  And if so, how do I go about identifying which element in the control array called the function?  From reading on the forums, it seems as if use of the callback data parameter might get me there.
    Just wanted to ask before I get off track.  Thanks!
    Solved!
    Go to Solution.

    Yes, callbackData can be of help in such a situation, but if you can limit to switch on array index to discriminate what to do your button callback could 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 cannot test it: double check the code but it should reasonably work)
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Network event is taking too long (100%)

    Hi everybody. We have a 10g DB on Windows. We're using OEM to manage the DB, and it has started to show an alert about database time spend waiting for "Network" event. It arises when we execute one module that updates several tables, that is taking too long. Before we had this app on 8i, also on Windows, and that operation was much more faster than now. The indexes on tables are valid, and I've gathered statistics for the CBO, so I suppose the problem is, as the OEM says, related with network, but I don't know why, because the connection speed is the same tan before, and the two machines are in the same LAN.
    Any ideas??

    Here is the output requested:
    SQL> select * from v$system_event
    2 where event like 'SQL%';
    EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED
    AVERAGE_WAIT TIME_WAITED_MICRO EVENT_ID
    SQL*Net message to client 1159200 0 252
    0 2516408 2067390145
    SQL*Net message to dblink 2234 0 1
    0 5590 3655533736
    SQL*Net more data to client 5753 0 166
    0 1657387 554161347
    EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED
    AVERAGE_WAIT TIME_WAITED_MICRO EVENT_ID
    SQL*Net more data to dblink 12 0 0
    0 548 1958556342
    SQL*Net message from client 1159181 0 218341084
    188 2,1834E+12 1421975091
    SQL*Net more data from client 23299 0 180602
    8 1806015123 3530226808
    EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED
    AVERAGE_WAIT TIME_WAITED_MICRO EVENT_ID
    SQL*Net message from dblink 2234 0 3693
    2 36934861 4093028837
    SQL*Net more data from dblink 4021 0 39
    0 390002 1136294303
    SQL*Net break/reset to client 182986 0 2740
    0 27397165 1963888671
    9 filas seleccionadas.

  • IPhone SDK:  Breakpoints don't trigger in a Callback function

    Hi -
    I coded a callback function for a CFSocket object; I followed the steps outlined by the CFSocket reference page. Everything seems fine, and then I enable a breakpoint inside my callback function.
    I run my code, and gdb does not stop into my callback.
    There doesn't seem to be much infos online about this particular problem. Can anyone tell me what I'm doing wrong?
    Thanks, Charles.

    Have you used logging to verify that the callback is being entered?

  • Tracking ID for different event handlers set

    In the following link i send the file with the image purpose:
    http://www.sendspace.com/file/cxbd8l
    Dear experts,
    We need to give Visibility for the next process, conformed by three visibility process, show more detailed in the following explanation:
    1. First Visibility process -> purchasing scenario
         Purchase Order -> Confirmation -> Goods Receipt -> Invoice Verification
    Note: In this scenario we need to modify the rule set (don´t include inbound delivery) and modify the standard functions (Create Z), of expected events and Goods receipt.
    2. Second Visibility process -> Stock transport order Scenario
    Stock transport order (PO) -> Outbound Delivery -> Shipment -> Goods receipt -> Invoice Verification (Planned delivery costs).
    Note: In this scenario we need to create a Z function to planned delivery costs and create the Z events according to the Planned delivery costs we want to control.
    3. Third Visibility process -> Second Stock transport order scenario
    Stock transport order (PO) -> Outbound Delivery -> Goods receipt -> Invoice Verification (Planned delivery costs).
    Note: In this scenario we need to create a Z function to planned delivery costs and create the Z events according to the Planned delivery costs we want to control.
    After this introduction, the question is how we can see an entire operation (the combination of the three scenarios), I mean, when we ingress to /SAPTRX/EH_LIST transaction, and execute this, the transaction show an event handler level (Same way /SAPTRX/EH_SET, event handler set level), but my grouping fields are according to Event handler (example: Bussines process type), but we don´t have a u201CProcess Unique IDu201D, that combine the different Application Object Types involved (In this process, PCM10_ITEM, TRA10_DELIV, TRA10_ROAD).
    In the following image I show an example of the point exposed (think in /SAPTRX/EH_LIST transaction):
    Appl.Obj.type             PROCESS UNIQUE ID
    PCM10_ITEM                123456
    TRA10_DELIV              123456
    TRA10_ROAD              123456
    Ok for do this; we expect to follow the next steps:
    1.     Define a field in the Tracking documents (Purchase order, Stock transport order, shipment and outbound delivery), where we ingress the same value (Process value ID) at the moment of execute the indicated transaction:
    a.     ME21N -> PO and stock transport order.
    b.     VT01N -> Shipment.
    c.     VL01N -> Outbound delivery.
    2.     Define a new Info Parameter both in the application system and in event management system.
    3.     Create Z function for expected event extractors and Info parameter Extractors (These functions have to look and save the info parameter defined previously).
    4.     Because this field doesn´t exist in any report, we think to create an enhancement in the /SAPTRX/EH_LIST transaction with the objective of don´t create a new report for only one new field (It require an ABAP program).
    According with this explanation, it´s correct our analysis? We forget any step to get our purpose?
    We appreciate a lot your help in this issue.

    Hello,
    Kevin thanks a lot by your answer, the question is how to associate three event handlers, but i don´t know about the number range, i appreciate a lot if you can explain to me more detailed, how i can define this number range and what tables has associated in order to define de Function module for "Control parameter extractor". I appreciate too if you can explain me how the system assign the same number in the three event handlers.
    According to this, I appreciate a lot if you confirm  to me, the followings steps that cover this requirement (I propose two different scenarios, the second scenario was adjusted after your explanation):
    SCENARIO 1 -> Using a custom number range.
    1. Define a custom number range.
    2. Define a new Control Parameter both in the application system and in event management system. Assign the control parameter to the list and create the event handler set.
    3. Create Z function for "expected event extractors" and "Control parameter Extractors" (These functions have to look and save the control parameter defined previously).
    4. In this case, cause its defined a common event handler set, we can execute the /SAPTRX/EH_SET transaction and look the operation consolidated.
    SCENARIO 2 -> Including information in one additional field in the ECC transactional documents
    1.     Define a field in the Tracking documents (Purchase order, Stock transport order, shipment and outbound delivery), where we ingress the same value (Control parameter) at the moment of execute the indicated transaction:
    a.     ME21N -> PO and stock transport order.
    b.     VT01N -> Shipment.
    c.     VL01N -> Outbound delivery.
    2. Define a new Control Parameter both in the application system and in event management system. Assign the control parameter to the list and create the event handler set (with relation type -> 2 control parameter).
    3. Create Z function for "expected event extractors" and "Control parameter Extractors" (These functions have to look and save the control parameter defined previously, in this case according with the extractor (PCM10_ITEM or TRA10_ROAD), the function has to find in the respective field in any case (it means in the PO its the field XXX in the shipment its the field YYY, but in event management the "control parameter" its the same).
    4. In this case, cause its defined a common event handler set, we can execute the /SAPTRX/EH_SET transaction and look the operation consolidated.
    According with this explanation, it´s correct my analysis? I forget any step to get our purpose?
    I appreciate a lot again your help in this issue.

Maybe you are looking for

  • Unicode Enabling Issues for HR ABAP.

    Heay Guys, I am working on a Unicode Enabling Project. For those who has worked on a Unicode Enabling Project, could you please tell me if there would be any issues specific to HR ABAP Programs? This is an urgent requirement for me. Please reply me a

  • To archive material master, use MM71 or FI_ACCPAYB?

    Hi! We are preparing archiving on material master in our ECC6.0. We know that FI_ACCPAYB can be used for that purpose. However, we also are told that we can go t-code  MM71 to archive material master as well. Please inform us whether it is true?   An

  • Canon i9900 - need printing options

    I know that one of the new features for leopard is "simplified printing." I have a 13x19 canon i9900 printer where i print out a lot of my design work. One of the most useful "can't live without" features is the ability to change color options throug

  • How add title to checkbox when select multiselect in htmlb table

    I am doing htmlb using Java and can't seem to be able to add a title to the checkbox on my table. I see how to get the columns in java by using the following code TableColumn columnA = model.getColumnAt(2); But I can't seem to access the column that

  • Sending db2 data to web page

    I am new to JSP. How can I send db2 output to text field/area within the same page? Code sample will be helpful. Thanks