High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni 5122 - analogue trigger example - does not work

Hi all,
 
I am trying to write a console application that aquires from both channels and is triggered by an analogue signal on channel 0.
 
I am using the following example as a starting point.
 
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Int Clk-Anlg Start
 
Problem 1: I cannot find any documentation for the NI-5122 that lists all the physical channels supported. e.g. the example says Dev1/ai0 by trial and error I found Dev1/0 works. The paper and electronic help that came with the (expensive) card do not have this info a far as I can see.
 
Problem 2: The line to configure the trigger (- containing "DAQmxCfgAnlgEdgeStartTrig") ( I want to trigger off channel 0) returns error -89000 which does not have any associated extended error info. Why ?
 
Problem 3: How would I change to trigger from the external trigger input ?
 
                                Thanks for any help
 
                                                  Derek

/*********************************************/

// DAQmx Configure Code

/*********************************************/

DAQmxErrChk (DAQmxCreateTask(

"",&taskHandle));

DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,

"/Dev1/0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));

DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,

"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));

DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig(taskHandle,

"/Dev1/0",DAQmx_Val_RisingSlope,1.0));

DAQmxErrChk (DAQmxSetAnlgEdgeStartTrigHyst(taskHandle, 1.0));

0 Kudos
Message 1 of 2
(6,433 Views)
(Problem 1)

The 5122 is not really supported under the DAQmx API.  The NI High-Speed Digitizers have their own IVI-compliant API called NI-SCOPE.  You can download the driver here:

http://digital.ni.com/softlib.nsf/websearch/AA7C0BA6562218E9862571CA005CB571?opendocument&node=132060_US

Also, it should have come on CDs packaged with your hardware.

There is an NI-SCOPE example, called ConfiguredAcquisition, that demonstrates exactly what you want to do.  NI-SCOPE also contains comprehensive documentation for the 5122, from both a hardware and software perspective, which you will not find in the DAQmx API.

(Problem 2)

The problem here is that you are configuring the Start Trigger, but what you really want to configure is the Reference Trigger.  The 5122 does not support an Analog Edge Start Trigger, only a Digital Edge or Immediate Start Trigger.  The 5122 DOES support an Analog Edge Reference Trigger.  The reference trigger is the one you want anyway. 

You would run into the same problem using NI-SCOPE if you tried to configure an Analog Edge Start Trigger.  The NI-SCOPE function
niScope_ConfigureTriggerEdge configures the Reference, rather than the Start Trigger by default.

(Problem 3)

To use the external trigger input as the source of the Analog Edge Trigger, the terminal string you want to use is "VAL_EXTERNAL".  That's the name that NI-SCOPE will accept (I'm not sure what the DAQmx name is).


Patrick

Message Edited by psisterhen on 02-02-2007 11:12 AM

0 Kudos
Message 2 of 2
(6,426 Views)