Showing results for 
Search instead for 
Did you mean: 

VISA Event / Interrupt Handler

I have a VXI chassis with a MXI controller card in slot 0.  I have connected MXI controller card to a dell computer with a MXI-2 PCI card in it.  I am running RHEL4. I am able to get the comparator card to generate a trigger on TTLTRIG0 line (VXI P2 pin 23 RowA).  I have verified via an oscope that the TTLTRIG0 line goes low for approx 2us.  So I believe I am generating the trigger correctly.
I want my C program using VISA to call my handler when the TTLTRIG0 lines goes low.  I am using the following program AsyncTrig.c as a guide. http://zone.ni.com/devzone/cda/epd/p/id/1935
But the C code handler routine never gets called.  Is there something I am missing?  MXI controller board setup? PCI card setup?  Do I need to use IRQ lines instead of TRIG lines?
Any info / help would be greatly appreciated.
0 Kudos
Message 1 of 6


It sounds like you are generating the trigger correctly in the code.  There should not be anything you have to change on the hardware to send/receive the trigger.

Have you tried using a different trigger line besides 0? Triggers 0-7 should be available to use on your system.
What version of Linux kernel build are you running? 
Are you using ECL, TTL, synchronous, or asynchronous for triggering?

Also attached below are several articles that discuss VXI triggering in more detail.


VXI Trigger Tutorial
Triggering with NI-VXI



Andy L.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6


Here is the kernel version I am using. 

Linux ate4 #1 SMP PREEMPT Tue Mar 28 13:28:24 EST 2006 i686 i686 i386 GNU/Linux

Before I continue with linux testing I am going to run the same test on windows to verify my handler gets called when I generate a trigger.

I am going to have to read up on the trigger line information you sent.  I assumed that if I generate a trigger (lines goes low for x us).  Then the MXI driver would see that change and call my handler routine.  I believe I am using TTL because the trigger line is high.  The comparator card drives the TTLTRIG0 line low for approx 2us, and then it goes high again.  Do I need to setup the MXI controller card to see this type of trigger so it will generate an interrupt on the PCI bus?  I was looking in the MXI users manual and found the

VXIbus TTL Trigger Configuration Register (VTCR).  Do I need to modify this register before seeing interrupts?






0 Kudos
Message 3 of 6


I was able to get our example program working with Windows NT and RHEL4 with kernel version 2.6.9-22.0.2.EL.  This poses a problem because we need to use a real-time linux (kernel with prempt patches).  Can you send me information on how we can get National Instruments to support Concurrent real-time linux (redhawk).  It is based on RHEL4.  As I stated in the last post we are using redhawk kernel version  From the MXI driver documentation the latest version of the kernel supported is 2.6.15.  So I am suprised it doesn't work with redhawk kernel version



0 Kudos
Message 4 of 6
Hi Jim,
Sorry that we do not currently have support for real-time linux RHEL4 (redhawk).  I would encourage you to make a product suggestion at ni.com/contact.  Click on the feedback link in the lower left of the page and include as much information about your system as possible so R&D is aware customers are requesting support for Real-Time RHEL4 running Kernel 
Andy L.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 6

Hi everyone,

I am working on a VXI controller VXIPC and Visual C++ 6.0, I stuck on writting code interrupts . Could you please post any sample code for the below, thank you for all the helps from you and others. Sorry! I did not have time to go thru the documents

1- Setup interrupts in NI-VISA for visual C++

2- Interrupt Service Routines for each time the interrupt occurs.

3- ANy other related interrupt code for VXI controller in NI-VISA


Thanks in advance, please help!

0 Kudos
Message 6 of 6