How to unrigister the call back function,in vb6 with DAQmx 8.5

I use daqmx api which named DAQmxRegisterEveryNSamplesEvent to register my call back function,When I invoke the function  DAQmxErrChk (DAQmxStopTask(taskHandleAnalog)) to stop my Task.then i call the procedure AD_OPEN  again,it raise an error ,tell me that i need to unregister the event,the data has transfer into the buffer.how can i unregister the event,please look at the following code.
Spoiler (Highlight to read)
Private Sub create()
   Dim channel As String
    Dim minVoltage, maxVoltage As Double
    Dim samplesPerChannelPerRead As Double
    Dim sampleMode As Long
    Dim boolVal As Boolean
    On Error GoTo AdErrorHandler:
    ' Get values from UI controls
    channel = "Dev2/ai1:2"
    minVoltage = -10
    maxVoltage = 10
    samplesPerChannelPerRead = 100
     If (taskHandleAnalog <> 0) Then
         DAQmxErrChk (DAQmxStopTask(taskHandleAnalog))
        DAQmxErrChk (DAQmxClearTask(taskHandleAnalog))
        taskhandle = 0
    End If
    ' Configure the task
    DAQmxErrChk (DAQmxCreateTask("", taskHandleAnalog))
     DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleAnalog, "Dev2/ai0", "", DAQmx_Val_InputTermCfg_RSE, minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString))
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleAnalog, channel, "", DAQmx_Val_InputTermCfg_Diff, minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString))
End Sub
Private Sub AD_Open()
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleAnalog, "", 200, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_ContSamps, samplesPerChannelPerRead))
    'Find number of samples specified
    DAQmxErrChk (DAQmxGetTaskNumChans(taskHandleAnalog, numChannels))
    'Configure Event Callbacks
    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandleAnalog, 1, 4, 0, AddressOf EveryNSamplesEventHandler1, Nothing))
 ReDim dataBuffer(numChannels * samplesPerChannelPerRead - 1)
    ' Start the DAQmx Task
'    DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandleAnalog, "/Dev1/PFI2", DAQmx_Val_Edge1_Falling))
    DAQmxErrChk (DAQmxStartTask(taskHandleAnalog))
    ' Update UI
    Exit Sub
AdErrorHandler:
    MsgBox Err.Description
End Sub

This may be a bit late, so hopefully you found this on your own. But in order to unregister the event pass a null value for the callback function parameter in the DAQmxRegisterEveryNSamplesEvent function (Nothing in VB).
National Instruments
Product Support Engineer

