Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DSA Sample Clock Timebase synchronization doesn't work.

I have started using Visual Studio for ANSI C a few week ago. I am using NI cDAQ-9178 equipment, NI9227 module for current measurement, and NI9239 module for voltage measurement. I am trying to get synchronization work for 2 current channels in NI9227 (cDAQMod1/ai0: cDAQMod1/ai1) and 2 voltage channels in NI9239 (cDAQMod2/ai0: cDAQMod2/ai1).

 

I tried DSA Sample Clock Timebase synchronization. It doesn't work. 
Here's the error message I get:

"DAQmx Error: Requested value is not a supported value for this property. The
property value may be invalid because it conflicts with another property.
Property: DAQmx_SampClk_Timebase_Rate
Requested Value: 80.0e6
Possible Values: 1.0e6 to 13.150000e6
Device: cDAQ2"

What does "requested value" and "possible values" mean? I don't have any
parameters in 80.0e6, is this some value in the system? 

0 Kudos
Message 1 of 4
(5,185 Views)

Hello;

 

It is possible that the task is not configured correctly. Can you post at least that section of the code so we can check it?

0 Kudos
Message 2 of 4
(5,158 Views)

I used the example code from national instrument , I tried National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\Finite AI, and \National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\DSA Shared Timebase And Trig-AI and AO. They all end up with the same Error. 

 

I did not change the code, except Device Name and synchronizationType. I changed synchronizationType to be 0 for Sample Clock.

 

Here's a part of code for DSA Shared Timebase And Trig-AI and AO:

 

DAQmxErrChk (DAQmxCreateTask("Master input task",&gMasterAItaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(gMasterAItaskHandle,"cDAQ2Mod2/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,0));
DAQmxErrChk (DAQmxCfgSampClkTiming(gMasterAItaskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

 

DAQmxErrChk (DAQmxCreateTask("Master output task",&gMasterAOtaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(gMasterAOtaskHandle,"cDAQ2Mod2/ai1","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,0));
DAQmxErrChk (DAQmxCfgSampClkTiming(gMasterAOtaskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

 

DAQmxErrChk (DAQmxCreateTask("Slave input task",&gSlaveAItaskHandle));
DAQmxErrChk (DAQmxCreateAICurrentChan(gSlaveAItaskHandle,"cDAQ2Mod1/ai0","",DAQmx_Val_Cfg_Default,0.0,2.0,DAQmx_Val_Amps,DAQmx_Val_Internal,249,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(gSlaveAItaskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

 

DAQmxErrChk (DAQmxCreateTask("Slave output task",&gSlaveAOtaskHandle));
DAQmxErrChk (DAQmxCreateAICurrentChan(gSlaveAOtaskHandle,"cDAQ2Mod1/ai1","",DAQmx_Val_Cfg_Default,0.0,2.0,DAQmx_Val_Amps,DAQmx_Val_Internal,249,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(gSlaveAOtaskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

 

 

 

0 Kudos
Message 3 of 4
(5,153 Views)

Here's a the code of FiniteAI in an easier version:

 

DAQmxErrChk (DAQmxCreateTask("",&masterTaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(masterTaskHandle,"cDAQ2Mod2/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(masterTaskHandle,"",50000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));
DAQmxErrChk (DAQmxCreateTask("",&slaveTaskHandle));
DAQmxErrChk (DAQmxCreateAICurrentChan(slaveTaskHandle,"cDAQ2Mod1/ai1","",DAQmx_Val_Cfg_Default,0.0,2.0,DAQmx_Val_Amps,DAQmx_Val_Internal,249,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(slaveTaskHandle,"",50000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));

 

DAQmxErrChk(DAQmxSetSampClkTimebaseSrc(slaveTaskHandle,"/cDAQ2/SampleClockTimebase"));
DAQmxErrChk(DAQmxSetSyncPulseSrc(slaveTaskHandle, "/cDAQ2/SyncPulse"));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(slaveTaskHandle,"/cDAQ2/ai/StartTrigger",DAQmx_Val_Rising));

0 Kudos
Message 4 of 4
(5,152 Views)