Multifunction DAQ

取消
显示结果 
搜索替代 
您的意思是: 

SynchAI-AO example does not work

已解决!
转到解答

Hi!

 

I am using a USB 6621 and I tried to execute the ANSIC C SynchAI-AO example code shipped with the hardware.

 

First I got the following error message:

 

DAQmx Error: Source terminal to be routed could not be found on the device

 

Make sure the terminal name is valid for the specified device. Refer to

Measurement & Automation Explorer for valid terminal names.

Property: DAQmx_DigEdge_StartTrig_Src

Property: DAQmx_DigEdge_StartTrig_Edge

Source Device: Dev1

Source Terminal: ai/aiStartTrigger

 

Task Name: _unnamedTask<1>

Status Code: -89120

 

Then I changed the following line (the rest of the code remains unmodified):

 

DAQmxErrChk (GetTerminalNameWithDevPrefix(AItaskHandle,"ai/aiStartTrigger",trigName));


to:

 

DAQmxErrChk (GetTerminalNameWithDevPrefix(AItaskHandle,"ai/StartTrigger",trigName));

 

 

Now I get a different error mesage:

 

DAQmx Error: Measurements: Non-buffered hardware-timed operations are not supported for this device an Channel Type.

 

Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or 

set Sample Timing to On Demand.

Task Name: _unnamedTask<1>

 

Status Code: -201025

 

I am little bit confused.

 

Is the execution of this example not possible with my hardware (if so, were can I get information about which example codes work with my hardware and which do not)?

 

Or is there a bug in the exampe code?

 

Thank you in advance for your replies!

 

Kind regards,

Christian

0 项奖励
1 条消息(共 3 条)
3,864 次查看
解答
已被主题作者 Legufix 接受

Hi Christian,

 

Thanks for posting about the problems you found with this example program. Changing "ai/aiStartTrigger" to "ai/StartTrigger" is correct. The problem that is causing error -201025 is a missing line of code (which goes right below the call to GenSineWave()):

 

DAQmxErrChk (DAQmxWriteAnalogF64(AOtaskHandle, 1000, FALSE, 10.0, DAQmx_Val_GroupByChannel, AOdata, NULL, NULL));
 

Once you add that line, it should work (tested with a USB-6229; I assume you have a USB-6221?). These problems have been reported to R&D as CAR #181942.

 

Brad

---
Brad Keryan
NI R&D
2 条消息(共 3 条)
3,848 次查看

Hi Brad,

 

Now it works - thank you!

 

Kind regards,

Christian

0 项奖励
3 条消息(共 3 条)
3,840 次查看