Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-6221 triggering

Hello,

I'm confused about setting up a trigger on the NI-6221.  I have a very simple application.  I want to capture digital waveforms on the receipt of a trigger.

 

I'm getting an error when trying to configure the trigger...

Specified property is not supported by the device or is not applicable to the task
Property: DAQmx_StartTrig_Type
Status Code: -200452

 

The manual clearly says that I should be able to set up and perform digital acquisition from a digital trigger, so I'm not sure why I'm getting that error.

 

Thanks for the help!

 

C++ Code is below:

if ((status = DAQmxCreateTask("", &rdTaskHandle)) != 0)

{

DAQmxGetExtendedErrorInfo(errBuff, 2048);

MessageBoxA(HVQCK::HVQCK_hDlg, errBuff, "DAQmx Error, Create Task",0);

return status;

}

sprintf_s(lines, "%s/port0/line1", HVQCK_DEV);

if ((status = DAQmxCreateDIChan(rdTaskHandle, lines, "", DAQmx_Val_ChanForAllLines)) != 0)

{

DAQmxGetExtendedErrorInfo(errBuff, 2048);

MessageBoxA(HVQCK::HVQCK_hDlg, errBuff, "DAQmx Error, Create DI Channel",0);

return status;

}

sprintf_s(clkTerminal, "%s/di/SampleClock", HVQCK_DEV);

if ((status = DAQmxCfgSampClkTiming(rdTaskHandle, clkTerminal, sampFreq, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, pts)) != 0)

{

DAQmxGetExtendedErrorInfo(errBuff, 2048);

MessageBoxA(HVQCK::HVQCK_hDlg, errBuff, "DAQmx Error, Burst HandShake", 0);

return status;

}

sprintf_s(trigTerminal, "%s/PFI1", HVQCK_DEV);

if ((status = DAQmxCfgDigEdgeStartTrig(rdTaskHandle, trigTerminal, DAQmx_Val_Falling)) != 0)

{

DAQmxGetExtendedErrorInfo(errBuff, 2048);

MessageBoxA(HVQCK::HVQCK_hDlg, errBuff, "DAQmx Error, Config Trigger", 0);

return status;

}

 

0 Kudos
Message 1 of 10
(3,972 Views)

For clarity's sake, here is the functional code with all of the error handling stripped out...

 

DAQmxCreateTask("", &rdTaskHandle)

 

DAQmxCreateDIChan(rdTaskHandle, "Dev3/port0/line1", "", DAQmx_Val_ChanForAllLines)

 

DAQmxCfgSampClkTiming(rdTaskHandle, "Dev3/di/SampleClock",sampFreq, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, pts)

 

DAQmxCfgDigEdgeStartTrig(rdTaskHandle, "Dev3/PFI1",DAQmx_Val_Falling)

 

The error presents when configuring the Start Trigger.

0 Kudos
Message 2 of 10
(3,970 Views)

I can't seem to find where in the manual it said that you could use digital triggering to obtain a digital task. Could you point me to it? When I skimmed the manual, it seemed like you could only use the PFI lines to trigger analog acquisitions.

0 Kudos
Message 3 of 10
(3,929 Views)

Thanks for the reply,

 

I'm looking at the manual: 

DAQ M Series

M Series User Manual

NI 622x, NI 625x, and NI 628x Multifunction I/O Modules and Devices

 

I attached it for convenience.  I'm referring to section 11-1...  Perhaps I'm missing something.

 

Triggering with a Digital Source

Your DAQ device can generate a trigger on a digital signal. You must specify a source and an

edge. The digital source can be any of the PFI, RTSI, or PXI_STAR signals.

The edge can be either the rising edge or falling edge of the digital signal. A rising edge is a

transition from a low logic level to a high logic level. A falling edge is a high to low transition.

Figure 11-1 shows a falling-edge trigger.

Figure 11-1. Falling-Edge Trigger

 

You also can program your DAQ device to perform an action in response to a trigger from a

digital source. The action can affect the following:

• Analog input acquisition

• Analog output generation

• Counter behavior

• Digital waveform acquisition and generation

 

I appreciate the feedback.  Let me know what you think!

0 Kudos
Message 4 of 10
(3,927 Views)

Do you have a LabVIEW development environment to recreate your code in to see if you encounter the same error?  If you see the same error, it could indicate a device issue. However, if you no longer see the error, it could indicate that there is an issue with your C++ Code. This would help us isolate where in the system the problem is arising from. 

0 Kudos
Message 5 of 10
(3,915 Views)

Would LabWindows CVI be useful?

I haven't used LabView in 15 years.

0 Kudos
Message 6 of 10
(3,907 Views)

I put together a quick CVI project to recreate the error.  It's attached.

 

Some other information is:

1. I'm simulating the device.

2. It looks like my NiDAQmx driver is version 9.8.  That looks woefully out of date.  I can try to update that and see if it helps.

 

Let me know if this is helpful!

0 Kudos
Message 7 of 10
(3,906 Views)

Updated my driver to 17.6, and the problem persists unfortunately.

0 Kudos
Message 8 of 10
(3,896 Views)

After taking another look at the manual that you linked for the M Series devices, it seems like there is no independent digital trigger for waveform acquisition. However, the manual does provide a workaround for this. I have quoted it below from page 6-2:

 

"M Series devices do not have an independent DI or DO Start Trigger for digital waveform acquisition or generation. To trigger a DI or DO operation, first select a signal to be the source of DI Sample Clock or DO Sample Clock. Then, generate a trigger that initiates pulses on the source signal. The method for generating this trigger depends on which signal is the source of DI Sample Clock or DO Sample Clock."

 

Looking at the device specifications for the NI-6221, it looks like there are digital triggers for analog I/O functions. You can select the AI Sample Clock to be the source of the DI Sample Clock. As a result, you could use an AI start trigger to trigger the AI Sample Clock and consequently the DI Sample Clock. The DAQ device will sample the DIO lines on each rising or falling edge of the DI Sample Clock.

0 Kudos
Message 9 of 10
(3,882 Views)

Ah, I think I see what needs to happen.  I'll try to build up an experiment to see if I can get that working and report back.

0 Kudos
Message 10 of 10
(3,861 Views)