Similar Messages

  • How To use the going back function in Safari (multitouch)? Going back on Websites ist only possible using the arrow Key on the left corner but not by using the sweep function like it is possible in macOS.

    How can i use the going back function in Safari like it is possible in MacOS? On the Mac i can chance back to previous Websites by sweeping with two Fingers. Unfortuntely is this Not possible on the ipad. I tried with one and to fingers but it doesn't work.
    The multitouch function is switched on but still Not working. What is wrong? Thx for help.

    To go back a web page in Safari touch the screen with one finger at the extreme left and swipe to the right.
    To go forward a web page in Safari touch the screen with one finger at the extreme right and swipe to the left.

  • Is there anyway to correct the call back telephone number mentioned in the scheduled call from Apple?

    I just had a call from Apple tech team regarding my iPhone not getting activated after inserting nano sim and they decided that my new unlocked iPhone5 needs replacement. I am already disappointed by Apple bcos of the delay in getting my new iPhone5 started and now declaring that the set I received is a faulty one and need replacement.
    Again for replacement they have schedule another call from sales team and doing so they have mentioned the number which is not right. I told him to call me back on the same number but an email which i received post that call has a wrong phone number in it. It could not have gone worse.
    Do anyone know how to change the call-back number to a scheduled call from apple?
    Thanks,
    AK

    The devices that are listed are: 2 under the name of the device that synced incorrectly with mine and then 3 others that are not associated with my itouch. The name of the ipod, before the incorrect sycning is no longer under devices.  It has been replaced with the incorrect one because I can see the serial # of my ipod under the wrong name.
    The playlists that are in my itunes library are from an ipod that I used a few times before I took this one over... Which happens to be the ipod that took on the ID of my itouch.
    Both of these ipods used to be my kids.. I used my sons a few times and then switched to my daughters.  They each had their names attachted to their particular devices and now it just says my sons, which is the ipod that itunes was connecting to when all this happened. The really strange thing is my son doesnt use his ipod any longer and now uses his phone for music...So, it had been a while since that particular device was even synced to itunes!
    I hope this helps!

  • How to use call back function ?

    i have MlEditmanager class which extends xyzManager class. I also want to extend Eventdispatcher .. but it is not possible to extend more than one class ...
    so the work around can be to create call back function. private var xyz:Function; --> how to use this syntax?
    Can someone help me how to achieve this?
    Urgent pls.

    Hi
    check out this link
    http://rushmeflex.blogspot.com/2010/09/cairngorm-2-view-notification.html
    Though this is not your requirement, however in the source code callback functions are used. You can get clue from that.
    Hope this helps
    Rush-me

  • How can I debug the Call Library Function at run-time

    I've written a VI using the CLF to call a DLL which was compiled off-site by another engineer using MSVC. Even though the VI runs without flagging any errors, the VI is not doing what I expect. Is there any way of finding out if the DLL is been called correctly? The first function that is called doesn't return any value, but I think that it should. Does this mean that the DLL is not being called correctly? Note also that the DLL works fine with a JAVA GUI.

    Make sure that you are specifying the proper function prototype in the call library function. If you are slightly off the call will not work properly. Ask the offsite engineer to provide you with this data. Another tip is to build the dll with the option to show front panel when called. You can actually popup the dll like you would a subvi. If you design it with test indicators showing on the front panel that is a great way to determine if it is working. Hope this helps.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • Stateless Bean - scope of instance variable in EJB Timer call back function

    Hi,
    I would like to know on the scope of an instance variable of a Stateless Bean object,
    when used in a EJB Timer call back.Let me explain this in more detail below.
    I have a requirement to use a EJB Timer.
    For this, I have created a stateless object since Timer creation needs to be done
    from a stateless bean. I have a member variable "count" of the stateless bean class.
    In the timer call back(ejbTimeout), I am able to use this count variable during
    each time of the call back, and the value of this variable is also updated properly.
    I have a few queries with respect to the above behaviour:
    1) Does stateless bean object not get destroyed once the Timer is created from the Bean?
    2) If the Bean object is not destroyed, then when does the bean object get destroyed?
    3) If both (1) and (2) are not true, then can anyone explain on how the above behaviour is possible?
    Thanks in advance,
    Ulrich

    Hi Ulrich,
    The ejb timer is associated with the stateless session bean component, not with a particular bean instance. There is no formal relationship between the bean instance that called createTimer() and the bean instance on which the timer callback happens. If they're the same in your test run that's just a coincidence and not something your application should be depending on.
    In the stateless session bean model, the container can create and destroy stateless session bean instances at any time. The container is free to pick any stateless session bean instance to service any client invocation or timer callback. If you need to pass context into a timer callback, one way to do it is via the timer "info" object. However, the info object is immutable so it wouldn't be a good match for a counter. You could of course always just use a database for any necessary coordinated state.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • The call library function require us to define the type of parameter that w are using.The type of parameter in cludes numeric, array, string,wav​eform and adapt to type.I would like to know more about waveform and adapt to type.

    In the labview manual, there is very little mention about the use of waveform.How is this waveform being called and can i have an example to see how this work.
    Also in the adapt to type paramete, what does this parameter do and in what circumstances do we need to use it.The manual say something about the use of this parametr.It says that scalar elements in arrays or clusters are in line.For example a cluster containing anumeric is passed as pointer to a structure containing a numeric. What does this statement mean?
    Can i imply t
    hat if my input is a struct, can i use a adapt to type parameter to overcome this incompatibility?Can i also have an example to let me have a better idea.thank you

    I'm going to share my experience with the "Adapt to Type" parameter.
    Attached to this message is an example. The attachment is a zip file with three files: a dll, a c file and a vi written in LabVIEW 6. The dll contains a function that return a structure with 3 values (like the coordinates of a point in space, that is, (x, y, z)). You can see how the function was constructed by looking at the c file.
    In LabVIEW, I created a cluster with the same three parameters. Then, I configured the call library function following the function prototype as in the c file. For the point variable I use "Adapt to Type".
    I hope this can give you a head star.
    Best regards;
    E. Vargas
    www.vartortech.com
    Attachments:
    pointexample.zip ‏63 KB

  • Can i use DLL file created by Fortran with the call libary function node

    Can i use a DLL created by Fortran (Compaq Visual Fortran) with the call library function node in labview. If yes how do i create the DLL file if i have the Fortran code.
    Thanks

    Yes! Maybe these old post will help:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=88786
    http://forums.ni.com/ni/board/message?board.id=170&message.id=109150
    Good luck!
    Message Edited by altenbach on 03-21-2006 02:35 PM
    LabVIEW Champion . Do more with less code and in less time .

  • HTTP Call back functionality

    Hi All,
        I need to implement a HTTP call back functionality to do a handshake between my portal and a 3rd party application.
    Framework: Oracle ADF
    Application server: Weblogic 10.3.6
    1. We will do a HTTP POST (that includes a token for validation purpose) from our portal to a 3rd party application, lets say, XAPP.
    2. Then the XAPP will make a call back using the call back URL of our portal. When they do the call back, they include the token that we provided to them in Step1.
    3. We need to accept the call back request and validate the token. After this I need to resume with the response processing from the initial POSTing session.
    4. After all the validations, I need to open XAPP's URL in a browser.
    Here the main catch is to keep the initial POSTing session alive(waiting) while accepting the call back request and then continue with the response processing from the initial POSTing session.
    Thanks for your help.

    Hi,
    make sure to post this to the WebCenter forum too as i would assume they more likely have this as a requirement too
    Frank

  • How to count how many times the caller calls by using UCCX script?

    Hi there,
    My customer wants to do a few changes for their script as below:
    At the beginning of the script they are planning to add a new menu item, it will announce their new privacy policies and to continue the user must press the number one to continue to the Welcome.  If they do not press 1 then the message should repeat itself and if they again do not press 1 they should be transferred over to a live operator who will explain things and then be able to transfer them back to the message so that they can press 1 and continue.
    I modified their script as attached file, but i don't know how to count how many times the caller calls in "Get Reporting Statistic".
    Any helps would be appreciated.
    Thanks.

    Hi Aaron,
    At beginning, i want to use a variable to get number of mistake for the same caller, then we will send the call to right place to fulfill the customers' needs. 
    Do you have any suggestion for the new posted script?
    Thanks.

  • HT5262 How long should the icloud back up take?

    How long should the iCloud back up take? I only have 4gb of storage but it has taken almost an hour already with approximately 2 hours remaining. 

    Hi RMaskery14,
    If you are concerned about the time your iCloud backup is taking, you may find the following article helpful:
    My backup is taking a long time to finish.
    Backing up and restoring takes time, especially if you have a lot of data or a slow connection. Depending on the size of your backup and the speed of your network, you may need more time than expected to complete the process. Using a reliable connection when backing up your device is highly recommended.
    iCloud: Troubleshooting creating an iCloud backup
    http://support.apple.com/kb/ts3992
    Regards,
    - Brenden

  • How to stop the call summary display on home screen?

    How to stop the call summary display on home screen?

    Here are the solutions I can think of (if no one here responds with something better):
    1. Open Settings and then Phone within the Settings screen and see if you can find a setting there for the call summary. The Phone submenu under Settings would be the most likely place.
    2. Open Settings on your iPhone and go through each item including all of the items within each main item. Within about 10 minutes you should be able to get through all of the settings and find the setting if it exists on your phone. There is no such setting on my phone but it is possible that Airtel has a custom menu with that.
    3. If you still haven't found it, you could check a) Airtel's support site and/or b) an Airtel specific forum.
    4. If still no luck, I would call Airtel and ask again and if you get the same response ask for the location of the setting (or to speak to someone who can tell you).
    Good luck.

  • Help!! working on a movie on Imovie. I had to delete a music file from a clip section and now there are some clips that have no audio!!! don't know how to get the audio back to my clips!!!! Help!!!

    Help!! working on a movie on Imovie. I had to delete a music file from a clip section and now there are some clips that have no audio!!! don't know how to get the audio back to my clips!!!! Help!!!

    You can use some third party software to copy the music from your old iPod back to computer first, and then import the music into iTunes and re-sync them to yournew iPod. Here is a guide about how to transfer iPod music to computer. Hope it helps. Feel free to email me if you need further help.

  • Hi Everyone, i lost my KN presentation that i spent a day with my boss to finish it. I lost it by mistakenly shutting down my Macbook pro. Can anyone please tell me how to recover the files back as i'm really2 in trouble and my job depends on it...

    Hi Everyone,
    I lost my KN presentation that i spent a day with my boss to finish it. I lost it by mistakenly shutting down my Macbook pro. Can anyone please tell me how to recover the files back as i'm really2 in trouble and my job depends on it...
    hmmm...how i hate myself for being such a careless person...
    PLEASE HELP ME...
    Thank you in advance.
    Keynotes '09
    Version 5.1.1 (1034)

    How exactly did you shut down your laptop? Not a hard restart (holding down the power button), I hope... if that's the case, then it is extremely unlikely the file is still intact on your computer. If it is, it would be an image on your RAM, and it is time-and-resource-intensive to recover it if it is even there. RAM memory is disposable and always being written over. Sorry dude...
    If it wasn't a hard restart, Keynote should have made a backup, unless you 'Force Close'd it.
    It really all depends on how your mac was shut down.

Maybe you are looking for