Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt-time access to NI GPIB driver

Hi !
 
I need to send a simple message through GPIB (TNT5004) which depends on the measurement obtained on a ADC from a M-series DAQ card. Because of timing requirements (~5kHz), this should be done at interrupt time. (typically a fast PID regulation, with input from a ADC and ouput on a GPIB instrument).
 
I have written a custom driver for the M-series card. The interrupt routine or the associated DPC can be called at frequencies up to ~200kHz, which is OK for my application. Now the point is to access the TNT5004 at interrupt time. Can I access the driver provided by NI from kernel mode, through IoCallDriver calls, which would allow regular user-mode calls to this driver for most common purposes ? In other words, are the GPIB API functions available from kernel mode ?
 
I'd like to avoid writing another custom driver for TNT5004 (which requires NI-488DDK)...
 
Thank you !
 
Fabrice
 
0 Kudos
Message 1 of 2
(3,127 Views)
Hello Fabrice,
 
The driver that NI provides (NI-488.2) does not have any way of calling the driver from the kernel mode.  You are correct that you would have to modify the NI-488.2 DDK to get this to work.
 
I do have some doubts about the ability you will have to run deterministically using any communication bus.  Because GPIB involves handshaking from both the sender and the receiver, you would need complete control over both sides of the GPIB cable to get things to work correctly.  If either side runs into problems (buffer is filled, more time is needed to process messages, time needed to obtain data in response to messages) the communication will be delayed. 
 
I'm sure you have thought about all of this, but I would recommend running in a real-time operating system if you need these fast/deterministic loop times.
 
Thanks,
Steven T.
0 Kudos
Message 2 of 2
(3,098 Views)