01-21-2010 10:33 AM
Hello
I'm using the PCI-6259 M series multifunction DQ board on a linux box (SLES 10.2) and am using the ansi_c api and the driver is NI KAL 1.4. My application requires 10 analog inputs, 8 digital inputs 8 digital outputs and all 4 analog outputs to interface with a piece of HW in real-time. Currently I am doing straight software timing meaning I am not using the DAQmxCfgSampTiming call but am doing "on demand" sampling at a hw controlled 1 ms interval using the NI read/write api calls. I use 4 NIDaq tasks (analog input/output,digital input/output). I was attempting to add a analog input trigger to my system to mark a specifi event. Here's what I want to do and after reading the NI documentation I don't think I can do this. Please correct me if I am wrong.
I want to keep the software timing mentioned above in place. I want to add to my analog input task a trigger event for APFI1 and assign to it a callback function when the event accurs. From the examples that comes with the driver (Acq-IntClk-AnlgStart) it looks like the trigger is mainly used to control WHEN the sampling occurs in the task. There looks to be no way to assign a callback specifically to a trigger event. Again, I want to keep my software timing described above and only want to be notified through a callback when my APF1 event has occurred. Hope I've described this adequately.
Kevin
01-22-2010 11:17 PM
Hi Kevin,
If you refer to the NI-DAQmx C Reference Help, you should find a section on Software Events. It describes setting up a callback function to occur based on an event. The closest one to what you are looking for is the DAQmxRegisterSignalEvent function. However, I do not believe this will work for you as you are trying to use an analog trigger whereas this function detects digital edges.
The only other suggestion I have is to compare your analog input values as you read them and evaluate for a certain level but I don't know how this would affect your timing.
Unfortunately this was all I could come up with but maybe others have a better idea.
01-25-2010 02:35 PM
Joe Friedchicken
NI Configuration Based Software Get with your fellow OS users
[ Linux ] [ macOS ]Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
01-26-2010 08:03 AM
All
Thank's for the responses. You've answered my question. I wanted to avoid doing the change detect in my application as I'm already taking about 100 microseconds to do the "on demand" reading of the analog inputs mentioned above. I was hoping to farm off the triggering functionality to the NI card as I figured it would have better respnse. I will check out Joe's suggestion of routing the analog output to a digital input and then use change detect to fire the callback. I'm curious if I can also get the value of the analog signal that caused the trigger, looking into this now, and also the X-series cards.
Kevin
01-26-2010 08:47 AM
Joe Friedchicken
NI Configuration Based Software Get with your fellow OS users
[ Linux ] [ macOS ]Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)