Why one interrupt request causes multiple times of responses (isr)?

Hi, Folks
I have a GPCT0 timer which will generate interrupt. with a oscilloscope, every time I run the code I saw a pulse was generated at the G0 output, but the isr run 51 times when I open the NI SPY to monitor it. When I turned off the NI SPY, it happened 6 to 8 times. I enabled the visa event, then configured the timer and turned on the hardware interrupt. Here is the code in main:
// enable the G0_TC interrupt
 theSTC->Interrupt_A_Enable.setG0_TC_Interrupt_Ena​ble(1);
 theSTC->Interrupt_A_Enable.setG0_Gate_Interrupt_E​nable(0);
 theSTC->Interrupt_A_Enable.flush();
 theSTC->Analog_Trigger_Etc.setGPFO_0_Output_Selec​t(0);
 theSTC->Analog_Trigger_Etc.setGPFO_0_Output_Enabl​e(1);
 theSTC->Analog_Trigger_Etc.flush();
// enable the interrupt A
 theSTC->Interrupt_Control.setRegister(0); // reset complete register
 theSTC->Interrupt_Control.setInterrupt_Output_Pol​arity(theSTC->Interrupt_Control.kInterrupt_Output_​PolarityActive_Low);  
 theSTC->Interrupt_Control.setInterrupt_A_Output_S​elect(0);  
 theSTC->Interrupt_Control.setInterrupt_A_Enable(1​);
 theSTC->Interrupt_Control.flush();
// start to run the timer
 theSTC->G0_Command.writeG0_Arm(1);
Here is code in the isr:
ViStatus _VI_FUNCH IHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr uhandle)
 tAddressSpace  Bar0, Bar1;
 tESeries *board;
 tSTC *theSTC;
 tMITE *mite;
 Bar0 = bus->createAddressSpace(kPCI_BAR0);
 Bar1 = bus->createAddressSpace(kPCI_BAR1);
 mite = new tMITE(Bar0);
 board = new tESeries(Bar1);
 theSTC = new tSTC(Bar1);
 i = i++;
 theSTC->Interrupt_A_Ack.writeG0_TC_Interrupt_Ack(​1);
 theSTC->Interrupt_A_Enable.writeG0_TC_Interrupt_E​nable(0);
 theSTC->Interrupt_Control.writeInterrupt_A_Enable​(0);
(function code here)
 mite->LocalCpuInterruptMask2.setSetCpuIntIE(1);
 delete mite;
 delete theSTC;
 delete board;
 bus->destroyAddressSpace(Bar0);
 bus->destroyAddressSpace(Bar1);
 return VI_SUCCESS;
I suspect that there may be someting wrong with data passing between main and isr, don't know for sure.
Any help and advice will be appreciated greatly.
Best regards,
George

Hi George,
I'm confused on what the interrupt handler is trying to do.   By disabling interrupts you should not get any more interrupts after the first interrupt is handle.  I think you are saying the problem is that the interrupt only occurs 51 times, but I don't know how it happens more than once!?.  Is there something missing?
One thing not related to the device programming... the interrupt event callback should not be create and destroy (new/delete) the chip objects eveytime is called for these reasons:
- The chipobjects maintain softcopies of the registers and they model the state of the hardware.  The new object does not represent the currently configured device.  There should be one instance of the chip the object is representing.  You should create one instance of the tSTC because there's one STC in the device.
- Memory operations can be very expensive.  A lot of time is consumed creating and destrying these objects.  Add to that the constructor and destructors of each object, which are called for every new and delete.
To solve both problems use the 'userHandle' parameter in viInstallHandler, from the description:
Applications can specify a value in the userHandle parameter
that is passed to the handler on its invocation. VISA identifies handlers
uniquely using the handler reference and this value.
This userHandle provides context for your interrupt callback.  If you only need the STC object to service the interrupt you can pass a pointer to the STC object as the user handle.  In your handler you would use the userHandle argument to get to the STC object:
ViStatus _VI_FUNCH IHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr uhandle)
    tSTC *stc;
    stc = (tSTC *) uhandle;
    stc->...
Diego

