01-22-2010 10:23 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 external 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'm not sure I can accomplish this with the NI ansi_c API
I want to keep the software timing mentioned above in place which is making simple DAQmxRead/Write calls at that above specified 1 ms interval. I want to ADD to my analog input task a trigger event for APFI1 and assign to it a callback function when the trigger condition occurs. From the examples that comes with the driver (Acq-IntClk-AnlgStart) it looks like the event callbacks are tied to the TASK NOT the trigger. I don't see how I tie the event callbacks in the API to a specific trigger not the whole task. I need to be able to access my other anlog inputs "on demand" but want my trigger to fire a callback when the trigger condition occurs. Also if this is possible what is the latency between the hw event and the execution of the callback?
Kevin
01-25-2010 01:51 PM
I think the issue you are experiencing here is that triggers can only reference a TASK not a specific CHANNEL. This is because the timing engine (even if software timed) is shared for the whole task.
A possible workaround here would be to implement your own trigger with doing some software compares once the data is acquired and dumping all the data you don't care about.
You could also get an X-Series card which can support up to 3 analog input tasks simultaneously so you could create a task for your triggerable channel and one for all the others.
01-25-2010 02:36 PM
This is a cross-post. See my reply here:
triggers using nidaq-mx
http://forums.ni.com/ni/board/message?board.id=250&view=by_date_ascending&message.id=54949#M54949
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)