Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

SynchAI-AO example does not work

Solved!
Go to solution

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 Kudos
Message 1 of 3
(3,328 Views)
Solution
Accepted by topic author 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
Message 2 of 3
(3,312 Views)

Hi Brad,

 

Now it works - thank you!

 

Kind regards,

Christian

0 Kudos
Message 3 of 3
(3,304 Views)