Similar Messages

  • Why are my appointments listed multiple times?

    Why are my appointments listed multiple times?

    I noticed this today but I didn't even use outlook.  I made all appointments in EST/EDT.  Currently I'm on a business trip in Poland and all the times changed 6 hours ahead (the time zone in poland)... so now while planning things back home, everything is screwed up because I thought my appointments were 6 hours later then they were...
    This is a HUGE issue.... this will cause major headaches for business travelers and needs to be looked at ASAP.  But I can't even find a way to file a bug report with apple and let them know.  Not impressed one bit with this.

  • One work process can only process one user request at a time?

    Hi,
       How to configure the how many work processes for 80 concurrent users login daily.One work process can only process one user request at a time? Does this mean a login user has a dedicated work process servicing him. Or many login users interleave a work process's service? ,clarify the same.
    Thanku

    There are different types of work processes and the number needed depends on the number of transactions that will take place in the system. We are running 80 concurrent users with 15 dialog work processes. Please see the link below for an explanation:
    http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2e8a358411d1829f0000e829fbfe/content.htm

  • My apple I'd has been discarded for security reasons. The site asks me to give my email and they would send me the further instruction. But no Emil has arrived so far. Since January. And I did requested help multiple times. :( any ideas where can I solve

    My apple I'd has been discarded for security reasons. The site asks me to give my email and they would send me the further instruction. But no Emil has arrived so far. Since January. And I did requested help multiple times. :( any ideas where can I solve

    Who discarded the Apple ID? Apple? or You?
    Did you answer the Security Questions? Is the backup email accurate? Have you tried contacting them?

  • Billing request appearing multiple times in document flow

    Hi,
    After upgrading from 4.6c to ECC6, for contracts the billing request(same document number, same items)  is appearing multiple times in the document flow. Please help me in resolving this issue.
    Thanks,
    Ramesh

    Note 1049482 is valid for the following releases:
    Release Package name
    500 SAPKH50018
    600 SAPKH60011
    602 SAPKH60201
    You can check your support pack level from transaction SPAM or by clicking on:
    System -> Status. From here there is a button called "component information" in the SAP System data section. This will show you the different support pack levels. If your support pack is less than SAPKH60011 (for example SAPKH60008) then the note is applicable. "
    thanks
    G. Lakshmipathi

  • Why is my variable incrementing multiple times?

    In my application I need to increment a variable when a certain condition is met so I have a case statement which checks whether the condition is true then increments a variable. However the variable is increment for the entire time that the condition is met. How can I restrict this to only increment one time per occasion of the condition being true. I've tried while and for loops that execute only one time and nothing seems to work.

    Or you could do it similar to this.
    Joe.
    "NOTHING IS EVER EASY"
    Attachments:
    Try this.vi ‏26 KB

  • One email keeps repeating multiple times all day

    In my mac.com mail account I have been receiving one specific email over and over again. How can I get rid of it forever?

    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type or copy / paste:   ~/Library/Caches/com.apple.Safari
    Click Go then move the Cache.db file from the com.apple.Safari folder to the Trash.
    Try Safari.

  • Applied for distribution license multiple times, no response?

    So I've applied for a distribution license several times through the web form, and each time I've recieved the confirmation email.  Each time I've clicked the link and been presented with a screen that says my request will be reviewed within 3 business days.  The first one of these was more than two weeks ago with no response.  I'd appreciate it if someone could contact me to resolve the issue.  We need to distribute Adobe Reader, flash, and shockwave to clients to enforce updates as well as build deployment images

    I don't know why you haven't received any replies to your applications.  But here are the download links for the products you mentioned
    Adobe Reader: http://get.adobe.com/reader/enterprise/
    Adobe Reader MSI: ftp://ftp.adobe.com/pub/adobe/reader/win/
    Flash Player: http://www.adobe.com/products/flashplayer/distribution3.html
    Shockwave Player: http://www.adobe.com/products/shockwaveplayer/shwv_distribution3.html

  • One user appearing multiple time in Users on System report

    Hi,
    While checking the logging report I found one user is appearing multiple times. Is this the normal behaviour of Hyperion of Is there any setting in Hyperion to display one user only once.
    Also can we control the users the from loging into systme multiple time at a time.
    Thanks,
    Ajaya Kumar

    If multiple people know the username and password they can definitely be shared. This is a violation of your licensiing and is a major reason why most SOX departments require Active Directory linking. For testing purposes I have created native IDs to be shared among people so that I know they are identical.

  • Photoshop is opening multiple times...WHY??? (please help).

    When I double click on an image (from Bridge for example) to open in Photoshop it will open up CS6 and then sometimes when I open another image, instead of opening up in the same open Photoshop program, it will open up an additional Photoshop program.  Both CS6, Version 13.0.6 x64.  Super frustrating when sitting with a client and trying to add an image to a document and it opens up in a different program...   Is there a way to see where Photoshop is opening from?  Why would CS6 be opening multiple times???
    I don't think I noticed this happening before I upgraded to Mavericks (yes, this has been happening for a while).  I also have a back-up program called SuperDuper that mirrors my system on a separate hard drive.  Could Photoshop be opening from there, too?
    Thanks for any possible help!
    Deron

    Use Lion Recovery to reinstall the Mac OS X.

  • Servlet init() method called multiple times

    We have a Servlet-based application which does lengthy initialization.
    We've noticed that when multiple requests arrive,
    but the Servlet's init() method has not returned yet
    for the first request, the application server calls init() multiple times.
    You can even see this with the Fortune sample
    Servlet. Starting the app server and sending 20 or 30
    simultaneous requests causes multiple Fortune Servlet init messages to appear in the kjs log.
    Why is this? We do not implement SingleThreadModel.
    Doesn't the J2EE 1.2 spec say init will be called
    only once?
    How do we prevent it?
    A Startup class which inits our
    Servlet?
    Or a synchronized block within our init method, with some checks of static member variables
    so that the initialization work only happens once?
    Or is there some kregedit magic or deployment descriptor change I could make?
    Again, it's not a SingleThreadModel issue, so don't
    point me there.
    This is iAS 6.0 SP4, on Solaris, by the way.

    Hi
    Yes,you are right. In iAS6.0 SP4 When multiple requests arrive,and the Servlet's init() method has not returned yet for the first request, the application server calls init()multiple times. This problem is resolved in iAS 6.5.
    There is no kregedit magic that will solve this problem.
    Right now the workaround is any of the solution you proposed. Or use iAS6.5. I have tested it with fortune.
    Please download it and check with your application.
    you can find free download at http://developer.iplanet.com/appserver/testdrive/testdrive_65.html
    Thanks

  • Same system being shown multiple time in Solution for Early Watch Report

    Hi Gurus ,
    I have some satellite system configured to Solution Manager . Today I can see the same system entry multiple time in the
    Operations: Solution Monitoring -> Early Watch Alert.
    eg .,
    I have a system whose SID is ABC , i can see the ABC entry for todays date (i.e., 4 FEB 08) nearly 4 time .And this systems are not rescheduled for the next EWR (i.e scheduled for 11 FEB 08- since we have kept a period of 7 days )
    Please suggest
    Anthony

    Hi Anthony,
    There was an error, that EWA sessions for one systems were scheduled multiple times per week.
    Please check [SAP Note 1083108 - Duplicate EarlyWatch Alerts|http://service.sap.com/sap/support/notes/1083108]
    Search for SAP Notes with key words: EWA, multiple, duplicate.
    Application area: SV-SMG-OP
    What's the software configuration of your SolMan?
    Best regards,
    Ruediger

  • Oracle Object Type Constructor Called Multiple Times

    I have an object type with a custom constructor. In SQL, when I reference the attributes the constructor is called multiple times in Oracle 11.2.0.4.
    Why is the constructor called multiple times?
    How do I stop it?
    My current work around is to reference the attributes and use the /*+ materialize */ hint.
    Problem Setup
        create or replace type Foo as object
          Bar1 NUMBER,
          Bar2 NUMBER,
          Bar3 NUMBER,
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
        create or replace type body Foo is
          -- Member procedures and functions
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
          AS
          BEGIN
            SELF.Bar1 := p_Bar1;
            SELF.Bar2 := p_Bar2;
            SELF.Bar3 := p_Bar3;
            dbms_output.put_line('Foo Constructor Called');
            RETURN;
          END;
        end;
    Problem
        -- Constructor is called 6 times!
        -- Once for each column and once for each predicate in the where clause.
        SELECT x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3, f
        FROM (
          SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
          FROM dual d
        ) x
        WHERE x.f.bar1 = x.f.bar1 AND x.f.bar2 = x.f.bar2
    Output
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Workaround
        -- Work Around
        -- Constructor is called 3 times
        -- Once for each column in the inline view.
        -- Note, I removed column f (the object type) because it's not compatible with the materialize hint.
        WITH y AS (
          SELECT /*+ materialize */ x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3
          FROM (
            SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
            FROM dual d
          ) x
        SELECT y.bar1, y.bar2, y.bar3
        FROM y
        WHERE y.bar1 = y.bar1 AND y.bar2 = y.bar2

    Another work-around is described in this thread... Accessing fields of a custom object type... which makes use of a collection type combined with the TABLE operator, like so...
    create or replace type FooTable as table of Foo;
    SELECT x.bar1 AS bar1, x.bar2 AS bar2, x.bar3 AS bar3, value(x) f
        FROM table(FooTable(
          foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3)
        )) x
        WHERE x.bar1 = x.bar1 AND x.bar2 = x.bar2
    BAR1 BAR2 BAR2 F
    1    2    3    (1, 2, 3)
    Foo Constructor Called
    Hope that helps...
    Gerard

  • Why am I having trouble importing vCards? I follow the Help Center instructions by dragging and dropping, but some don't sync into the cloud. And why can't I drag multiple vCards? I have over 4,000. Please tell me I don't have to do one at a time?

    Why am I having trouble importing vCards? I follow the Help Center instructions by dragging and dropping, but some don't sync into the cloud. And why can't I drag multiple vCards? I have over 4,000. Please tell me I don't have to do one at a time?

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • Why does my iphone only send one picture multiple times when i select multiple photos to send?

    why does my iphone send one picture multiple times when i select multiple photos to send (via message or email)?

    Are you sending via Camera itself?
    That is, selecting a picture, then select forward link symbol from bottom left
    then select another picture,
    Each time make sure you see the blue check mark at bottom right of each selected picture.
    The number of " # Photos Selected" should be displayed at the top.
    Then select Mail or Message and transmit.

Maybe you are looking for