From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble using Pause Trigger w/ cDAQ 9188

Hello,

 

I have a cDAQ 9188 chassis and several 9239 modules which I am programming with DAQmx and C.  My application works fine and I'm able to properly log data from all my channels when using software triggering.  However my final application needs to gate the acquisition using an external 0-5V signal, so I am attempting to setup an analog level Pause Trigger on the 9188's PFI0 BNC connector.  The NI 9188 data sheet indicates that it supports Pause Triggers, and the Device Routes table in MAX shows a direct connection is possible between "/NI9188/ai/PauseTrigger" and "/NI9188/PFI0".  Further, if I make a call to "DAQmxGetDevAITrigUsage", a value of 14 is returned, which indicates Pause Trigger is supported.  

 

Here is my basic program flow with the relevant DAQmx calls I am making:

 

  ...create Task...

  ...add 20 analog input channels...

  ...configure for continuous sampling...

 

  DAQmxSetPauseTrigType( (TaskHandle)nTaskHandle, DAQmx_Val_AnlgLvl );
  DAQmxSetAnlgLvlPauseTrigSrc( (TaskHandle)nTaskHandle, "/NI9188/PFI0" );

  DAQmxSetAnlgLvlPauseTrigWhen( (TaskHandle)nTaskHandle, DAQmx_Val_AboveLvl );
  DAQmxSetAnlgLvlPauseTrigLvl( (TaskHandle)nTaskHandle, 3.5 );  // Not concerned w/ hysteresis yet
 

  ...start the Task...

  ...etc...

 

There are no errors returned by these calls.  However, as soon as I start the Task, I receive Error -200265 "An attempt has been made to use an invalid analog trigger source".

 

I've tried several variations on "/NI9188/PFI0", but am really just guessing at this point.  I would appreciate it if anyone has any ideas about what I am doing wrong.

 

Thank you.

0 Kudos
Message 1 of 3
(2,955 Views)

First, the PFI lines are for digital signal routing.  So you will not be able to use analog pause triggering using them.  In the chassis manual (http://www.ni.com/pdf/manuals/372780e.pdf), look under the section: "AI Pause Trigger Signal".  You can still do analog pause triggering, but you will need to use a c Series module that supports Analog Comparison Events.

 

Now about your error:

 

From our DAQmx driver, your error code means:

"An attempt has been made to use an invalid analog trigger source. If you explicitly named the virtual channel using DAQmxBase Create Channel, you must use the name assigned to that channel."

 

In the Measurement and Automation Explorer (MAX), it assigns names to the chassis like "cDAQ1" or simular.  You will need to use that name instead of "NI9188", unless you explicitly named it that yourself in MAX.  So with my example you would use "/cDAQ1/PFI0".  This will NOT work for Analog Pause Triggering though as noted above since PFI lines are for digital signals.

Systems Engineer
SISU
0 Kudos
Message 2 of 3
(2,939 Views)

In my case "NI9188" is correct for the name as it has been re-named in MAX (which correctly populates the Device Routes table with the updated name).  

 

I was able to get this to work using a digital source as the Pause Trigger per page 2-8 of the chassis manual.  The 9188's PFI0 digital input (1-bit A/D converter) is analog enough for this application as I can set the gate signal appropriately from the main HP instrumentation.  I have one spare 9239 analog input channel, so could've logged the gate signal and post-processed the data, but this will cut down greatly on the amount of logged data (19 channels at a high rate times many hours of idle time) and keeps the spare channel available.  Thanks for pointing me in the right direction.

 

For reference purposes, the final DAQmx calls are:

 

...create Task...

...add 20 analog input channels...

...configure for continuous sampling...

 

   DAQmxSetDigLvlPauseTrigSrc( (TaskHandle)nTaskHandle, "/NI9188/PFI0" );    // Routes "/NI9188/PFI0" to "/NI9188/ai/PauseTrigger"
   DAQmxSetPauseTrigType( (TaskHandle)nTaskHandle, DAQmx_Val_DigLvl );
   DAQmxSetDigLvlPauseTrigWhen( (TaskHandle)nTaskHandle, DAQmx_Val_High ); 

 

 

0 Kudos
Message 3 of 3
(2,927 Views)