LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to develop an interrupt handler

Returning to the Diamond Systems Universal Drivers for their data acquisition boards..
 
So far so good.  Drivers installed and polled operations work fine via the CVIRTE. 
 
Now, I need to develop an interrupt handler for the A/D Card FIFO interrupt.  The drivers come with all the necessary function calls to set up the card and read from it, as well as example code.  But I need an interrupt handler to work via the CVIRTE. 
 
Is there something easy, like a call to install an interrupt handling function that one calls after the InitCVIRTE call?  Is there any documentation or sample code that would help me do this?
 
Thanks...
0 Kudos
Message 1 of 10
(4,278 Views)
Setting up interrupt handlers is the responsibility of the driver software, not CVI. You need to look at sections 4 and 5 of the Diamond Systems Universal Driver to see how it is done. In particular, the dscADSampleInt() and dscADScanInt() functions are probably the ones you are looking for.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 10
(4,248 Views)
I know what content I need in the handler, to deal with the samples in the FIFO.  But since this is executing via the CVIRTE, don't I need a callback function to respond to a CVIRTE event, rather than an OS event?
0 Kudos
Message 3 of 10
(4,244 Views)
This may help.

How Can I Handle Interrupts in LabWindows/CVI?

Message Edited by Gavin F on 10-03-2006 01:40 PM

Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 4 of 10
(4,224 Views)
Gavin --
 
The very short article you sent me to is for CVI version 5.  Is this still completely accurate for CVI 8? 
 
I guess what I expected to see was something similar to how TSQ's are registered and the TSQ handling function is installed.  Something like that for system generated interrupts, that need to be dealt with in a CVI application.
 
Thanks... Gary
0 Kudos
Message 5 of 10
(4,216 Views)
Hi Gary,

Yes, the article is accurate for CVI 8.

What are you trying to do with Thread-Safe Queues? 
What handling function are you talking about? 
What are you trying to do overall, inside and outside of the interrupt handler you are creating? 
I need many more details to get an idea of what you are doing.


Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 6 of 10
(4,172 Views)
Gavin,
 
I am building a small data acquisition and control system using Diamond Systems PC104 boards.  I'm doing the software for this using LabWindows, executing the installed distribution in Windows XP Embedded on the Diamond Systems Athena board.  So far, so good.  This has actually worked extremely well, becuase a lot of this system -- Command, Telemetry, state machine -- was prototyped and rigorously tested on a standard PC, before moving it to the target.
 
Now the fun part -- integrating the data acq hardware, the Diamond DMM-48 board.  This board has 16 channels of A/D, 8 relays and 4 channels of change-of-state DIN.  We have installed the Diamond Systems Universal Driver for this board, and used their function calls to poll the A/D and control the relays.  So far, so good.
 
Now, it is necessary to operate this board at a higher rate, use the 2048 sample FIFO, and respond to interrupts generated by the board.  I'm sure we can figure out how to use their function calls to read the FIFO into a buffer.  The only issue I have is how to deal with a hardware interrupt from within a CVI application.  We are studying and trying things, but I don't think we have the solution yet.
 
The comment about TSQ's was only to say that I expected to be able to register an interrupt handler just like a TSQ handler, but that functionallity does not seem to be in CVI.
 
Now you know the rest of the story.... Gary
0 Kudos
Message 7 of 10
(4,170 Views)
And come to think of it, for all the NI boards that generate interrupts, and other boards and instruments that generate interrupts, there must be some kind of facility within CVI -- perhaps hidden to the rest of us since they are embedded in FP's -- to register those hardware interrupts with the CVIRTE.
0 Kudos
Message 8 of 10
(4,169 Views)

No, this has nothing to do with the CVIRTE. I will say again: interrupt handlers are the business of the hardware device drivers.

The functions I pointed you at before - dscADSampleInt() and dscADScanInt() - allow you to specify callback functions within your application that will be called when the interrupt occurs.

 

--
Martin
Certified CVI Developer
0 Kudos
Message 9 of 10
(4,154 Views)
Gavin,
 
We have solved this problem.  Turns out what I thought was a missing link was actualy there -- the drivers provide for registering an interrupt handler.  I think you were trying to tell me that.  The young fellow I have working on this for me kept trying to do it with a combination of timed polling while enabling interrupts.  After a careful discussion on what we really needed to do, he showed me where the driver registers that function.  Properly instructed, he went off, coded the interrupt handler, tested it and it works just fine.
 
Thanks very much for your help. 
 
Gary
0 Kudos
Message 10 of 10
(4,152 Views)