+ All Categories
Home > Documents > NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call...

NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call...

Date post: 19-Aug-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
948
DAQmxAddGlobalChansToTask int32 DAQmxAddGlobalChansToTask (TaskHandle taskHandle, const char channelNames[]);
Transcript
Page 1: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAddGlobalChansToTaskint32DAQmxAddGlobalChansToTask(TaskHandletaskHandle,constchar

channelNames[]);

Page 2: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAddsglobalvirtualchannelsfromMAXtothegiventask.

Page 3: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle ThetasktowhichtoaddthechannelsfromMAX.

channelNames constchar[] Thechannelstoaddtothetask.Youcanspecifyalistorrangeofchannels.ThesechannelsmustbevalidchannelsavailablefromMAX.Ifyoupassaninvalidchannel,NI-DAQmxreturnsanerror.Thisvalueisignoredifitisempty.

Page 4: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 5: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxClearTaskint32DAQmxClearTask(TaskHandletaskHandle);

Page 6: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeClearsthetask.Beforeclearing,thisfunctionstopsthetask,ifnecessary,andreleasesanyresourcesreservedbythetask.Youcannotuseataskonceyouclearthetaskwithoutrecreatingorreloadingthetask.IfyouusetheDAQmxCreateTaskfunctionoranyoftheNI-DAQmxCreateChannelfunctionswithinaloop,usethisfunctionwithintheloopafteryoufinishwiththetasktoavoidallocatingunnecessarymemory.

Page 7: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoclear.

Page 8: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 9: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTaskint32DAQmxCreateTask(constchartaskName[],TaskHandle*taskHandle);

Page 10: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesatask.Ifyouusethisfunctiontocreateatask,youmustuseDAQmxClearTasktodestroyit.Ifyouusethisfunctionwithinaloop,NI-DAQmxcreatesanewtaskineachiterationoftheloop.UsetheDAQmxClearTaskfunctionwithintheloopafteryoufinishwiththetasktoavoidallocatingunnecessarymemory.

Page 11: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskName constchar[] Nameassignedtothetask.

NoteThisnamemaybechangedinternally.IfyouareusingtheCAPI,callDAQmxGetTaskNametoverifywhetherthenamewaschangedduringcreation.IfyouareusingtheCVIAPI,callDAQmxGetTaskAttributewithattributeIDDAQmx_Task_Nametoverifythenamechange.

Output

Name Type Description

taskHandle TaskHandle* Areferencetothetaskcreatedinthisfunction.

Page 12: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 13: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxIsTaskDoneint32DAQmxIsTaskDone(TaskHandletaskHandle,bool32*isTaskDone);

Page 14: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeQueriesthestatusofthetaskandindicatesifitcompletedexecution.Usethisfunctiontoensurethatthespecifiedoperationiscompletebeforeyoustopthetask.

Page 15: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

Output

Name Type Description

isTaskDone bool32* Indicateswhetherthemeasurementorgenerationcompleted.

Page 16: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 17: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxLoadTaskint32DAQmxLoadTask(constchartaskName[],TaskHandle*taskHandle);

Page 18: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeLoadsanexistingnamedtaskfromMeasurement&AutomationExplorer(MAX).Ifyouusethisfunctiontoloadatask,youmustuseDAQmxClearTasktodestroyit.

Page 19: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskName constchar[] AnamedtaskinMAX.

Output

Name Type Description

taskHandle TaskHandle* Areferencetothetaskreturnedbythisfunction.

Page 20: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 21: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxStartTaskint32DAQmxStartTask(TaskHandletaskHandle);

Page 22: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeTransitionsthetaskfromthecommittedstatetotherunningstate,whichbeginsmeasurementorgeneration.Usingthisfunctionisrequiredforsomeapplicationsandoptionalforothers.Ifyoudonotusethisfunction,ameasurementtaskstartsautomaticallywhenareadoperationbegins.TheautoStartparameteroftheNI-DAQmxWritefunctionsdeterminesifagenerationtaskstartsautomaticallywhenyouuseanNI-DAQmxWritefunction.IfyoudonotcallDAQmxStartTaskandDAQmxStopTaskwhenyoucallNI-DAQmxReadfunctionsorNI-DAQmxWritefunctionsmultipletimes,suchasinaloop,thetaskstartsandstopsrepeatedly.Startingandstoppingataskrepeatedlyreducestheperformanceoftheapplication.

Page 23: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktostart.

Page 24: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 25: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxStopTaskint32DAQmxStopTask(TaskHandletaskHandle);

Page 26: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeStopsthetaskandreturnsittothestateitwasinbeforeyoucalledDAQmxStartTaskorcalledanNI-DAQmxWritefunctionwithautoStartsettoTRUE.IfyoudonotcallDAQmxStartTaskandDAQmxStopTaskwhenyoucallNI-DAQmxReadfunctionsorNI-DAQmxWritefunctionsmultipletimes,suchasinaloop,thetaskstartsandstopsrepeatedly.Startingandstoppingataskrepeatedlyreducestheperformanceoftheapplication.

Page 27: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktostop.

Page 28: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 29: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxRegisterDoneEventint32DAQmxRegisterDoneEvent(TaskHandletaskHandle,uInt32options,

DAQmxDoneEventCallbackPtrcallbackFunction,void*callbackData);

Page 30: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRegistersacallbackfunctiontoreceiveaneventwhenataskstopsduetoanerrororwhenafiniteacquisitiontaskorfinitegenerationtaskcompletesexecution.ADoneeventdoesnotoccurwhenataskisstoppedexplicitly,suchasbycallingDAQmxStopTask.

Page 31: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

options uInt32 Usethisparametertosetcertainoptions.Youcancombineflagswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value0

DAQmx_Val_SynchronousEventCallbacks

NoteIfyouarereceivingsynchronouseventsfasterthanyouareprocessingthem,thentheuserinterfaceofyourapplicationmightbecomeunresponsive.

callbackFunction DAQmxDoneEventCallbackPtr ThefunctionthatyouwantDAQmxtocallwhentheeventoccurs.Thefunctionpassinthisparametermusthavethefollowingprototype:int32CVICALLBACKCallback(TaskHandletaskHandle,int32

Page 32: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

*callbackData);Uponentrytothecallback,thetaskHandleparametercontainsonwhichtheeventoccurred.Thestatusparametercontainsthestatusofthetaskwhentheeventoccurred.Ifthestatusvalueisnegative,itindicatesanerror.statusvalueiszero,itindicatesnoerror.Ifthestatusvalueispositive,itindicatesawarning.ThecallbackDataparametercontainsthevalueyoupassedinthecallbackDataparameterofthisfunction.

callbackData void* AvaluethatyouwantDAQmxtopasstothecallbackfunctionasthefunctiondataparameter.Donotpasstheaddressofalocalvariableoranyothervariablethatmightnotbevalidwhenthefunctionisexecuted.

Page 33: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 34: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxRegisterEveryNSamplesEventint32DAQmxRegisterEveryNSamplesEvent(TaskHandletaskHandle,int32

everyNsamplesEventType,uInt32nSamples,uInt32options,DAQmxEveryNSamplesEventCallbackPtrcallbackFunction,void*callbackData);

Page 35: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRegistersacallbackfunctiontoreceiveaneventwhenthespecifiednumberofsamplesiswrittenfromthedevicetothebufferorfromthebuffertothedevice.Thisfunctiononlyworkswithdevicesthatsupportbufferedtasks.Whenyoustopataskexplicitlyanypendingeventsarediscarded.Forexample,ifyoucallDAQmxStopTaskthenyoudonotreceiveanypendingevents.

Page 36: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

everyNsamplesEventType int32 Thetypeofeventyouwanttoreceive.

ValueDAQmx_Val_Acquired_Into_Buffer

DAQmx_Val_Transferred_From_Buffer

Page 37: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

nSamples uInt32 Thenumberofsamplesafterwhicheacheventshouldoccur.

options uInt32 Usethisparametertosetcertainoptions.Youcancombineflagswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value0

DAQmx_Val_SynchronousEventCallbacks

NoteIfyouarereceivingsynchronouseventsfasterthanyouareprocessingthem,thentheuserinterfaceofyourapplicationmightbecomeunresponsive.

callbackFunction DAQmxEveryNSamplesEventCallbackPtr ThefunctionthatyouwantDAQmxtocallwhentheeventoccurs.Thefunctionpassinthisparametermusthavethefollowingprototype:int32CVICALLBACKCallback(TaskHandletaskHandle,int32everyNsamplesEventType,uInt32nSamples,void*callbackData);Uponentrytothecallback,thetaskHandleonwhichtheeventoccurred.TheeveryNSamplesEventTypevalueyoupassedintheeveryNSamplesEventTypenSamplesparametercontainsthevalueyoupassedinthethisfunction.ThecallbackDataparametercontainsthevalueyoupassedinthecallbackDataparameterofthisfunction.

Page 38: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

callbackData void* AvaluethatyouwantDAQmxtopasstothecallbackfunctionasthefunctiondataparameter.Donotpasstheaddressofalocalvariableoranyothervariablethatmightnotbevalidwhenthefunctionisexecuted.

Page 39: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 40: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxRegisterSignalEventint32DAQmxRegisterSignalEvent(TaskHandletaskHandle,int32signalID,

uInt32options,DAQmxSignalEventCallbackPtrcallbackFunction,void*callbackData);

Page 41: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRegistersacallbackfunctiontoreceiveaneventwhenthespecifiedhardwareeventoccurs.Whenyoustopataskexplicitlyanypendingeventsarediscarded.Forexample,ifyoucallDAQmxStopTaskthenyoudonotreceiveanypendingevents.

Page 42: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

signalID int32 Thesignalforwhichyouwanttoreceiveresults.

ValueDAQmx_Val_SampleClockDAQmx_Val_SampleCompleteEvent

DAQmx_Val_ChangeDetectionEvent

DAQmx_Val_CounterOutputEvent

options uInt32 Usethisparametertosetcertainoptions.Youcancombineflagswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value0

DAQmx_Val_SynchronousEventCallbacks

Page 43: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

NoteIfyouarereceivingsynchronouseventsfasterthanyouareprocessingthem,thentheuserinterfaceofyourapplicationmightbecomeunresponsive.

callbackFunction DAQmxSignalEventCallbackPtr ThefunctionthatyouwantDAQmxtocallwhentheeventoccurs.Thefunctionpassinthisparametermusthavethefollowingprototype:int32CVICALLBACKCallback(TaskHandletaskHandle,int32*callbackData);Uponentrytothecallback,thetaskHandleparametercontainsonwhichtheeventoccurred.ThesignalIDparametercontainsthevalueyoupassedinthesignalIDparameterofthisfunction.ThecallbackDatavalueyoupassedinthecallbackDataparameterofthisfunction.

callbackData void* AvaluethatyouwantDAQmxtopasstothecallbackfunctionasthefunctiondataparameter.Donotpasstheaddressofalocalvariableoranyothervariablethatmightnotbevalidwhenthefunctionisexecuted.

Page 44: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 45: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetNthTaskChannelint32DAQmxGetNthTaskChannel(TaskHandletaskHandle,uInt32index,char

buffer[],int32bufferSize);

Page 46: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnstheNthchannel.ThisfunctiontakesthetaskHandle,index,andbufferSizeyouspecifyandreturnstheNthchannel.

Page 47: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

index uInt32 TheNthchannelyouwanttoreturn.Theindexstartsat1.

bufferSize int32 Thesize,inbytes,ofbuffer.Ifyoupass0,thisfunctionreturnsthenumberofbytesneededtoallocate.

Output

buffer char[] TheNthchannelintheindex.IfyoupassNULL,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 48: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 49: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetNthTaskDeviceint32DAQmxGetNthTaskDevice(TaskHandletaskHandle,uInt32index,char

buffer[],int32bufferSize);

Page 50: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnstheNthdevice.ThisfunctiontakesthetaskHandle,index,andbufferSizeyouspecifyandreturnstheNthdevice.

Page 51: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

index uInt32 TheNthdeviceyouwanttoreturn.Theindexstartsat1.

bufferSize int32 Thesize,inbytes,ofbuffer.Ifyoupass0,thisfunctionreturnsthenumberofbytesneededtoallocate.

Output

buffer char[] TheNthdeviceintheindex.IfyoupassNULL,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 52: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 53: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxTaskControlint32DAQmxTaskControl(TaskHandletaskHandle,int32action);

Page 54: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAltersthestateofataskaccordingtotheactionyouspecify.Tominimizethetimerequiredtostartatask,forexample,DAQmxTaskControlcancommitthetaskpriortostarting.

Page 55: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

action int32 Specifieshowtoalterthetaskstate.

Value DescriptionDAQmx_Val_Task_Start Startsexecutionofthe

task.DAQmx_Val_Task_Stop Stopsexecutionofthe

task.DAQmx_Val_Task_Verify Verifiesthatalltask

parametersarevalidforthehardware.

DAQmx_Val_Task_Commit Programsthehardwareasmuchaspossibleaccordingtothetaskconfiguration.

DAQmx_Val_Task_Reserve Reservesthehardwareresourcesneededforthetask.Noothertaskscanreservethesesameresources.

DAQmx_Val_Task_Unreserve Releasesallpreviouslyreservedresources.

DAQmx_Val_Task_Abort Abortisusedtostopanoperation,suchasReadorWrite,thatiscurrentlyactive.Abortputsthetaskintoanunstablebutrecoverablestate.Torecoverthetask,callStarttorestartthetask

Page 56: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

orcallStoptoresetthetaskwithoutstartingit.

Page 57: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 58: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIAccelChanint32DAQmxCreateAIAccelChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,float64sensitivity,int32sensitivityUnits,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 59: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanaccelerometertomeasureaccelerationandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 60: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnaccelerationmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_AccelUnit_g G.1gis

approximatelyequalto9.81m/s

DAQmx_Val_FromCustomScale Unitsspecifiedbyacustomscale.UsecustomScaleNametospecifyacustom

Page 61: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

scale.

sensitivity float64 Thesensitivityofthesensor.ThisvalueisintheunitsyouspecifywithsensitivityUnits.Refertothesensordocumentationtodeterminethisvalue.

sensitivityUnits int32 Theunitsofsensitivity.

Name DescriptionDAQmx_Val_mVoltsPerG mVolts/g.DAQmx_Val_VoltsPerG Volts/g.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 62: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 63: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAICurrentChanint32DAQmxCreateAICurrentChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32shuntResistorLoc,float64extShuntResistorVal,constcharcustomScaleName[]);

Page 64: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)forcurrentmeasurementandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 65: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminal

configurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Amps amperesDAQmx_Val_FromCustomScale Unitsacustom

scale

specifies.Ifyouselectthisvalue,

Page 66: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

youmustspecifyacustomscalename.

shuntResistorLoc int32 Thelocationoftheshuntresistor.

Value DescriptionDAQmx_Val_Default Atruntime,NI-

DAQmxchoosesthedefaultshuntresistorlocationforthechannel.

DAQmx_Val_Internal Usethebuilt-inshuntresistorofthedevice.

DAQmx_Val_External Useashuntresistorexternaltothedevice.YoumustspecifythevalueoftheshuntresistorinextShuntResistorVal.

extShuntResistorVal float64 Thevalue,inohms,ofanexternalshuntresistor.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitstoDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 67: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 68: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAICurrentRMSChanint32DAQmxCreateAICurrentRMSChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32shuntResistorLoc,float64extShuntResistorVal,constcharcustomScaleName[]);

Page 69: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)forRMScurrentmeasurementandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 70: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminal

configurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Amps amperesDAQmx_Val_FromCustomScale Unitsacustom

scale

specifies.Ifyouselectthisvalue,

Page 71: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

youmustspecifyacustomscalename.

shuntResistorLoc int32 Thelocationoftheshuntresistor.

Value DescriptionDAQmx_Val_Default Atruntime,NI-

DAQmxchoosesthedefaultshuntresistorlocationforthechannel.

DAQmx_Val_Internal Usethebuilt-inshuntresistorofthedevice.

DAQmx_Val_External Useashuntresistorexternaltothedevice.YoumustspecifythevalueoftheshuntresistorinextShuntResistorVal.

extShuntResistorVal float64 Thevalue,inohms,ofanexternalshuntresistor.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitstoDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 72: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 73: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIFreqVoltageChanint32DAQmxCreateAIFreqVoltageChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,float64thresholdLevel,float64hysteresis,constcharcustomScaleName[]);

Page 74: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseafrequency-to-voltageconvertertomeasurefrequencyandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 75: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_Hz hertzDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

thresholdLevel float64 Thevoltagelevelatwhichtorecognizewaveformrepetitions.

hysteresis float64 SpecifiesinvoltsawindowbelowthresholdLevel.TheinputvoltagemustpassbelowthresholdLevelminushysteresisbeforeNI-DAQmxrecognizesawaveformrepetition.Hysteresiscanimprovemeasurementaccuracywhenthesignalcontainsnoiseorjitter.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 76: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 77: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIMicrophoneChanint32DAQmxCreateAIMicrophoneChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,int32units,float64micSensitivity,float64maxSndPressLevel,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 78: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseamicrophonetomeasuresoundpressureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 79: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

units int32 Theunitstousetoreturnsoundpressuremeasurements.

Name DescriptionDAQmx_Val_Pascals pascalsDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

micSensitivity float64 Thesensitivityofthemicrophone.Specifythisvalueinmillivoltsperpascal.

maxSndPressLevel float64 Themaximuminstantaneoussoundpressurelevelyouexpecttomeasure.Thisvalueisindecibels,referencedto20micropascals.

Page 80: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 81: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 82: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIResistanceChanint32DAQmxCreateAIResistanceChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 83: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatechannel(s)tomeasureresistanceandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 84: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_Ohms ohmsDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusecurrentExcitValtospecifytheamountof

Page 85: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

excitation.DAQmx_Val_External Useanexcitationsource

otherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 86: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 87: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIRTDChanint32DAQmxCreateAIRTDChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32rtdType,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal,float64r0);

Page 88: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanRTDtomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 89: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

rtdType int32 ThetypeofRTDconnectedtothechannel.

Value DescriptionDAQmx_Val_Pt3750 Pt3750DAQmx_Val_Pt3851 Pt3851DAQmx_Val_Pt3911 Pt3911DAQmx_Val_Pt3916 Pt3916DAQmx_Val_Pt3920 Pt3920DAQmx_Val_Pt3928 Pt3928DAQmx_Val_Custom Youmustspecifythe

'A','B',and'C'constantsfortheCallendar-VanDusenequation

Page 90: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

r0 float64 Thesensorresistanceinohmsat0degCfortheCallendar-VanDusenequationRefertothesensordocumentationtodeterminethisvalue.

Page 91: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 92: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIStrainGageChanint32DAQmxCreateAIStrainGageChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32strainConfig,int32voltageExcitSource,float64voltageExcitVal,float64gageFactor,float64initialBridgeVoltage,float64nominalGageResistance,float64poissonRatio,float64leadWireResistance,constcharcustomScaleName[]);

Page 93: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurestrainandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 94: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_Strain StrainDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

strainConfig int32 Thestraingagebridgeconfiguration.

Value DescriptionDAQmx_Val_FullBridgeI Fouractivegages

withtwopairssubjectedtoequalandoppositestrains.

DAQmx_Val_FullBridgeII FouractivegageswithtwoalignedwithmaximumprincipalstrainandtwoPoissongages

Page 95: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

inadjacentarms.DAQmx_Val_FullBridgeIII Fouractivegages

withtwoalignedwithmaximumprincipalstrainandtwoPoissongagesinoppositearms.

DAQmx_Val_HalfBridgeI TwoactivegageswithonealignedwithmaximumprincipalstrainandonePoissongage.

DAQmx_Val_HalfBridgeII Twoactivegageswithequalandoppositestrains.

DAQmx_Val_QuarterBridgeI Singleactivegage.DAQmx_Val_QuarterBridgeII Singleactivegage

andonedummygage.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensor

Page 96: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

requiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

gageFactor float64 Thesensitivityofthestraingagesandrelatesthechangeinelectricalresistancetothechangeinstrain.Eachgageinthebridgemusthavethesamegagefactor.Refertothesensordocumentationtodeterminethisvalue.

initialBridgeVoltage float64 Thebridgeoutputvoltageintheunloadedcondition.NI-DAQmxsubtractsthisvaluefromanymeasurementsbeforeapplyingscalingequations.Performavoltagemeasurementonthebridgewithnostrainappliedtodeterminethisvalue.

nominalGageResistance float64 Theresistance,inohms,ofthegagesinanunstrainedposition.Eachgageinthebridgemusthavethesamenominalgageresistance.Theresistanceacrossarmsofthebridgethatdonothavestraingagesmustalsobethesameasthenominalgageresistance.Refertothesensordocumentationtodeterminethisvalue.

poissonRatio float64 Theratiooflateralstraintoaxialstraininthematerialinwhichyoumeasurestrain.

leadWireResistance float64 Theamount,inohms,ofresistanceintheleadwires.Ideally,thisvalueisthesameforallleads.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 97: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 98: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAITempBuiltInSensorChanint32DAQmxCreateAITempBuiltInSensorChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],int32units);

Page 99: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasuretemperaturewithabuilt-insensorofaterminalblockordeviceandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.OnSCXImodules,forexample,thiscouldbetheCJCsensor.

Page 100: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

Page 101: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 102: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIThrmcplChanint32DAQmxCreateAIThrmcplChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32thermocoupleType,int32cjcSource,float64cjcVal,constcharcjcChannel[]);

Page 103: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermocoupletomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 104: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

thermocoupleType int32 Thetypeofthermocoupleconnectedtothechannel.

Value DescriptionDAQmx_Val_J_Type_TC J-type

thermocouple.DAQmx_Val_K_Type_TC K-type

thermocouple.DAQmx_Val_N_Type_TC N-type

thermocouple.DAQmx_Val_R_Type_TC R-type

thermocouple.DAQmx_Val_S_Type_TC S-type

thermocouple.

Page 105: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_T_Type_TC T-typethermocouple.

DAQmx_Val_B_Type_TC B-typethermocouple.

DAQmx_Val_E_Type_TC E-typethermocouple.

cjcSource int32 Thesourceofcoldjunctioncompensation.

Value DescriptionDAQmx_Val_BuiltIn Useacold-

junctioncompensationchannelbuiltintotheterminalblock.

DAQmx_Val_ConstVal Youmustspecifythecold-junctiontemperature.

DAQmx_Val_Chan Useachannelforcold-junctioncompensation.

cjcVal float64 ThetemperatureofthecoldjunctionofthethermocoupleifyousetcjcSourcetoDAQmx_Val_ConstVal.

cjcChannel constchar[] Thechannelthatacquiresthetemperatureofthethermocouplecold-junctionifyousetcjcSourcetoDAQmx_Val_Chan.Youcanuseaglobalchanneloranothervirtualchannelalreadyinthetask.Ifthechannelisatemperaturechannel,NI-DAQmxacquiresthetemperatureinthecorrectunits.Otherchanneltypes,suchasaresistancechannelwithacustomsensor,mustuseacustomscaletoscalevaluestodegreesCelsius.

Page 106: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 107: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIThrmstrChanIexint32DAQmxCreateAIThrmstrChanIex(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal,float64a,float64b,float64c);

Page 108: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermistortomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Usethisfunctionwhenthethermistorrequirescurrentexcitation.

Page 109: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusecurrentExcitVal

Page 110: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

tospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

a float64 TheAconstantfromtheSteinhart-Hartthermistorequation.

b float64 TheBconstantfromtheSteinhart-Hartthermistorequation.

c float64 TheCconstantfromtheSteinhart-Hartthermistorequation.

Page 111: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 112: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIThrmstrChanVexint32DAQmxCreateAIThrmstrChanVex(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32voltageExcitSource,float64voltageExcitVal,float64a,float64b,float64c,float64r1);

Page 113: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermistortomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Usethisfunctionwhenthethermistorrequiresvoltageexcitation.

Page 114: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusevoltageExcitValto

Page 115: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

specifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

a float64 TheAconstantfromtheSteinhart-Hartthermistorequation.

b float64 TheBconstantfromtheSteinhart-Hartthermistorequation.

c float64 TheCconstantfromtheSteinhart-Hartthermistorequation.

r1 float64 Thevalue,inohms,ofthereferenceresistor.

Page 116: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 117: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIVoltageChanint32DAQmxCreateAIVoltageChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 118: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurevoltageandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Ifyourmeasurementrequirestheuseofinternalexcitationoryouneedthevoltagetobescaledbyexcitation,callDAQmxCreateAIVoltageChanWithExcit.

Page 119: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthevoltagemeasurements.

Name DescriptionDAQmx_Val_Volts voltsDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.Ifyoudonotsetunits

Page 120: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 121: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 122: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIVoltageRMSChanint32DAQmxCreateAIVoltageRMSChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 123: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasureRMSvoltageandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Ifyourmeasurementrequirestheuseofinternalexcitationoryouneedthevoltagetobescaledbyexcitation,callDAQmxCreateAIVoltageChanWithExcit.

Page 124: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthevoltagemeasurements.

Name DescriptionDAQmx_Val_Volts voltsDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.Ifyoudonotsetunits

Page 125: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 126: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 127: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIVoltageChanWithExcitint32DAQmxCreateAIVoltageChanWithExcit(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32bridgeConfig,int32voltageExcitSource,float64voltageExcitVal,bool32useExcitForScaling,constcharcustomScaleName[]);

Page 128: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurevoltageandaddsthechannelstothetaskyouspecifywithtaskHandle.Usethisinstanceforcustomsensorsthatrequireexcitation.Youcanchoosetousetheexcitationtoscalethemeasurement.

Page 129: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthevoltagemeasurements.

Name DescriptionDAQmx_Val_Volts voltsDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

bridgeConfig int32 ThetypeofWheatstonebridgethesensoris.

Page 130: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

Value DescriptionDAQmx_Val_FullBridge Sensorisafull

bridge.IfyousetuseExcitForScalingtoTRUE,NI-DAQmxdividesthemeasurementbytheexcitationvalue.Manysensorsscaledatatonativeunitsusingscalingofvoltsperexcitation.

DAQmx_Val_HalfBridge Sensorisahalfbridge.IfyousetuseExcitForScalingtoTRUE,NI-DAQmxdividesthemeasurementbytheexcitationvalue.Manysensorsscaledatatonativeunitsusingscalingofvoltsperexcitation.

DAQmx_Val_QuarterBridge Sensorisaquarterbridge.IfyousetuseExcitForScalingtoTRUE,NI-DAQmxdividesthemeasurementbytheexcitationvalue.Manysensorsscaledatatonativeunitsusingscalingofvoltsperexcitation.

DAQmx_Val_NoBridge SensorisnotaWheatstonebridge.

voltageExcitSource int32 Thesourceofexcitation.

Page 131: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

useExcitForScaling bool32 SpecifieswhetherNI-DAQmxdividesthemeasurementbytheexcitation.YoushouldtypicallysetuseExcitForScalingtoTRUEforratiometrictransducers.IfyousetuseExcitForScalingtoTRUE,setmaxValandminValtoreflectthescaling.Forexample,ifyouexpecttoacquireavoltagebetween-5and5,andyouuseanexcitationof.10voltstoscalethemeasurement,setminValto-50andsetmaxValto50.IfyousetbridgeConfigtoDAQmx_Val_NoBridge,useExcitForScalinghasnoeffectonthemeasurement.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 132: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 133: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIPosLVDTChanint32DAQmxCreateAIPosLVDTChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,float64sensitivity,int32sensitivityUnits,int32voltageExcitSource,float64voltageExcitVal,float64voltageExcitFreq,int32ACExcitWireMode,constcharcustomScaleName[]);

Page 134: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanLVDTtomeasurelinearpositionandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 135: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyarangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnlinearpositionmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_Meters MetersDAQmx_Val_Inches InchesDAQmx_Val_FromCustomScale Unitsacustomscale

specifies.UsecustomScaleNamespecifyacustomscale.

sensitivity float64 Thesensitivityofthesensor.ThisvalueisintheunitsyouspecifywithsensitivityUnitstothesensordocumentationtodeterminethisvalue.

sensitivityUnits int32 Theunitsofsensitivity.

Name DescriptionDAQmx_Val_mVoltsPerVoltPerMillimeter mvolts/volt/mmeterDAQmx_Val_mVoltsPerVoltPerMilliInch mvolts/volt/0.001

inch

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitationsourceof

thedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

Page 136: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

voltageExcitFreq float64 Theexcitationfrequency,inhertz,thatthesensorrequires.Refertothesensordocumentationtodeterminethisvalue.

ACExcitWireMode int32 Thenumberofleadsonthesensor.Somesensorsmayrequireyoutotieleadstogethertocreatea4-wireor5-wiresensor.Refertothedocumentationforyoursensorformoreinformation.

Value DescriptionDAQmx_Val_4Wire 4-wire.DAQmx_Val_5Wire 5-wire.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetDAQmx_Val_FromCustomScale.IfyoudonotsetunitstoDAQmx_Val_FromCustomScaleyoumustsetcustomScaleNametoNULL.

Page 137: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 138: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIPosRVDTChanint32DAQmxCreateAIPosRVDTChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,float64sensitivity,int32sensitivityUnits,int32voltageExcitSource,float64voltageExcitVal,float64voltageExcitFreq,int32ACExcitWireMode,constcharcustomScaleName[]);

Page 139: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanRVDTtomeasureangularpositionandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 140: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnangularpositionmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_Degrees DegreesDAQmx_Val_Radians RadiansDAQmx_Val_FromCustomScale Unitsspecifiedbya

customscale.UsecustomScaleNamespecifyacustomscale.

sensitivity float64 Thesensitivityofthesensor.ThisvalueisintheunitsyouspecifywithsensitivityUnitsRefertothesensordocumentationtodeterminethisvalue.

sensitivityUnits int32 Theunitsofsensitivity.

Name DescriptionDAQmx_Val_mVoltsPerVoltPerDegree mvolts/volt/degreeDAQmx_Val_mVoltsPerVoltPerRadian mvolts/volt/radian

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

Page 141: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

voltageExcitFreq float64 Theexcitationfrequency,inhertz,thatthesensorrequires.Refertothesensordocumentationtodeterminethisvalue.

ACExcitWireMode int32 Thenumberofleadsonthesensor.Somesensorsmayrequireyoutotieleadstogethertocreatea4-wireor5-wiresensor.Refertothedocumentationforyoursensorformoreinformation.

Value DescriptionDAQmx_Val_4Wire 4-wire.DAQmx_Val_5Wire 5-wire.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitstoDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 142: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 143: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ObsoleteThisfunctionisobsolete.UseDAQmxCreateAITempBuiltInSensorChaninstead.

Page 144: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAIDeviceTempChanint32DAQmxCreateAIDeviceTempChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32units);

Page 145: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseasensorbuiltintoaterminalblockordevicetomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.OnSCXImodules,forexample,thiscouldbetheCJCsensor.

Page 146: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

Page 147: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 148: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIAccelChanint32DAQmxCreateTEDSAIAccelChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 149: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanaccelerometertomeasureaccelerationandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 150: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnaccelerationmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_AccelUnit_g G.1gis

approximatelyequalto9.81m/s

DAQmx_Val_FromCustomScale Unitsspecifiedbyacustomscale.UsecustomScaleNametospecifyacustom

Page 151: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

scale.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 152: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 153: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAICurrentChanint32DAQmxCreateTEDSAICurrentChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32shuntResistorLoc,float64externalShuntResistorValue,constcharcustomScaleName[]);

Page 154: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurecurrentandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 155: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnmeasurements.

Name DescriptionDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

DAQmx_Val_FromTEDS UnitsdefinedbyTEDSinformationassociatedwiththe

Page 156: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

channel.

shuntResistorLoc int32 Thelocationoftheshuntresistor.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inshunt

resistorofthedevice.DAQmx_Val_External Useashuntresistor

externaltothedevice.YoumustspecifythevalueoftheshuntresistorinextShuntResistorVal

extShuntResistorVal float64 Thevalue,inohms,ofanexternalshuntresistor.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 157: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 158: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIMicrophoneChanint32DAQmxCreateTEDSAIMicrophoneChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,int32units,float64maxSndPressLevel,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 159: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseamicrophonetomeasuresoundpressureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 160: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

units int32 Theunitstousetoreturnsoundpressuremeasurements.

Name DescriptionDAQmx_Val_Pascals pascalsDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

maxSndPressLevel float64 Themaximuminstantaneoussoundpressurelevelyouexpecttomeasure.Thisvalueisindecibels,referencedto20micropascals.

currentExcitSource int32 Thesourceofexcitation.

Page 161: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 162: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 163: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIResistanceChanint32DAQmxCreateTEDSAIResistanceChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal,constcharcustomScaleName[]);

Page 164: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasureresistanceandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 165: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnmeasurements.

Name DescriptionDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

DAQmx_Val_FromTEDS UnitsdefinedbyTEDSinformationassociatedwiththechannel.

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.You

Page 166: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

mustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 167: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 168: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIRTDChanint32DAQmxCreateTEDSAIRTDChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal);

Page 169: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanRTDtomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 170: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusecurrentExcitVal

Page 171: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

tospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

Page 172: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 173: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIStrainGageChanint32DAQmxCreateTEDSAIStrainGageChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32voltageExcitSource,float64voltageExcitVal,float64initialBridgeVoltage,float64leadWireResistance,constcharcustomScaleName[]);

Page 174: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurestrainandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 175: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_Strain StrainDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecify

Page 176: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

theamountofexcitation.DAQmx_Val_None Supplynoexcitationtothe

channel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

initialBridgeVoltage float64 Thebridgeoutputvoltageintheunloadedcondition.NI-DAQmxsubtractsthisvaluefromanymeasurementsbeforeapplyingscalingequations.Performavoltagemeasurementonthebridgewithnostrainappliedtodeterminethisvalue.

leadWireResistance float64 Theamount,inohms,ofresistanceintheleadwires.Ideally,thisvalueisthesameforallleads.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 177: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 178: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIThrmcplChanint32DAQmxCreateTEDSAIThrmcplChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32cjcSource,float64cjcVal,constcharcjcChannel[]);

Page 179: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermocoupletomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 180: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

cjcSource int32 Thesourceofcoldjunctioncompensation.

Value DescriptionDAQmx_Val_BuiltIn Useacold-

junctioncompensationchannelbuiltintotheterminalblock.

DAQmx_Val_ConstVal Youmustspecifythecold-junctiontemperature.

DAQmx_Val_Chan Useachannelforcold-junction

Page 181: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

compensation.

cjcVal float64 ThetemperatureofthecoldjunctionofthethermocoupleifyousetcjcSourcetoDAQmx_Val_ConstVal.

cjcChannel constchar[] Thechannelthatacquiresthetemperatureofthethermocouplecold-junctionifyousetcjcSourcetoDAQmx_Val_Chan.Youcanuseaglobalchanneloranothervirtualchannelalreadyinthetask.Ifthechannelisatemperaturechannel,NI-DAQmxacquiresthetemperatureinthecorrectunits.Otherchanneltypes,suchasaresistancechannelwithacustomsensor,mustuseacustomscaletoscalevaluestodegreesCelsius.

Page 182: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 183: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIThrmstrChanIexint32DAQmxCreateTEDSAIThrmstrChanIex(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32currentExcitSource,float64currentExcitVal);

Page 184: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermistortomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Usethisinstancewhenthethermistorrequirescurrentexcitation.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 185: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

currentExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusecurrentExcitVal

Page 186: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

tospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusecurrentExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

currentExcitVal float64 Theamountofexcitation,inamperes,thatthesensorrequires.

Page 187: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 188: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIThrmstrChanVexint32DAQmxCreateTEDSAIThrmstrChanVex(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32resistanceConfig,int32voltageExcitSource,float64voltageExcitVal,float64r1);

Page 189: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseathermistortomeasuretemperatureandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Usethisinstancewhenthethermistorrequiresvoltageexcitation.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 190: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_Kelvins kelvinsDAQmx_Val_DegR degreesRankine

resistanceConfig int32 Theconfigurationforresistancemeasurements.

Value DescriptionDAQmx_Val_2Wire 2-wiremode.DAQmx_Val_3Wire 3-wiremode.DAQmx_Val_4Wire 4-wiremode.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-in

excitationsourceofthedevice.YoumustusevoltageExcitValto

Page 191: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

specifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

r1 float64 Thevalue,inohms,ofthereferenceresistor.

Page 192: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 193: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIVoltageChanint32DAQmxCreateTEDSAIVoltageChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 194: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurevoltageandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.Ifyourmeasurementrequirestheuseofinternalexcitationoryouneedthevoltagetobescaledbytheexcitation,usetheDAQmxCreateTEDSAIVoltageChanWithExcitfunction.

Page 195: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnmeasurements.

Name DescriptionDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

DAQmx_Val_FromTEDS UnitsdefinedbyTEDSinformationassociatedwiththe

Page 196: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

channel.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 197: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 198: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIVoltageChanWithExcitint32DAQmxCreateTEDSAIVoltageChanWithExcit(TaskHandletaskHandle,

constcharphysicalChannel[],constcharnameToAssignToChannel[],int32terminalConfig,float64minVal,float64maxVal,int32units,int32voltageExcitSource,float64voltageExcitVal,constcharcustomScaleName[]);

Page 199: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasurevoltageandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Usethisinstanceforcustomsensorsthatrequireexcitation.Youcanusetheexcitationtoscalethemeasurement.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 200: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

terminalConfig int32 Theinputterminalconfigurationforthechannel.

Value DescriptionDAQmx_Val_Cfg_Default(-1)

Atruntime,NI-DAQmxchoosesthedefaultterminalconfigurationforthechannel.

DAQmx_Val_RSE Referencedsingle-endedmode

DAQmx_Val_NRSE Nonreferencedsingle-endedmode

DAQmx_Val_Diff Differentialmode

DAQmx_Val_PseudoDiff Pseudodifferentialmode

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnmeasurements.

Name DescriptionDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

DAQmx_Val_FromTEDS UnitsdefinedbyTEDSinformationassociatedwiththe

Page 201: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

channel.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 202: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 203: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIPosLVDTChanint32DAQmxCreateTEDSAIPosLVDTChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32voltageExcitSource,float64voltageExcitVal,float64voltageExcitFreq,int32ACExcitWireMode,constcharcustomScaleName[]);

Page 204: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanLVDTtomeasurelinearpositionandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 205: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnlinearpositionmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_Meters MetersDAQmx_Val_Inches InchesDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.YoumustusevoltageExcitValtospecify

Page 206: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

theamountofexcitation.DAQmx_Val_None Supplynoexcitationtothe

channel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

voltageExcitFreq float64 Theexcitationfrequency,inhertz,thatthesensorrequires.Refertothesensordocumentationtodeterminethisvalue.

ACExcitWireMode int32 Thenumberofleadsonthesensor.Somesensorsmayrequireyoutotieleadstogethertocreatea4-wireor5-wiresensor.Refertothedocumentationforyoursensorformoreinformation.

Value DescriptionDAQmx_Val_4Wire 4-wire.DAQmx_Val_5Wire 5-wire.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 207: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 208: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTEDSAIPosRVDTChanint32DAQmxCreateTEDSAIPosRVDTChan(TaskHandletaskHandle,const

charphysicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32voltageExcitSource,float64voltageExcitVal,float64voltageExcitFreq,int32ACExcitWireMode,constcharcustomScaleName[]);

Page 209: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)thatuseanRVDTtomeasureangularpositionandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youmustconfigurethephysicalchannel(s)withTEDSinformationtousethisfunction.

Page 210: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnangularpositionmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_Degrees DegreesDAQmx_Val_Radians RadiansDAQmx_Val_FromCustomScale Unitsspecifiedby

acustomscale.UsecustomScaleNametospecifyacustomscale.

voltageExcitSource int32 Thesourceofexcitation.

Value DescriptionDAQmx_Val_Internal Usethebuilt-inexcitation

sourceofthedevice.YoumustusevoltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_External Useanexcitationsourceotherthanthebuilt-inexcitationsourceofthedevice.Youmustuse

Page 211: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

voltageExcitValtospecifytheamountofexcitation.

DAQmx_Val_None Supplynoexcitationtothechannel.Youcannotusethisvalueifthesensorrequiresexcitation.

voltageExcitVal float64 Theamountofexcitation,involts,thatthesensorrequires.

voltageExcitFreq float64 Theexcitationfrequency,inhertz,thatthesensorrequires.Refertothesensordocumentationtodeterminethisvalue.

ACExcitWireMode int32 Thenumberofleadsonthesensor.Somesensorsmayrequireyoutotieleadstogethertocreatea4-wireor5-wiresensor.Refertothedocumentationforyoursensorformoreinformation.

Value DescriptionDAQmx_Val_4Wire 4-wire.DAQmx_Val_5Wire 5-wire.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 212: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 213: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAOCurrentChanint32DAQmxCreateAOCurrentChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 214: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratecurrentandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 215: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttogenerate.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttogenerate.

units int32 Theunitsinwhichtogeneratecurrent.

Value DescriptionDAQmx_Val_Amps amperesDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 216: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 217: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAOFuncGenChanint32DAQmxCreateAOFuncGenChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],int32type,float64frequency,float64amplitude,float64offset);

Page 218: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachannelforcontinuallygeneratingawaveformontheselectedphysicalchannel.

Page 219: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

type int32 Specifiesthekindofwaveformtogenerate.

Value DescriptionDAQmx_Val_Sine SinewaveDAQmx_Val_Triangle TrianglewaveDAQmx_Val_Square SawtoothwaveDAQmx_Val_Sawtooth Squarewave

frequency float64 Thefrequencyofthewaveformtogenerateinhertz.

amplitude float64 Thezero-to-peakamplitudeofthewaveformtogenerateinvolts.Zeroandnegativevaluesarevalid.

offset float64 Thevoltageoffsetofthewaveformtogenerate.

Page 220: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 221: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateAOVoltageChanint32DAQmxCreateAOVoltageChan(TaskHandletaskHandle,constchar

physicalChannel[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 222: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratevoltageandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.

Page 223: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

physicalChannel constchar[] Thenamesofthephysicalchannelstousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttogenerate.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttogenerate.

units int32 Theunitsinwhichtogeneratevoltage.

Name DescriptionDAQmx_Val_Volts voltsDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 224: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 225: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateDIChanint32DAQmxCreateDIChan(TaskHandletaskHandle,constcharlines[],const

charnameToAssignToLines[],int32lineGrouping);

Page 226: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)tomeasuredigitalsignalsandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youcangroupdigitallinesintoonedigitalchannelorseparatethemintomultipledigitalchannels.Ifyouspecifyoneormoreentireportsinlinesbyusingportphysicalchannelnames,youcannotseparatetheportsintomultiplechannels.Toseparateportsintomultiplechannels,usethisfunctionmultipletimeswithadifferentporteachtime.

Page 227: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

lines constchar[] Thenamesofthedigitallinesusedtocreateavirtualchannel.Youcanspecifyalistorrangeoflines.

nameToAssignToLines constchar[] Thenameofthecreatedvirtualchannel(s).Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToLines,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.

lineGrouping int32 Specifieswhethertogroupdigitallinesintooneormorevirtualchannels.Ifyouspecifyoneormoreentireportsinlines,youmustsetlineGroupingtoDAQmx_Val_ChanForAllLines.

Value DescriptionDAQmx_Val_ChanPerLine Onechannel

foreachlineDAQmx_Val_ChanForAllLines Onechannel

foralllines

Page 228: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 229: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateDOChanint32DAQmxCreateDOChan(TaskHandletaskHandle,constcharlines[],const

charnameToAssignToLines[],int32lineGrouping);

Page 230: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratedigitalsignalsandaddsthechannel(s)tothetaskyouspecifywithtaskHandle.Youcangroupdigitallinesintoonedigitalchannelorseparatethemintomultipledigitalchannels.Ifyouspecifyoneormoreentireportsinlinesbyusingportphysicalchannelnames,youcannotseparatetheportsintomultiplechannels.Toseparateportsintomultiplechannels,usethisfunctionmultipletimeswithadifferentporteachtime.

Page 231: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

lines constchar[] Thenamesofthedigitallinesusedtocreateavirtualchannel.Youcanspecifyalistorrangeoflines.

nameToAssignToLines constchar[] Thenameofthecreatedvirtualchannel(s).Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToLines,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.

lineGrouping int32 Specifieswhethertogroupdigitallinesintooneormorevirtualchannels.Ifyouspecifyoneormoreentireportsinlines,youmustsetlineGroupingtoDAQmx_Val_ChanForAllLines.

Value DescriptionDAQmx_Val_ChanPerLine Onechannel

foreachlineDAQmx_Val_ChanForAllLines Onechannel

foralllines

Page 232: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 233: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCICountEdgesChanint32DAQmxCreateCICountEdgesChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32edge,uInt32initialCount,int32countDirection);

Page 234: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachanneltocountthenumberofrisingorfallingedgesofadigitalsignalandaddsthechanneltothetaskyouspecifywithtaskHandle.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignaltothedefaultinputterminalofthecounterunlessyouselectadifferentinputterminal.

Page 235: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

edge int32 Specifiesonwhichedgesoftheinputsignaltoincrementordecrementthecount.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

initialCount uInt32 Thevaluefromwhichtostartcounting.

countDirection int32 Specifieswhethertoincrementordecrementthecounteroneachedge.

Value DescriptionDAQmx_Val_CountUp Increment

thecountregisteroneachedge.

DAQmx_Val_CountDown Decrementthecountregisteroneachedge.

DAQmx_Val_ExtControlled Thestateofadigitallinecontrolsthecountdirection.Eachcounterhasadefaultcount

Page 236: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

directionterminal.

Page 237: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 238: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCIFreqChanint32DAQmxCreateCIFreqChan(TaskHandletaskHandle,constcharcounter[],

constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32edge,int32measMethod,float64measTime,uInt32divisor,constcharcustomScaleName[]);

Page 239: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachanneltomeasurethefrequencyofadigitalsignalandaddsthechanneltothetaskyouspecifywithtaskHandle.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignaltothedefaultinputterminalofthecounterunlessyouselectadifferentinputterminal.

Page 240: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Name DescriptionDAQmx_Val_Hz hertzDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsbyacustom

scale.UsecustomScaleNametospecifyacustomscale.

edge int32 Specifiesbetweenwhichedgestomeasurethefrequencyorperiodofthesignal.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

measMethod int32 Themethodusedtocalculatetheperiodorfrequencyofthesignal.

Value DescriptionDAQmx_Val_LowFreq1Ctr Useonecounterthat

usesaconstanttimebasetomeasuretheinputsignal.

DAQmx_Val_HighFreq2Ctr Usetwocounters,

Page 241: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

oneofwhichcountspulsesofthesignaltomeasureduringthespecifiedmeasurementtime.

DAQmx_Val_LargeRng2Ctr Useonecountertodividethefrequencyoftheinputsignaltocreatealower-frequencysignalthatthesecondcountercanmoreeasilymeasure.

measTime float64 Thelengthoftimetomeasurethefrequencyorperiodofadigitalsignal,whenmeasMethodisDAQmx_Val_HighFreq2Ctr.Measurementaccuracyincreaseswithincreasedmeasurementtimeandwithincreasedsignalfrequency.

CautionIfyoumeasureahigh-frequencysignalfortoolongatime,thecountregistercouldrollover,resultinginanincorrectmeasurement.

divisor uInt32 Thevaluebywhichtodividetheinputsignal,whenmeasMethodisDAQmx_Val_LargeRng2Ctr.Thelargerthisvalue,themoreaccuratethemeasurement,buttoolargeavaluecancausethecountregistertorollover,resultinginanincorrectmeasurement.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 242: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 243: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCIPeriodChanint32DAQmxCreateCIPeriodChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32edge,int32measMethod,float64measTime,uInt32divisor,constcharcustomScaleName[]);

Page 244: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachanneltomeasuretheperiodofadigitalsignalandaddsthechanneltothetaskyouspecifywithtaskHandle.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignaltothedefaultinputterminalofthecounterunlessyouselectadifferentinputterminal.

NoteWhenmeasMethodissettoDAQmx_Val_LowFreq1Ctr,youmustpassthevalues0.000001formeasTimeand4fordivisor.Thesevalueswillbeignoredbythefunction,butiftheyarenotpassed,thefunctionreturnsanerror.

Page 245: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Seconds secondsDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

edge int32 Specifiesbetweenwhichedgestomeasurethefrequencyorperiodofthesignal.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

measMethod int32 Specifiesthemethodusedtocalculatethefrequencyorperiodofthesignal.

Value DescriptionDAQmx_Val_LowFreq1Ctr Useonecounterthat

usesaconstanttimebasetomeasuretheinputsignal.

DAQmx_Val_HighFreq2Ctr Usetwocounters,

Page 246: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

oneofwhichcountspulsesofthesignaltomeasureduringthespecifiedmeasurementtime.

DAQmx_Val_LargeRng2Ctr Useonecountertodividethefrequencyoftheinputsignaltocreatealower-frequencysignalthatthesecondcountercanmoreeasilymeasure.

measTime float64 Thelengthoftimetomeasurethefrequencyorperiodofadigitalsignal,whenmeasMethodisDAQmx_Val_HighFreq2Ctr.Measurementaccuracyincreaseswithincreasedmeasurementtimeandwithincreasedsignalfrequency.

CautionIfyoumeasureahigh-frequencysignalfortoolongatime,thecountregistercouldrollover,resultinginanincorrectmeasurement.

divisor uInt32 Thevaluebywhichtodividetheinputsignal,whenmeasMethodisDAQmx_Val_LargeRng2Ctr.Thelargerthisvalue,themoreaccuratethemeasurement,buttoolargeavaluecancausethecountregistertorollover,resultinginanincorrectmeasurement.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 247: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 248: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCIPulseWidthChanint32DAQmxCreateCIPulseWidthChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32startingEdge,constcharcustomScaleName[]);

Page 249: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachanneltomeasurethewidthofadigitalpulseandaddsthechanneltothetaskyouspecifywithtaskHandle.startingEdgedetermineswhethertomeasureahighpulseoralowpulse.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignaltothedefaultinputterminalofthecounterunlessyouselectadifferentinputterminal.

Page 250: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Seconds secondsDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

startingEdge int32 Specifiesonwhichedgetobeginmeasuringpulsewidth.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 251: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 252: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCISemiPeriodChanint32DAQmxCreateCISemiPeriodChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,constcharcustomScaleName[]);

Page 253: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachanneltomeasurethetimebetweenstatetransitionsofadigitalsignalandaddsthechanneltothetaskyouspecifywithtaskHandle.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignaltothedefaultinputterminalofthecounterunlessyouselectadifferentinputterminal.

Page 254: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Seconds secondsDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 255: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 256: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCITwoEdgeSepChanDAQmxCreateCITwoEdgeSepChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],float64minVal,float64maxVal,int32units,int32firstEdge,int32secondEdge,constcharcustomScaleName[]);

Page 257: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachannelthatmeasurestheamountoftimebetweentherisingorfallingedgeofonedigitalsignalandtherisingorfallingedgeofanotherdigitalsignal.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignalstothedefaultinputterminalsofthecounterunlessyouselectdifferentinputterminals.

Page 258: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thenametoassigntothecreatedvirtualchannel.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

minVal float64 Theminimumvalue,inunits,thatyouexpecttomeasure.

maxVal float64 Themaximumvalue,inunits,thatyouexpecttomeasure.

units int32 Theunitstousetoreturnthemeasurement.

Value DescriptionDAQmx_Val_Seconds secondsDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

firstEdge int32 Specifiesonwhichedgeofthefirstsignaltostarteachmeasurement.

Name DescriptionDAQmx_Val_Rising Starteachmeasurementon

therisingedgeofthefirstsignal.

DAQmx_Val_Falling Starteachmeasurementonthefallingedgeofthefirstsignal.

secondEdge int32 Specifiesonwhichedgeofthefirstsignaltostopeachmeasurement.

Name DescriptionDAQmx_Val_Rising Stopeachmeasurementon

therisingedgeofthe

Page 259: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

secondsignal.DAQmx_Val_Falling Stopeachmeasurementon

thefallingedgeofthesecondsignal.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 260: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 261: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCILinEncoderChanint32DAQmxCreateCILinEncoderChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32decodingType,bool32ZidxEnable,float64ZidxVal,int32ZidxPhase,int32units,float64distPerPulse,float64initialPos,constcharcustomScaleName[]);

Page 262: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachannelthatusesalinearencodertomeasurelinearposition.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignalstothedefaultinputterminalsofthecounterunlessyouselectdifferentinputterminals.

Page 263: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thenametoassigntothecreatedvirtualchannel.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

decodingType int32 SpecifieshowtocountandinterpretthepulsesthattheencodergeneratesonsignalAandsignalB.DAQmx_Val_X1,DAQmx_Val_X2,andDAQmx_Val_X4arevalidforquadratureencodersonly.DAQmx_Val_TwoPulseCountingisvalidonlyfortwo-pulseencoders.DAQmx_Val_X2andDAQmx_Val_X4decodingaremoresensitivetosmallerchangesinpositionthanDAQmx_Val_X1encoding,withDAQmx_Val_X4beingthemostsensitive.However,moresensitivedecodingismorelikelytoproduceerroneousmeasurementsifthereisvibrationintheencoderorothernoiseinthesignals.

Value DescriptionDAQmx_Val_X1 IfsignalAleads

signalB,counttherisingedgesofsignalA.IfsignalBleadssignalA,countthefallingedgesofsignalA.

DAQmx_Val_X2 CounttherisingandfallingedgesofsignalA.

DAQmx_Val_X4 CounttherisingandfallingedgesofbothsignalAandsignalB.

Page 264: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_TwoPulseCounting IncrementthecountonrisingedgesofsignalA.DecrementthecountonrisingpulsesofsignalB.

ZidxEnable bool32 Specifieswhethertoenablezindexingforthemeasurement.

ZidxVal float64 Thevalue,inunits,towhichtoresetthemeasurementwhensignalZishighandsignalAandsignalBareatthestatesyouspecifywithZidxPhase.

ZidxPhase int32 ThestatesatwhichsignalAandsignalBmustbewhilesignalZishighforNI-DAQmxtoresetthemeasurement.IfsignalZisneverhighwhilethesignalAandsignalBarehigh,forexample,youmustchooseaphaseotherthanDAQmx_Val_AHighBHigh.WhensignalZgoeshighandhowlongitstayshighvariesfromencodertoencoder.RefertothedocumentationfortheencodertodeterminethetimingofsignalZwithrespecttosignalAandsignalB.

Value DescriptionDAQmx_Val_AHighBHigh Resetthe

measurementwhenbothsignalAandsignalBareathighlogic.

DAQmx_Val_AHighBLow ResetthemeasurementwhensignalAisathighlogicandsignalBisatlowlogic.

DAQmx_Val_ALowBHigh ResetthemeasurementwhensignalAisatlowlogicandsignalBisathighlogic.

DAQmx_Val_ALowBLow ResetthemeasurementwhenbothsignalAandsignalBareatlowlogic.

Page 265: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

units int32 Theunitstousetoreturnlinearpositionmeasurementsfromthechannel.

Name DescriptionDAQmx_Val_Meters Meters.DAQmx_Val_Inches Inches.DAQmx_Val_Ticks TimebaseTicks.DAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

distPerPulse float64 Thedistancemeasuredforeachpulsetheencodergenerates.Specifythisvalueinunits.

initialPos float64 Thepositionoftheencoderwhenthemeasurementbegins.Thisvalueisinunits.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 266: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 267: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCIAngEncoderChanint32DAQmxCreateCIAngEncoderChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32decodingType,bool32ZidxEnable,float64ZidxVal,int32ZidxPhase,int32units,uInt32pulsesPerRev,float64initialAngle,constcharcustomScaleName[]);

Page 268: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachannelthatusesanangularencodertomeasureangularposition.Youcancreateonlyonecounterinputchannelatatimewiththisfunctionbecauseataskcanincludeonlyonecounterinputchannel.Toreadfrommultiplecounterssimultaneously,useaseparatetaskforeachcounter.Connecttheinputsignalstothedefaultinputterminalsofthecounterunlessyouselectdifferentinputterminals.

Page 269: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thenametoassigntothecreatedvirtualchannel.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamesthevirtualchannels.

decodingType int32 SpecifieshowtocountandinterpretthepulsesthattheencodergeneratesonsignalAandsignalB.DAQmx_Val_X1,DAQmx_Val_X2,andDAQmx_Val_X4arevalidforquadratureencodersonly.DAQmx_Val_TwoPulseCountingisvalidonlyfortwo-pulseencoders.DAQmx_Val_X2andDAQmx_Val_X4decodingaremoresensitivetosmallerchangesinpositionthanDAQmx_Val_X1encoding,withDAQmx_Val_X4beingthemostsensitive.However,moresensitivedecodingismorelikelytoproduceerroneousmeasurementsifthereisvibrationintheencoderorothernoiseinthesignals.

Value DescriptionDAQmx_Val_X1 IfsignalAleads

signalB,counttherisingedgesofsignalA.IfsignalBleadssignalA,countthefallingedgesofsignalA.

DAQmx_Val_X2 CounttherisingandfallingedgesofsignalA.

DAQmx_Val_X4 CounttherisingandfallingedgesofbothsignalAandsignalB.

Page 270: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_TwoPulseCounting IncrementthecountonrisingedgesofsignalA.DecrementthecountonrisingpulsesofsignalB.

ZidxEnable bool32 Specifieswhethertoenablezindexingforthemeasurement.

ZidxVal float64 Thevalue,inunits,towhichtoresetthemeasurementwhensignalZishighandsignalAandsignalBareatthestatesyouspecifywithZidxPhase.

ZidxPhase int32 ThestatesatwhichsignalAandsignalBmustbewhilesignalZishighforNI-DAQmxtoresetthemeasurement.IfsignalZisneverhighwhilethesignalAandsignalBarehigh,forexample,youmustchooseaphaseotherthanDAQmx_Val_AHighBHigh.WhensignalZgoeshighandhowlongitstayshighvariesfromencodertoencoder.RefertothedocumentationfortheencodertodeterminethetimingofsignalZwithrespecttosignalAandsignalB.

Value DescriptionDAQmx_Val_AHighBHigh Resetthe

measurementwhenbothsignalAandsignalBareathighlogic.

DAQmx_Val_AHighBLow ResetthemeasurementwhensignalAisathighlogicandsignalBisatlowlogic.

DAQmx_Val_ALowBHigh ResetthemeasurementwhensignalAisatlowlogicandsignalBisathighlogic.

DAQmx_Val_ALowBLow ResetthemeasurementwhenbothsignalAandsignalBareatlowlogic.

Page 271: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

units int32 Theunitstousetoreturnangularpositionmeasurementsfromthechannel.

Value DescriptionDAQmx_Val_Degrees DegreesDAQmx_Val_Radians RadiansDAQmx_Val_Ticks TimebaseticksDAQmx_Val_FromCustomScale Unitsacustom

scalespecifies.UsecustomScaleNametospecifyacustomscale.

pulsesPerRev uInt32 Thenumberofpulsestheencodergeneratesperrevolution.ThisvalueisthenumberofpulsesononeofeitherAsignalorBsignal,notthetotalnumberofpulsesonbothsignalAandsignalB.

initialAngle float64 Thestartingangleoftheencoderwhenthemeasurementbegins.Specifythisvalueinunits.

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitsDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 272: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 273: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCIGPSTimestampChanint32DAQmxCreateCIGPSTimestampChan(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32units,int32gpsSyncMethod,constcharcustScaleName[]);

Page 274: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesachannelthatusesaspecial-purposecountertotakeatimestampandsynchronizesthatcountertoaGPSreceiver.

Page 275: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

units int32 Theunitstousetoreturnthetimestamp.

Value DescriptionDAQmx_Val_Seconds SecondsDAQmx_Val_FromCustomScale From

customscale

gpsSyncMethod int32 ThemethodtousetosynchronizethecountertoaGPSreceiver.

Value DescriptionDAQmx_Val_IRIGB IRIG-BDAQmx_Val_PPS PPSDAQmx_Val_None None

customScaleName constchar[] Thenameofacustomscaletoapplytothechannel.Tousethisparameter,youmustsetunitstoDAQmx_Val_FromCustomScale.IfyoudonotsetunitstoDAQmx_Val_FromCustomScale,youmustsetcustomScaleNametoNULL.

Page 276: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 277: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCOPulseChanFreqint32DAQmxCreateCOPulseChanFreq(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32units,int32idleState,float64initialDelay,float64freq,float64dutyCycle);

Page 278: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratedigitalpulsesthatfreqanddutyCycledefineandaddsthechanneltothetaskyouspecifywithtaskHandle.Thepulsesappearonthedefaultoutputterminalofthecounterunlessyouselectadifferentoutputterminal.

Page 279: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

units int32 Theunitsinwhichtospecifyfreq.

Name DescriptionDAQmx_Val_Hz hertz

idleState int32 Therestingstateoftheoutputterminal.

Value DescriptionDAQmx_Val_High Highstate.DAQmx_Val_Low Lowstate.

initialDelay float64 Theamountoftimeinsecondstowaitbeforegeneratingthefirstpulse.

freq float64 Thefrequencyatwhichtogeneratepulses.

dutyCycle float64 Thewidthofthepulsedividedbythepulseperiod.NI-DAQmxusesthisratio,combinedwithfrequency,todeterminepulsewidthandtheintervalbetweenpulses.

Page 280: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 281: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCOPulseChanTicksint32DAQmxCreateCOPulseChanTicks(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],constcharsourceTerminal[],int32idleState,int32initialDelay,int32lowTicks,int32highTicks);

Page 282: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratedigitalpulsesdefinedbythenumberoftimebaseticksthatthepulseisatahighstateandthenumberoftimebaseticksthatthepulseisatalowstateandalsoaddsthechanneltothetaskyouspecifywithtaskHandle.Thepulsesappearonthedefaultoutputterminalofthecounterunlessyouselectadifferentoutputterminal.

Page 283: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

sourceTerminal constchar[] Theterminaltowhichyouconnectanexternaltimebase.Youalsocanspecifyasourceterminalbyusingaterminalname.

idleState int32 Therestingstateoftheoutputterminal.

Value DescriptionDAQmx_Val_High Highstate.DAQmx_Val_Low Lowstate.

initialDelay int32 Thenumberoftimebasetickstowaitbeforegeneratingthefirstpulse.

lowTicks int32 Thenumberoftimebaseticksthatthepulseislow.

highTicks int32 Thenumberoftimebaseticksthatthepulseishigh.

Page 284: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 285: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateCOPulseChanTimeint32DAQmxCreateCOPulseChanTime(TaskHandletaskHandle,constchar

counter[],constcharnameToAssignToChannel[],int32units,int32idleState,float64initialDelay,float64lowTime,float64highTime);

Page 286: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreateschannel(s)togeneratedigitalpulsesdefinedbytheamountoftimethepulseisatahighstateandtheamountoftimethepulseisatalowstateandaddsthechanneltothetaskyouspecifywithtaskHandle.Thepulsesappearonthedefaultoutputterminalofthecounterunlessyouselectadifferentoutputterminal.

Page 287: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowhichtoaddthechannelsthatthisfunctioncreates.

counter constchar[] Thenameofthecountertousetocreatevirtualchannels.Youcanspecifyalistorrangeofphysicalchannels.

nameToAssignToChannel constchar[] Thename(s)toassigntothecreatedvirtualchannel(s).Ifyoudonotspecifyaname,NI-DAQmxusesthephysicalchannelnameasthevirtualchannelname.IfyouspecifyyourownnamesfornameToAssignToChannel,youmustusethenameswhenyourefertothesechannelsinotherNI-DAQmxfunctions.Ifyoucreatemultiplevirtualchannelswithonecalltothisfunction,youcanspecifyalistofnamesseparatedbycommas.Ifyouprovidefewernamesthanthenumberofvirtualchannelsyoucreate,NI-DAQmxautomaticallyassignsnamestothevirtualchannels.

units int32 Theunitsinwhichtodefinepulsehighandlowtime.

Value DescriptionDAQmx_Val_Seconds Seconds

idleState int32 Therestingstateoftheoutputterminal.

Value DescriptionDAQmx_Val_High Highstate.DAQmx_Val_Low Lowstate.

initialDelay float64 Theamountoftimeinsecondstowaitbeforegeneratingthefirstpulse.

lowTime float64 Theamountoftimethepulseislow,inseconds.

highTime float64 Theamountoftimethepulseishigh,inseconds.

Page 288: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 289: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgBurstHandshakingTimingExportClockint32DAQmxCfgBurstHandshakingTimingExportClock(TaskHandle

taskHandle,int32sampleMode,uInt64sampsPerChan,float64sampleClkRate,constcharsampleClkOutpTerm[],int32sampleClkPulsePolarity,int32pauseWhen,int32readyEventActiveLevel);

Page 290: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfigureswhentheDAQdevicetransfersdatatoaperipheraldevice,usingtheDAQdevice'sonboardsampleclocktocontrolbursthandshakingtiming.

Page 291: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamplescontinuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontiming

Page 292: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

types.

sampsPerChan uInt64 ThenumberofsamplestoacquirefromeachchannelifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

sampleClkRate float64 Specifiesthesamplingrateinsamplesperchannelpersecond.IfyouuseanexternalsourcefortheSampleClock,setthisinputtothemaximumexpectedrateofthatclock.

sampleClkOutpTerm constchar[]

SpecifiestheterminaltowhichtoroutetheSampleClock.

sampleClkPulsePolarity int32 Specifiesifthepolarityfortheexportedsampleclockisactivehighoractivelow.

pauseWhen int32 Specifieswhetherthetaskpauseswhilethesignalishighorlow.

readyEventActiveLevel int32 SpecifiesthepolarityfortheReadyforTransferevent.

Page 293: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 294: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgBurstHandshakingTimingImportClockint32DAQmxCfgBurstHandshakingTimingImportClock(TaskHandle

taskHandle,int32sampleMode,uInt64sampsPerChan,float64sampleClkRate,constcharsampleClkSrc[],int32sampleClkActiveEdge,int32pauseWhen,int32readyEventActiveLevel);

Page 295: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfigureswhentheDAQdevicetransfersdatatoaperipheraldevice,usinganimportedsampleclocktocontrolbursthandshakingtiming.

Page 296: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamplescontinuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontiming

Page 297: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

types.

sampsPerChan uInt64 ThenumberofsamplestoacquirefromeachchannelifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

sampleClkRate float64 Specifiesthesamplingrateinsamplesperchannelpersecond.IfyouuseanexternalsourcefortheSampleClock,setthisinputtothemaximumexpectedrateofthatclock.

sampleClkSrc constchar[]

SpecifiestheterminalofthesignaltouseastheSampleClock.

sampleClkActiveEdge int32 Specifiesonwhichedgeofaclockpulsesamplingtakesplace.ThispropertyisusefulprimarilywhenthesignalyouuseastheSampleClockisnotaperiodicclock.

Value DescriptionDAQmx_Val_Rising Acquireorgenerate

samplesontherisingedgesoftheSampleClock.

DAQmx_Val_Falling AcquireorgeneratesamplesonthefallingedgesoftheSampleClock.

pauseWhen int32 Specifieswhetherthetaskpauseswhilethesignalishighorlow.

readyEventActiveLevel int32 SpecifiesthepolarityfortheReadyforTransferevent.

Page 298: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 299: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgChangeDetectionTimingint32DAQmxCfgChangeDetectionTiming(TaskHandletaskHandle,constchar

risingEdgeChan[],constcharfallingEdgeChan[],int32sampleMode,uInt64sampsPerChan);

Page 300: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktoacquiresamplesontherisingand/orfallingedgesofthelinesorportsyouspecify.

Page 301: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

risingEdgeChan constchar[]

Thenamesofthedigitallinesorportsonwhichtodetectrisingedges.Youcanspecifyalistorrangeofchannels.

fallingEdgeChan constchar[]

Thenamesofthedigitallinesorportsonwhichtodetectfallingedges.Youcanspecifyalistorrangeofchannels.

sampleMode int32 Specifieswhetherthetaskacquiressamplescontinuouslyorifitacquiresafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamplescontinuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesample

Page 302: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

clockandchangedetectiontimingtypes.

sampsPerChan uInt64 ThenumberofsamplestoacquirefromeachchannelifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

Page 303: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 304: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgHandshakingTimingint32DAQmxCfgHandshakingTiming(TaskHandletaskHandle,int32

sampleMode,uInt64sampsPerChanToAcquire);

Page 305: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDeterminesthenumberofdigitalsamplestoacquireorgenerateusingdigitalhandshakingbetweenthedeviceandaperipheraldevice.

Page 306: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamplescontinuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontiming

Page 307: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

types.

sampsPerChanToAcquire uInt64 ThenumberofsamplestoacquireorgenerateforeachchannelinthetaskifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

Page 308: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 309: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgImplicitTimingint32DAQmxCfgImplicitTiming(TaskHandletaskHandle,int32sampleMode,

uInt64sampsPerChanToAcquire);

Page 310: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsonlythenumberofsamplestoacquireorgeneratewithoutspecifyingtiming.Typically,youshouldusethisfunctionwhenthetaskdoesnotrequiresampletiming,suchastasksthatusecountersforbufferedfrequencymeasurement,bufferedperiodmeasurement,orpulsetraingeneration.

Page 311: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamplescontinuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontiming

Page 312: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

types.

sampsPerChanToAcquire uInt64 ThenumberofsamplestoacquireorgenerateforeachchannelinthetaskifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

Page 313: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 314: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgPipelinedSampClkTimingint32DAQmxCfgPipelinedSampClkTiming(TaskHandletaskHandle,constchar

source[],float64rate,int32activeEdge,int32sampleMode,uInt64samplesPerChannel);

Page 315: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsthesourceoftheSampleClock,therateoftheSampleClock,andthenumberofsamplestoacquireorgenerate.ThedeviceacquiresorgeneratessamplesoneachSampleClockedge,butdoesnotrespondtocertaintriggersuntilafewSampleClockedgeslater.Pipeliningallowshigherdatatransferratesatthecostofincreasedtriggerresponselatency.Refertothedevicedocumentationforinformationaboutwhichtriggerspipeliningaffects.ThistimingtypeallowshandshakingusingthePausetrigger,theReadyforTransferevent,ortheDataActiveevent.Refertothedevicedocumentationformoreinformation.ThistimingtypeissupportedonlybytheNI6536andNI6537.

Page 316: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

source constchar[] ThesourceterminaloftheSampleClock.Tousetheinternalclockofthedevice,useNULLoruseOnboardClock.

rate float64 Thesamplingrateinsamplespersecondperchannel.IfyouuseanexternalsourcefortheSampleClock,setthisvaluetothemaximumexpectedrateofthatclock.

activeEdge int32 Specifiesonwhichedgeoftheclocktoacquireorgeneratesamples.

Value DescriptionDAQmx_Val_Rising Acquireorgenerate

samplesontherisingedgesoftheSampleClock.

DAQmx_Val_Falling AcquireorgeneratesamplesonthefallingedgesoftheSampleClock.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamples

Page 317: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

continuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontimingtypes.

sampsPerChanToAcquire uInt64 ThenumberofsamplestoacquireorgenerateforeachchannelinthetaskifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

Page 318: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 319: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgSampClkTimingint32DAQmxCfgSampClkTiming(TaskHandletaskHandle,constcharsource[],

float64rate,int32activeEdge,int32sampleMode,uInt64sampsPerChanToAcquire);

Page 320: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsthesourceoftheSampleClock,therateoftheSampleClock,andthenumberofsamplestoacquireorgenerate.

Page 321: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

source constchar[] ThesourceterminaloftheSampleClock.Tousetheinternalclockofthedevice,useNULLoruseOnboardClock.

rate float64 Thesamplingrateinsamplespersecondperchannel.IfyouuseanexternalsourcefortheSampleClock,setthisvaluetothemaximumexpectedrateofthatclock.

activeEdge int32 Specifiesonwhichedgeoftheclocktoacquireorgeneratesamples.

Value DescriptionDAQmx_Val_Rising Acquireorgenerate

samplesontherisingedgesoftheSampleClock.

DAQmx_Val_Falling AcquireorgeneratesamplesonthefallingedgesoftheSampleClock.

sampleMode int32 Specifieswhetherthetaskacquiresorgeneratessamplescontinuouslyorifitacquiresorgeneratesafinitenumberofsamples.

Value DescriptionDAQmx_Val_FiniteSamps Acquireor

generateafinitenumberofsamples.

DAQmx_Val_ContSamps Acquireorgeneratesamplesuntilyoustopthetask.

DAQmx_Val_HWTimedSinglePoint Acquireorgeneratesamples

Page 322: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

continuouslyusinghardwaretimingwithoutabuffer.Hardwaretimedsinglepoint

samplemodeissupportedonlyforthesampleclockandchangedetectiontimingtypes.

sampsPerChanToAcquire uInt64 ThenumberofsamplestoacquireorgenerateforeachchannelinthetaskifsampleModeisDAQmx_Val_FiniteSamps.IfsampleModeisDAQmx_Val_ContSamps,NI-DAQmxusesthisvaluetodeterminethebuffersize.

Page 323: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 324: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgAnlgEdgeStartTrigint32DAQmxCfgAnlgEdgeStartTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerSlope,float64triggerLevel);

Page 325: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostartacquiringorgeneratingsampleswhenananalogsignalcrossesthelevelyouspecify.

Page 326: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Thenameofachannelorterminalwherethereisananalogsignaltouseasthesourceofthetrigger.ForESeriesdevices,ifyouuseachannelname,thechannelmustbethefirstchannelinthetask.TheonlyterminalyoucanuseforESeriesdevicesisPFI0.

triggerSlope int32 SpecifiesonwhichslopeofthesignaltostartacquiringorgeneratingsampleswhenthesignalcrossestriggerLevel.

Value DescriptionDAQmx_Val_RisingSlope Triggerontherising

slopeofthesignal.DAQmx_Val_FallingSlope Triggeronthefalling

slopeofthesignal.

triggerLevel float64 Thethresholdatwhichtostartacquiringorgeneratingsamples.Specifythisvalueintheunitsofthemeasurementorgeneration.UsetriggerSlopetospecifyonwhichslopetotriggeratthisthreshold.

Page 327: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 328: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgAnlgWindowStartTrigint32DAQmxCfgAnlgWindowStartTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerWhen,float64windowTop,float64windowBottom);

Page 329: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostartacquiringorgeneratingsampleswhenananalogsignalentersorleavesarangeyouspecify.

Page 330: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[]

Thenameofavirtualchannelorterminalwherethereisananalogsignaltouseasthesourceofthetrigger.ForESeriesdevices,ifyouuseavirtualchannel,itmustbethefirstchannelinthetask.TheonlyterminalyoucanuseforESeriesdevicesisPFI0.

triggerWhen int32 Specifieswhetherthetaskstartsmeasuringorgeneratingsampleswhenthesignalentersthewindoworwhenitleavesthewindow.UsewindowBottomandwindowToptospecifythelimitsofthewindow.

Value DescriptionDAQmx_Val_EnteringWin Triggerwhenthe

signalentersthewindow.

DAQmx_Val_LeavingWin Triggerwhenthesignalleavesthewindow.

windowTop float64 Theupperlimitofthewindow.Specifythisvalueintheunitsofthemeasurementorgeneration.

windowBottom float64 Thelowerlimitofthewindow.Specifythisvalueintheunitsofthemeasurementorgeneration.

Page 331: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 332: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgDigEdgeStartTrigint32DAQmxCfgDigEdgeStartTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerEdge);

Page 333: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostartacquiringorgeneratingsamplesonarisingorfallingedgeofadigitalsignal.

Page 334: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Thenameofaterminalwherethereisadigitalsignaltouseasthesourceofthetrigger.

triggerEdge int32 Specifiesonwhichedgeofadigitalsignaltostartacquiringorgeneratingsamples.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

Page 335: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 336: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgDigPatternStartTrigint32DAQmxCfgDigPatternStartTrig(TaskHandletaskHandle,constchar

triggerSource[],constchartriggerPattern[],int32triggerWhen);

Page 337: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresatasktostartacquiringorgeneratingsampleswhenadigitalpatternismatched.

Page 338: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Specifiesthephysicalchannelstouseforpatternmatching.Theorderofthephysicalchannelsdeterminestheorderofthepattern.Ifaportisincluded,theorderofthephysicalchannelswithintheportisinascendingorder.

triggerPattern constchar[] Specifiesthedigitalpatternthatmustbemetforthetriggertooccur.

triggerWhen int32 Specifiestheconditionsunderwhichthetriggeroccurs.

Value DescriptionDAQmx_Val_PatternMatches Pattern

matchesDAQmx_Val_PatternDoesNotMatch Patterndoes

notmatch

Page 339: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 340: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDisableStartTrigint32DAQmxDisableStartTrig(TaskHandletaskHandle);

Page 341: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostartacquiringorgeneratingsamplesimmediatelyuponstartingthetask.

Page 342: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

Page 343: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 344: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgAnlgEdgeRefTrigint32DAQmxCfgAnlgEdgeRefTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerSlope,float64triggerLevel,uInt32pretriggerSamples);

Page 345: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostoptheacquisitionwhenthedeviceacquiresallpretriggersamples,ananalogsignalreachesthelevelyouspecify,andthedeviceacquiresallpost-triggersamples.

Page 346: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Thenameofavirtualchannelorterminalwherethereisananalogsignaltouseasthesourceofthetrigger.ForESeriesdevices,ifyouuseavirtualchannel,itmustbetheonlychannelinthetask.TheonlyterminalyoucanuseforESeriesdevicesisPFI0.

triggerSlope int32 SpecifiesonwhichslopeofthesignaltheReferenceTriggeroccurs.

Value DescriptionDAQmx_Val_RisingSlope Triggeronthe

risingslopeofthesignal.

DAQmx_Val_FallingSlope Triggeronthefallingslopeofthesignal.

triggerLevel float64 Specifiesatwhatthresholdtotrigger.Specifythisvalueintheunitsofthemeasurementorgeneration.UsetriggerSlopetospecifyonwhichslopetotriggeratthisthreshold.

pretriggerSamples uInt32 TheminimumnumberofsamplesperchanneltoacquirebeforerecognizingtheReferenceTrigger.ThenumberofposttriggersamplesperchannelisequaltonumberofsamplesperchannelintheNI-DAQmxTimingfunctionsminuspretriggerSamples.

Page 347: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 348: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgAnlgWindowRefTrigint32DAQmxCfgAnlgWindowRefTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerWhen,float64windowTop,float64windowBottom,uInt32pretriggerSamples);

Page 349: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostoptheacquisitionwhenthedeviceacquiresallpretriggersamples,ananalogsignalentersorleavesarangeyouspecify,andthedeviceacquiresallpost-triggersamples.

Page 350: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Thenameofavirtualchannelorterminalwherethereisananalogsignaltouseasthesourceofthetrigger.ForESeriesdevices,ifyouuseavirtualchannel,itmustbetheonlychannelinthetask.TheonlyterminalyoucanuseforESeriesdevicesisPFI0.

triggerWhen int32 SpecifieswhethertheReferenceTriggeroccurswhenthesignalentersthewindoworwhenitleavesthewindow.UsewindowBottomandwindowToptospecifythelimitsofthewindow.

Value DescriptionDAQmx_Val_EnteringWin Triggerwhenthe

signalentersthewindow.

DAQmx_Val_LeavingWin Triggerwhenthesignalleavesthewindow.

windowTop float64 Theupperlimitofthewindow.Specifythisvalueintheunitsofthemeasurementorgeneration.

windowBottom float64 Thelowerlimitofthewindow.Specifythisvalueintheunitsofthemeasurementorgeneration.

pretriggerSamples uInt32 TheminimumnumberofsamplesperchanneltoacquirebeforerecognizingtheReferenceTrigger.ThenumberofposttriggersamplesperchannelisequaltonumberofsamplesperchannelintheNI-DAQmxTimingfunctionsminuspretriggerSamples.

Page 351: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 352: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgDigEdgeRefTrigint32DAQmxCfgDigEdgeRefTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerEdge,uInt32pretriggerSamples);

Page 353: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostoptheacquisitionwhenthedeviceacquiresallpretriggersamples,detectsarisingorfallingedgeofadigitalsignal,andacquiresallposttriggersamples.

Page 354: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[]

Specifiesthenameofaterminalwherethereisadigitalsignaltouseasthesourceofthetrigger.

triggerEdge int32 SpecifiesonwhichedgeofthedigitalsignaltheReferenceTriggeroccurs.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

pretriggerSamples uInt32 TheminimumnumberofsamplesperchanneltoacquirebeforerecognizingtheReferenceTrigger.ThenumberofposttriggersamplesperchannelisequaltonumberofsamplesperchannelintheNI-DAQmxTimingfunctionsminuspretriggerSamples.

Page 355: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 356: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgDigPatternRefTrigint32DAQmxCfgDigPatternRefTrig(TaskHandletaskHandle,constchar

triggerSource[],constchartriggerPattern[],int32triggerWhen,uInt32pretriggerSamples);

Page 357: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresthetasktostoptheacquisitionwhenthedeviceacquiresallpretriggersamples,matchesordoesnotmatchadigitalpattern,andacquiresallposttriggersamples.

Page 358: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Specifiesthephysicalchannelstouseforpatternmatching.Theorderofthephysicalchannelsdeterminestheorderofthepattern.Ifaportisincluded,theorderofthephysicalchannelswithintheportisinascendingorder.

triggerPattern constchar[] Specifiesthedigitalpatternthatmustbemetforthetriggertooccur.

triggerWhen int32 Specifiestheconditionsunderwhichthetriggeroccurs.

Value DescriptionDAQmx_Val_PatternMatches Pattern

matchesDAQmx_Val_PatternDoesNotMatch Patterndoes

notmatch

pretriggerSamples uInt32 TheminimumnumberofsamplesperchanneltoacquirebeforerecognizingtheReferenceTrigger.ThenumberofposttriggersamplesperchannelisequaltonumberofsamplesperchannelintheNI-DAQmxTimingfunctionsminuspretriggerSamples.

Page 359: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 360: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDisableRefTrigint32DAQmxDisableRefTrig(TaskHandletaskHandle);

Page 361: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDisablesreferencetriggeringforthemeasurementorgeneration.

Page 362: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

Page 363: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 364: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgDigEdgeAdvTrigint32DAQmxCfgDigEdgeAdvTrig(TaskHandletaskHandle,constchar

triggerSource[],int32triggerEdge);

Page 365: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConfiguresaswitchtasktoadvancetothenextentryinascanlistonarisingorfallingedgeofadigitalsignal.

Page 366: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerSource constchar[] Theterminalwherethereisadigitalsignaltouseasthesourceofthetrigger.

triggerEdge int32 Specifiesonwhichedgeofadigitalsignaltoadvancetothenextentryinthescanlist.

Value DescriptionDAQmx_Val_Rising Risingedge(s).DAQmx_Val_Falling Fallingedge(s).

Page 367: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 368: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDisableAdvTrigint32DAQmxDisableAdvTrig(TaskHandletaskHandle);

Page 369: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDisablestheadvancetriggeringforthetask.

Page 370: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

Page 371: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 372: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSendSoftwareTriggerint32DAQmxSendSoftwareTrigger(TaskHandletaskHandle,int32triggerID);

Page 373: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeGeneratesthespecifiedsoftwaretrigger.

Page 374: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

triggerID int32 Specifieswhichsoftwaretriggertogenerate.

Value DescriptionDAQmx_Val_AdvanceTrigger Generatetheadvance

trigger

Page 375: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 376: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadAnalogF64int32DAQmxReadAnalogF64(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,float64readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 377: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiplefloating-pointsamplesfromataskthatcontainsoneormoreanaloginputchannels.

Page 378: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray float64[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 379: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 380: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadAnalogScalarF64int32DAQmxReadAnalogScalarF64(TaskHandletaskHandle,float64timeout,

float64*value,bool32*reserved);

Page 381: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsasinglefloating-pointsamplefromataskthatcontainsasingleanaloginputchannel.

Page 382: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadthesamplefrom.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

value float64* Thesamplereadfromthetask.

Page 383: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 384: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadBinaryI16int32DAQmxReadBinaryI16(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,int16readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 385: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultipleunscaled,signed16-bitintegersamplesfromataskthatcontainsoneormoreanaloginputchannels.

Page 386: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray int16[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 387: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 388: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadBinaryI32int32DAQmxReadBinaryI32(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,int32readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 389: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsoneormoreunscaled32-bitsignedintegersamplesfromataskthatcontainsoneormoreanaloginputchannels.

Page 390: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray int32[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 391: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 392: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadBinaryU16int32DAQmxReadBinaryU16(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt16readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 393: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultipleunscaled,unsigned16-bitintegersamplesfromataskthatcontainsoneormoreanaloginputchannels.

Page 394: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt16[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 395: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 396: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadBinaryU32int32DAQmxReadBinaryU32(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt32readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 397: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsoneormoreunscaled32-bitunsignedintegersamplesfromataskthatcontainsoneormoreanaloginputchannels.

Page 398: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt32[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 399: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 400: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadCounterF64int32DAQmxReadCounterF64(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,float64readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 401: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiplefloating-pointsamplesfromacountertask.Usethisfunctionwhencountersamplesarescaledtoafloating-pointvalue,suchasforfrequencyandperiodmeasurements.

Page 402: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray float64[] Thearraytoreadsamplesinto.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 403: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 404: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadCounterScalarF64int32DAQmxReadCounterScalarF64(TaskHandletaskHandle,float64timeout,

float64*value,bool32*reserved);

Page 405: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsasinglefloating-pointsamplefromacountertask.Usethisfunctionwhenthecountersampleisscaledtoafloating-pointvalue,suchasforfrequencyandperiodmeasurement.

Page 406: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadthesamplefrom.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

value float64* Thesamplereadfromthetask.

Page 407: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 408: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadCounterScalarU32int32DAQmxReadCounterScalarU32(TaskHandletaskHandle,float64timeout,

uInt32*value,bool32*reserved);

Page 409: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsa32-bitintegersamplefromacountertask.Usethisfunctionwhenthecountersampleisreturnedunscaled,suchasforedgecounting.

Page 410: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadthesamplefrom.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

value uInt32* Thesamplereadfromthetask.

Page 411: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 412: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadCounterU32int32DAQmxReadCounterU32(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,uInt32readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 413: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiple32-bitintegersamplesfromacountertask.Usethisfunctionwhencountersamplesarereturnedunscaled,suchasforedgecounting.

Page 414: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt32[] Thearraytoreadsamplesinto.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 415: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 416: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadDigitalLinesint32DAQmxReadDigitalLines(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt8readArray[],uInt32arraySizeInBytes,int32*sampsPerChanRead,int32*numBytesPerSamp,bool32*reserved);

Page 417: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiplesamplesfromeachdigitallineinatask.Eachlineinachannelgetsonebytepersample.

Page 418: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableDatapropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInBytes uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt8[] Thearraytoreadsamplesinto.EachnumBytesPerSampcorrespondstoonesampleperchannel,witheachelementinthatgroupingcorrespondingtoalineinthatchannel,uptothenumberoflinescontainedinthechannel.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 419: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

numBytesPerSamp int32* ThenumberofelementsinreadArraythatconstitutesasampleperchannel.Foreachsampleperchannel,numBytesPerSampisthenumberofbytesthatchannelconsistsof.

Page 420: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 421: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadDigitalScalarU32int32DAQmxReadDigitalScalarU32(TaskHandletaskHandle,float64timeout,

uInt32*value,bool32*reserved);

Page 422: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsasingle32-bitintegersamplefromataskthatcontainsasingledigitalinputchannel.Usethisfunctionfordeviceswithupto32linesperport.Thesampleisreturnedinunsignedintegerformat.

Page 423: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadthesamplefrom.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsample.Iftheentirerequestedsampleisread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnswhatwasactuallyread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

value uInt32* Thesamplereadfromthetask.

Page 424: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 425: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadDigitalU8int32DAQmxReadDigitalU8(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt8readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 426: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiple8-bitintegersamplesfromataskthathasoneormoremultipledigitalinputchannels.Usethisfunctionfordeviceswithupto8linesperport.Thesamplesarereturnedinunsignedbyteformat.

Page 427: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt8[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 428: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 429: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadDigitalU16int32DAQmxReadDigitalU16(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt16readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 430: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiple16-bitintegersamplesfromataskthatcontainsoneormoredigitalinputchannels.Usethisfunctionfordeviceswithupto16linesperport.Thesamplesarereturnedinunsignedintegerformat.

Page 431: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt16[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 432: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 433: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadDigitalU32int32DAQmxReadDigitalU32(TaskHandletaskHandle,int32

numSampsPerChan,float64timeout,bool32fillMode,uInt32readArray[],uInt32arraySizeInSamps,int32*sampsPerChanRead,bool32*reserved);

Page 434: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsmultiple32-bitintegersamplesfromataskthatcontainsoneormoredigitalinputchannels.Usethisfunctionfordeviceswithupto32linesperport.Thesamplesarereturnedinunsignedintegerformat.

Page 435: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Thedefaultvalueof-1(DAQmx_Val_Auto)readsallavailablesamples.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableSamplespropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

fillMode bool32 Specifieswhetherornotthesamplesareinterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(non-interleaved)

DAQmx_Val_GroupByScanNumber Groupbyscannumber(interleaved)

arraySizeInSamps uInt32 Thesizeofthearray,insamples,intowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray uInt32[] Thearraytoreadsamplesinto,organizedaccordingtofillMode.

sampsPerChanRead int32* Theactualnumberofsamplesreadfromeachchannel.

Page 436: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 437: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetNthTaskReadChannelint32DAQmxGetNthTaskReadChannel(TaskHandletaskHandle,uInt32index,

charbuffer[],int32bufferSize);

Page 438: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeTakesatask,anindex,andauserdeclaredbufferwithsize.ItfillsoutthebufferwiththeNthchannelasrequestedbytheuserintheindex.Thiscomesfromallthechannelsinthetask.Indexingstartsat1.

Page 439: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

index uInt32 TheNthchanneltoreturn.Theindexstartsat1.

bufferSize int32 Thesize,inbytes,ofbuffer.Ifyoupass0,thisfunctionreturnsthenumberofbytesneededtoallocate.

Output

buffer char[] TheNthchannelintheindex.IfyoupassNULL,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 440: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 441: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxReadRawint32DAQmxReadRaw(TaskHandletaskHandle,int32numSampsPerChan,

float64timeout,void*readArray,uInt32arraySizeInBytes,int32*sampsRead,int32*numBytesPerSamp,bool32*reserved);

Page 442: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReadsrawsamplesdirectlyfromtheinputlines.Thereisnoscaling,parsing,orseparationofthesamples.Refertothespecificationsforyourdevicetodeterminetheformatoftheincomingsamples.

Page 443: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktoreadsamplesfrom.

numSampsPerChan int32 Thenumberofsamples,perchannel,toread.Ifyousetthisparameterto-1(DAQmx_Val_Auto),NI-DAQmxdetermineshowmanysamplestoreadbasedonwhetherthetaskacquiressamplescontinuouslyoracquiresafinitenumberofsamples.Ifthetaskacquiressamplescontinuouslyandyousetthisparameterto-1,thisfunctionreadsallthesamplescurrentlyavailableinthebuffer.IfreadArraydoesnotcontainenoughspace,thisfunctionreturnsasmanysamplesasfitinreadArray.Ifthetaskacquiresafinitenumberofsamplesandyousetthisparameterto-1,thefunctionwaitsforthetasktoacquireallrequestedsamples,thenreadsthosesamples.IfyousettheReadAllAvailableDatapropertytoTRUE,thefunctionreadsthesamplescurrentlyavailableinthebufferanddoesnotwaitforthetasktoacquireallrequestedsamples.

timeout float64 Theamountoftime,inseconds,towaitforthefunctiontoreadthesample(s).Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetoreadtherequestedsamples.Ifalltherequestedsamplesareread,thefunctionissuccessful.Otherwise,thefunctionreturnsatimeouterrorandreturnsthesamplesthatwereactuallyread.

arraySizeInBytes uInt32 Thesizeofthearrayintowhichsamplesareread.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

readArray void* Thearrayintowhichsamplesareread.

sampsRead int32* Theactualnumberofbytesreadintothearrayperscan.

numBytesPerSamp int32* ThenumberofelementsinreadArraythatconstitutesasample.Thisvaluetakesintoaccountallchannelsthatareread.Forexample,fivechannelsgiving12bytesforoneentirescanreturn12bytes.Thevalueisnotdividedalongchannellines.

Page 444: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 445: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteAnalogF64int32DAQmxWriteAnalogF64(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,float64writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 446: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesmultiplefloating-pointsamplestoataskthatcontainsoneormoreanalogoutputchannels.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeof2samples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 447: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray float64[] Thearrayof64-bitsamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 448: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 449: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteAnalogScalarF64int32DAQmxWriteAnalogScalarF64(TaskHandletaskHandle,bool32autoStart,

float64timeout,float64value,bool32*reserved);

Page 450: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesafloating-pointsampletoataskthatcontainsasingleanalogoutputchannel.

Page 451: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritethesampleto.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowritethevalue.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethevalue.Ifthisfunctionsuccessfullywritesthevalue,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterror.

value float64 A64-bitsampletowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Page 452: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 453: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteBinaryI16int32DAQmxWriteBinaryI16(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,int16writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 454: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesunscaledsignedintegersamplestothetask.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeof2samples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 455: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray int16[] Thearrayof16-bitsamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 456: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 457: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteBinaryU16int32DAQmxWriteBinaryU16(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,uInt16writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 458: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesunscaled,unsigned16-bitintegersamplestothetask.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeof2samples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 459: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray uInt16[] Thearrayof16-bitsamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 460: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 461: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrFreqint32DAQmxWriteCtrFreq(TaskHandletaskHandle,int32numSampsPerChan,

bool32autoStart,float64timeout,bool32dataLayout,float64frequency[],float64dutyCycle[],int32*numSampsPerChanWritten,bool32*reserved);

Page 462: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesanewpulsefrequencyanddutycycletoeachchannelinacontinuouscounteroutputtaskthatcontainsoneormorechannels.

Page 463: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

frequency float64[] Specifiesatwhatfrequencytogeneratepulses.

dutyCycle float64[] Thewidthofthepulsedividedbythepulseperiod.NI-DAQmxusesthisratio,combinedwithfrequency,todeterminebothpulsewidthandpulsedelay.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

numSampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 464: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 465: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrFreqScalarint32DAQmxWriteCtrFreqScalar(TaskHandletaskHandle,bool32autoStart,

float64timeout,float64frequency,float64dutyCycle,bool32*reserved);

Page 466: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesanewpulsefrequencyanddutycycletoacontinuouscounteroutputtaskthatcontainsasinglechannel.

Page 467: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritethesampleto.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

frequency float64 Specifiesatwhatfrequencytogeneratepulses.

dutyCycle float64 Thewidthofthepulsedividedbythepulseperiod.NI-DAQmxusesthisratio,combinedwithfrequency,todeterminebothpulsewidthandpulsedelay.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Page 468: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 469: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrTicksint32DAQmxWriteCtrTicks(TaskHandletaskHandle,int32numSampsPerChan,

bool32autoStart,float64timeout,bool32dataLayout,uInt32highTicks[],uInt32lowTicks[],int32*numSampsPerChanWritten,bool32*reserved);

Page 470: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesnewpulsehightickcountsandlowtickcountstoeachchannelinacontinuouscounteroutputtaskthatcontainsoneormorechannels.

Page 471: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

highTicks uInt32[] Thenumberoftimebaseticksthepulseishigh.

lowTicks uInt32[] Thenumberoftimebaseticksthepulseislow.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

numSampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 472: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 473: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrTicksScalarint32DAQmxWriteCtrTicksScalar(TaskHandletaskHandle,bool32autoStart,

float64timeout,uInt32highTicks,uInt32lowTicks,bool32*reserved);

Page 474: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesanewpulsehightickcountandlowtickcounttoacontinuouscounteroutputtaskthatcontainsasinglechannel.

Page 475: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritethesampleto.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

highTicks uInt32 Thenumberoftimebaseticksthepulseishigh.

lowTicks uInt32 Thenumberoftimebaseticksthepulseislow.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Page 476: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 477: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrTimeint32DAQmxWriteCtrTime(TaskHandletaskHandle,int32numSampsPerChan,

bool32autoStart,float64timeout,bool32dataLayout,float64highTime[],float64lowTime[],int32*numSampsPerChanWritten,bool32*reserved);

Page 478: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesanewpulsehightimeandlowtimetoeachchannelinacontinuouscounteroutputtaskthatcontainsoneormorechannels.

Page 479: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

highTime float64[] Theamountoftimethepulseishigh.

lowTime float64[] Theamountoftimethepulseislow.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

numSampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 480: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 481: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteCtrTimeScalarint32DAQmxWriteCtrTimeScalar(TaskHandletaskHandle,bool32autoStart,

float64timeout,float64highTime,float64lowTime,bool32*reserved);

Page 482: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesanewpulsehightimeandlowtimetoacontinuouscounteroutputtaskthatcontainsasinglechannel.

Page 483: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritethesampleto.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

highTime float64 Theamountoftimethepulseishigh.

lowTime float64 Theamountoftimethepulseislow.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Page 484: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 485: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteDigitalLinesint32DAQmxWriteDigitalLines(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,uInt8writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 486: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesmultiplesamplestoeachdigitallineinatask.Whenyoucreateyourwritearray,eachsampleperchannelmustcontainthenumberofbytesreturnedbytheDAQmx_Read_DigitalLines_BytesPerChanproperty.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeof2samples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 487: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray uInt8[] Thesamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 488: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 489: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteDigitalScalarU32int32DAQmxWriteDigitalScalarU32(TaskHandletaskHandle,bool32autoStart,

float64timeout,uInt32value,bool32*reserved);

Page 490: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesasingle32-bitunsignedintegersampletoataskthatcontainsasingledigitaloutputchannel.Usethisformatfordeviceswithupto32linesperport.

Page 491: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritethesampleto.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowritethevalue.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethevalue.Ifthisfunctionsuccessfullywritesthevalue,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterror.

value uInt32 A32-bitintegersampletowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Page 492: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 493: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteDigitalU8int32DAQmxWriteDigitalU8(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,uInt8writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 494: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesmultiple8-bitunsignedintegersamplestoataskthatcontainsoneormoredigitaloutputchannels.Usethisformatfordeviceswithupto8linesperport.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeoftwosamples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 495: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray uInt8[] Thearrayof8-bitintegersamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 496: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 497: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteDigitalU16int32DAQmxWriteDigitalU16(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,uInt16writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 498: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesmultiple16-bitunsignedintegersamplestoataskthatcontainsoneormoredigitaloutputchannels.Usethisformatfordeviceswithupto16linesperport.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeoftwosamples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 499: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray uInt16[] Thearrayof16-bitintegersamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 500: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 501: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteDigitalU32int32DAQmxWriteDigitalU32(TaskHandletaskHandle,int32

numSampsPerChan,bool32autoStart,float64timeout,bool32dataLayout,uInt32writeArray[],int32*sampsPerChanWritten,bool32*reserved);

Page 502: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesmultiple32-bitunsignedintegersamplestoataskthatcontainsoneormoredigitaloutputchannels.Usethisformatfordeviceswithupto32linesperport.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeoftwosamples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 503: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSampsPerChan int32 Thenumberofsamples,perchannel,towrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,thisfunctionreturnsanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

dataLayout bool32 Specifieshowthesamplesarearranged,eitherinterleavedornoninterleaved.

Value DescriptionDAQmx_Val_GroupByChannel Groupby

channel(noninterleaved)

DAQmx_Val_GroupByScanNumber Groupbysample(interleaved)

writeArray uInt32[] Thearrayof32-bitintegersamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 504: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 505: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteRawint32DAQmxWriteRaw(TaskHandletaskHandle,int32numSamps,bool32

autoStart,float64timeout,void*writeArray,int32*sampsPerChanWritten,bool32*reserved);

Page 506: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesrawsamplestoatask.Thereisnoscaling,parsing,orseparationofthesamples.Refertothespecificationsforyourinstrumenttodeterminetheformatoftheincomingsamples.

NoteIfyouconfiguredtimingforyourtask,yourwriteisconsideredabufferedwrite.Bufferedwritesrequireaminimumbuffersizeof2samples.IfyoudonotconfigurethebuffersizeusingDAQmxCfgOutputBuffer,NI-DAQmxautomaticallyconfiguresthebufferwhenyouconfiguresampletiming.Ifyouattempttowriteonesampleforabufferedwritewithoutconfiguringthebuffer,youwillreceiveanerror.

Page 507: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktowritesamplesto.

numSamps int32 Thenumberofsamplesperchanneltowrite.Youmustpassinavalueof0ormoreinorderforthesampletowrite.Ifyoupassanegativenumber,youwillreceiveanerror.

autoStart bool32 Specifieswhetherornotthisfunctionautomaticallystartsthetaskifyoudonotstartit.

timeout float64 Theamountoftime,inseconds,towaitforthisfunctiontowriteallthesamples.Thedefaultvalueis10.0seconds.Tospecifyaninfinitewait,pass-1(DAQmx_Val_WaitInfinitely).Thisfunctionreturnsanerrorifthetimeoutelapses.Avalueof0indicatestotryoncetowritethesubmittedsamples.Ifthisfunctionsuccessfullywritesallsubmittedsamples,itdoesnotreturnanerror.Otherwise,thefunctionreturnsatimeouterrorandreturnsthenumberofsamplesactuallywritten.

writeArray void* Therawsamplestowritetothetask.

reserved bool32* Reservedforfutureuse.PassNULLtothisparameter.

Output

Name Type Description

sampsPerChanWritten int32* Theactualnumberofsamplesperchannelsuccessfullywrittentothebuffer.

Page 508: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 509: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxExportSignalint32DAQmxExportSignal(TaskHandletaskHandle,int32signalID,constchar

outputTerminal[]);

Page 510: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRoutesacontrolsignaltothespecifiedterminal.Theoutputterminalcanresideonthedevicethatgeneratesthecontrolsignaloronadifferentdevice.Usethisfunctiontoshareclocksandtriggersbetweenmultipletasksanddevices.Theroutescreatedbythisfunctionaretask-basedroutes.

Page 511: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

signalID int32 Thenameofthetrigger,clock,oreventtoexport.

Value DescriptionDAQmx_Val_AIConvertClock Clockthat

causesananalog-to-digitalconversiononanESeriesorMSeriesdevice.Oneconversioncorrespondstoasinglesamplefromonechannel.

DAQmx_Val_10MHzRefClock Outputofanoscillatorthatyoucanusetosynchronizemultipledevices.

DAQmx_Val_20MHzTimebaseClock OutputofanoscillatorthatistheonboardsourceoftheMasterTimebase.Othertimebases

Page 512: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

arederivedfromthisclock.

DAQmx_Val_SampleClock Clockthedeviceusestotimeeachsample.

DAQmx_Val_AdvanceTrigger Triggerthatmovesaswitchtothenextentryinascanlist.

DAQmx_Val_ReferenceTrigger Triggerthatestablishesthereferencepointbetweenpretriggerandposttriggersamples.

DAQmx_Val_StartTrigger Triggerthatbeginsameasurementorgeneration.

DAQmx_Val_AdvCmpltEvent Signalthataswitchproductgeneratesafteritbothexecutesthecommand(s)inascanlistentryandwaitsforthesettlingtime

Page 513: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

toelapse.DAQmx_Val_AIHoldCmpltEvent Signalthat

anESeriesorMSeriesdevicegenerateswhenthedevicelatchesanaloginputdata(theADCenters"hold"mode)anditissafeforanyexternalswitchinghardwaretoremovethesignalandreplaceitwiththenextsignal.Thiseventdoesnotindicatethecompletionoftheactualanalog-to-digitalconversion.

DAQmx_Val_CounterOutputEvent Signalthatacountergenerates.Eachtimethecounterreachesterminal

Page 514: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

count,thissignaltogglesorpulses.

DAQmx_Val_ChangeDetectionEvent SignalthatastaticDIOdevicegenerateswhenthedevicedetectsarisingorfallingedgeonanyofthelinesorportsyouselectedwhenyouconfiguredchangedetectiontiming.

DAQmx_Val_WDTExpiredEvent SignalthatastaticDIOdevicegenerateswhenthewatchdogtimerexpires.

outputTerminal constchar[] Thedestinationterminaloftheexportedsignal.

Page 515: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 516: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCalculateReversePolyCoeffint32DAQmxCalculateReversePolyCoeff(float64forwardCoeffs[],uInt32

numForwardCoeffsIn,float64minValX,float64maxValX,int32numPointsToCompute,int32reversePolyOrder,float64reverseCoeffs[]);

Page 517: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeComputesasetofcoefficientsforapolynomialthatapproximatestheinverseofthepolynomialwiththecoefficientsyouspecifywithforwardCoeffs.Thefunctiongeneratesatableofxversusyvaluesovertherangeofx.Thefunctionthenfindsapolynomialfit,usingtheleastsquaresmethodtocomputeapolynomialthatcomputesanxgivenay.

Page 518: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

forwardCoeffs float64[] Thearrayoftheforwardcoefficientsforthepolynomialthatcomputesygivenavalueofx.Eachelementofthearraycorrespondstoatermoftheequation.Forexample,ifindex3ofthearrayis9,thefourthtermoftheequationis9x3.

numForwardCoeffsIn uInt32 ThenumberofelementsinforwardCoeff.

minValX float64 Theminimumvalueofxforwhichyouusethepolynomial.Thisisthesmallestvalueofxforwhichthefunctiongeneratesayvalueinthetable.

maxValX float64 Themaximumvalueofxforwhichyouusethepolynomial.Thisisthelargestvalueofxforwhichthefunctiongeneratesayvalueinthetable.

numPointsToCompute int32 Thenumberofpointsinthetableofxversusyvalues.ThefunctionspacesthevaluesevenlybetweenminValXandmaxValX.

reversePolyOrder int32 Theorderofthereversepolynomialtocompute.Forexample,aninputof3indicatesa3rdorderpolynomial.Aninputof-1indicatestocomputeareversepolynomialofthesameorderastheforwardpolynomial.

Output

reverseCoeffs float64[] Thearrayofthereversecoefficientsofthepolynomial.Eachelementofthearraycorrespondstoatermoftheequation.Forexample,ifindex3ofthearrayis9,thefourthtermoftheequationis9y3.reverseCoeffswillbeonegreaterthanwhatyoupassedforreversePolyOrder.Ifyoupass-1forreversePolyOrder,thearraymustbethesizeofforwardCoeffs.Otherwise,thebehaviorisundefined.

Page 519: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 520: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateLinScaleint32DAQmxCreateLinScale(constcharname[],float64slope,float64

yIntercept,int32preScaledUnits,constcharscaledUnits[]);

Page 521: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesandconfiguresascalethatusestheequationy=mx+b,wherexistheprescaledvalueandyisthescaledvalue.Theequationisidenticalforinputandoutput.Ifyourequationisintheformx=my+b,youmustfirstsolveforyintermsofx.

Page 522: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

name constchar[] Identifiesthecustomscaleforlateruse,suchaswhenyoucreatechannels.

slope float64 Theslope,m,intheequation.

yIntercept float64 They-intercept,b,intheequation.

preScaledUnits int32 Theunitsofthevaluestoscale.

Value DescriptionDAQmx_Val_Volts voltsDAQmx_Val_Amps amperesDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegR degreesRankineDAQmx_Val_Kelvins kelvinsDAQmx_Val_Strain strainDAQmx_Val_Ohms ohmsDAQmx_Val_Hz hertzDAQmx_Val_Seconds secondsDAQmx_Val_Meters metersDAQmx_Val_Inches inchesDAQmx_Val_Degrees degreesDAQmx_Val_Radians radiansDAQmx_Val_g G.1gisapproximately

equalto9.81m/s2.

DAQmx_Val_Pascals pascalsDAQmx_Val_FromTEDS UnitsdefinedbyTEDS

informationassociatedwiththechannel.

scaledUnits constchar[] Theunitsyouwanttouseforthescaledvalue.Youcanuseanarbitraryvalue.

Page 523: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 524: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateMapScaleint32DAQmxCreateMapScale(constcharname[],float64prescaledMin,float64

prescaledMax,float64scaledMin,float64scaledMax,int32preScaledUnits,constcharscaledUnits[]);

Page 525: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesandconfiguresascalethatscalesvaluesproportionallyfromarangeofprescaledvaluestoarangeofscaledvalues.

Page 526: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

name constchar[] Identifiesthecustomscaleforlateruse,suchaswhenyoucreatechannels.

prescaledMin float64 Thesmallestvalueintherangeofprescaledvalues.NI-DAQmxmapsthisvaluetoscaledMin.

prescaledMax float64 Thelargestvalueintherangeofprescaledvalues.NI-DAQmxmapsthisvaluetoscaledMax.

scaledMin float64 Thesmallestvalueintherangeofscaledvalues.NI-DAQmxmapsthisvaluetoprescaledMin.Readoperationsclipsamplesthataresmallerthanthisvalue.Writeoperationsgenerateerrorsforsamplesthataresmallerthanthisvalue.

scaledMax float64 Thelargestvalueintherangeofscaledvalues.NI-DAQmxmapsthisvaluetoprescaledMax.Readoperationsclipsamplesthatarelargerthanthisvalue.Writeoperationsgenerateerrorsforsamplesthatarelargerthanthisvalue.

preScaledUnits int32 Theunitsofthevaluestoscale.

Value DescriptionDAQmx_Val_Volts voltsDAQmx_Val_Amps amperesDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegR degreesRankineDAQmx_Val_Kelvins kelvinsDAQmx_Val_Strain strainDAQmx_Val_Ohms ohmsDAQmx_Val_Hz hertzDAQmx_Val_Seconds secondsDAQmx_Val_Meters metersDAQmx_Val_Inches inchesDAQmx_Val_Degrees degreesDAQmx_Val_Radians radiansDAQmx_Val_g G.1gisapproximately

equalto9.81m/s2.

DAQmx_Val_Pascals pascals

Page 527: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_FromTEDS UnitsdefinedbyTEDSinformationassociatedwiththechannel.

scaledUnits constchar[] Theunitsyouwanttouseforthescaledvalue.Youcanuseanarbitraryvalue.

Page 528: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 529: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreatePolynomialScaleint32DAQmxCreatePolynomialScale(constcharname[],float64

forwardCoeffs[],uInt32numForwardCoeffsIn,float64reverseCoeffs[],uInt32numReverseCoeffsIn,int32preScaledUnits,constcharscaledUnits[]);

Page 530: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesandconfiguresascalethatusesannthorderpolynomialequation.NI-DAQmxrequiresbothapolynomialtoconvertprescaledvaluestoscaledvalues(forward)andapolynomialtoconvertscaledvaluestoprescaledvalues(reverse).Ifyouknowonlyonesetofcoefficients,useDAQmxCalculateReversePolyCoefftogeneratetheotherset.

Page 531: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

name constchar[] Identifiesthecustomscaleforlateruse,suchaswhenyoucreatechannels.

forwardCoeffs float64[] Anarrayofcoefficientsforthepolynomialthatconvertsprescaledvaluestoscaledvalues.Eachelementofthearraycorrespondstoatermoftheequation.Forexample,ifindex3ofthearrayis9,thefourthtermoftheequationis9x3.

numForwardCoeffsIn uInt32 ThenumberofelementsinforwardCoeff.

reverseCoeffs float64[] Anarrayofcoefficientsforthepolynomialthatconvertsscaledvaluestoprescaledvalues.Eachelementofthearraycorrespondstoatermoftheequation.Forexample,ifindex3ofthearrayis9,thefourthtermoftheequationis9y3.

numReverseCoeffsIn uInt32 ThenumberofelementsinreverseCoeff.

preScaledUnits int32 Theunitsofthevaluestoscale.

Value DescriptionDAQmx_Val_Volts voltsDAQmx_Val_Amps amperesDAQmx_Val_DegF degrees

FahrenheitDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegR degreesRankineDAQmx_Val_Kelvins kelvinsDAQmx_Val_Strain strainDAQmx_Val_Ohms ohmsDAQmx_Val_Hz hertzDAQmx_Val_Seconds secondsDAQmx_Val_Meters metersDAQmx_Val_Inches inchesDAQmx_Val_Degrees degreesDAQmx_Val_Radians radiansDAQmx_Val_g G.1gis

approximately

Page 532: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

equalto9.81m/s2.

DAQmx_Val_Pascals pascalsDAQmx_Val_FromTEDS Unitsdefinedby

TEDSinformationassociatedwiththechannel.

scaledUnits constchar[] Theunitsyouwanttouseforthescaledvalue.Youcanuseanarbitraryvalue.

Page 533: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 534: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateTableScaleint32DAQmxCreateTableScale(constcharname[],float64prescaledVals[],

uInt32numPrescaledValsIn,float64scaledVals[],uInt32numScaledValsIn,int32preScaledUnits,constcharscaledUnits[]);

Page 535: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesandconfiguresascalethatmapsanarrayofprescaledvaluestoanarrayofcorrespondingscaledvalues.NI-DAQmxapplieslinearinterpolationtovaluesthatfallbetweenthevaluesinthetable.Readoperationsclipscaledsamplesthatareoutsidethemaximumandminimumscaledvaluesfoundinthetable.Writeoperationsgenerateerrorsforsamplesthatareoutsidetheminimumandmaximumscaledvaluesfoundinthetable.

Page 536: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

name constchar[] Identifiesthecustomscaleforlateruse,suchaswhenyoucreatechannels.

prescaledVals float64[] Anarrayofprescaledvalues.ThesevaluesmapdirectlytothevaluesinscaledVals.

numPrescaledValsIn uInt32 ThenumberofelementsinprescaledVals.

scaledVals float64[] Anarrayofscaledvalues.ThesevaluesmapdirectlytothevaluesinprescaledVals.

numScaledValsIn uInt32 ThenumberofelementsinscaledVals.

preScaledUnits int32 Theunitsofthevaluestoscale.

Value DescriptionDAQmx_Val_Volts voltsDAQmx_Val_Amps amperesDAQmx_Val_DegF degreesFahrenheitDAQmx_Val_DegC degreesCelsiusDAQmx_Val_DegR degreesRankineDAQmx_Val_Kelvins kelvinsDAQmx_Val_Strain strainDAQmx_Val_Ohms ohmsDAQmx_Val_Hz hertzDAQmx_Val_Seconds secondsDAQmx_Val_Meters metersDAQmx_Val_Inches inchesDAQmx_Val_Degrees degreesDAQmx_Val_Radians radiansDAQmx_Val_g G.1gis

approximatelyequalto9.81m/s2.

DAQmx_Val_Pascals pascals

DAQmx_Val_FromTEDS Unitsdefinedby

Page 537: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

TEDSinformationassociatedwiththechannel.

scaledUnits constchar[] Theunitsyouwanttouseforthescaledvalue.Youcanuseanarbitraryvalue.

Page 538: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 539: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgInputBufferint32DAQmxCfgInputBuffer(TaskHandletaskHandle,uInt32

numSampsPerChan);

Page 540: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeOverridestheautomaticinputbufferallocationthatNI-DAQmxperforms.

Page 541: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

numSampsPerChan uInt32 Thenumberofsamplesthebuffercanholdforeachchannelinthetask.Zeroindicatesnobuffershouldbeallocated.Useabuffersizeof0toperformahardware-timedoperationwithoutusingabuffer.

Page 542: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 543: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCfgOutputBufferint32DAQmxCfgOutputBuffer(TaskHandletaskHandle,uInt32

numSampsPerChan);

Page 544: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeOverridestheautomaticoutputbufferallocationthatNI-DAQmxperforms.

Page 545: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

numSampsPerChan uInt32 Thenumberofsamplesthebuffercanholdforeachchannelinthetask.Zeroindicatesnobuffershouldbeallocated.Useabuffersizeof0toperformahardware-timedoperationwithoutusingabuffer.

Page 546: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 547: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWaitForNextSampleClockint32DAQmxWaitForNextSampleClock(TaskHandletaskHandle,float64

timeout,bool32*isLate);

Page 548: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWaitsuntilthenextpulseoftheSampleClockoccurs.IfanextraSampleClockpulseoccursbetweencallstothisfunction,thesecondcallreturnsanerrororwarningandwaitsforthenextSampleClockpulse.Usetheget/set/resetfunctionsfortheRealTimeConvLateErrorsToWarningspropertytospecifywhetherthisfunctionreturnserrorsorwarnings.UsethisfunctiontoensureI/OcyclescompletewithinSampleClockperiods.NationalInstrumentsrecommendsyouusethisfunctionforcertainapplicationsonly.UsetheDAQmxReal-Timepropertiestoconfigureerrorreportingandwaitingoptions.

Page 549: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

timeout float64 Themaximumamountoftime,inseconds,towaitforthenextSampleClockpulse.Ifthetimeelapses,thisVIreturnsanerror.Thedefaulttimeoutis10seconds.Ifyousettimeoutto-1,thisVIwaitsindefinitely.

Output

Name Type Description

isLate int32 Avalueof0indicatesthereadorwritefunctionexecutedinrealtime.Avalueof1indicatesthefunctiondidnotexecuteinrealtime.

Page 550: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

isLate int32 IndicatesifthisfunctiondetectedanextraSampleClockpulseafterthespecifiednumberofwarmupiterationsexecute.IfyouareusingtheCAPI,useDAQmxSetRealTimeNumOfWarmupIterstospecifythenumberofwarmupiterations.IfyouareusingtheCVIAPI,useDAQmxSetRealTimeAttributetospecifythenumberofiterations.ThisoutputisalwaysFALSEuntilthatnumberofloopiterationsexecute.

Page 551: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWaitUntilTaskDoneint32DAQmxWaitUntilTaskDone(TaskHandletaskHandle,float64

timeToWait);

Page 552: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWaitsforthemeasurementorgenerationtocomplete.Usethisfunctiontoensurethatthespecifiedoperationiscompletebeforeyoustopthetask.

Page 553: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

timeToWait float64 Themaximumamountoftime,inseconds,towaitforthemeasurementorgenerationtocomplete.Thefunctionreturnsanerrorifthetimeelapsesbeforethemeasurementorgenerationiscomplete.Avalueof-1(DAQmx_Val_WaitInfinitely)meanstowaitindefinitely.IfyousettimeToWaitto0,thefunctionchecksonceandreturnsanerrorifthemeasurementorgenerationisnotdone.

Page 554: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 555: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ObsoleteThisfunctionisobsoleteandnowalwaysreturnszero.Theinformationbelownolongerappliesbutisprovidedforreference.

Page 556: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxIsReadOrWriteLatebool32DAQmxIsReadOrWriteLate(int32errorCode);

Page 557: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsTRUEifaDAQmxReadfunctionorDAQmxWritefunctiondidnotexecuteinrealtime.

Page 558: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

errorCode int32 AnerrorcodeorwarningreturnedbyoneoftheNI-DAQmxLibraryReadorWritefunctions.

Page 559: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

isLate int32 Avalueof0indicatesthereadorwritefunctionexecutedinrealtime.Avalueof1indicatesthefunctiondidnotexecuteinrealtime.

Page 560: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchCloseRelaysint32DAQmxSwitchCloseRelays(constcharrelays[],bool32waitForSettling);

Page 561: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeClosesthespecifiedrelays.IfyousetwaitForSettlingtoTRUE,thisfunctionwaitsonlyafterclosingallrelays.Ifyouwanttowaitforsettlingafterclosingeachrelay,usethisfunctionmultipletimestocloseeachrelayseparately.Whenyouoperaterelaysdirectly,youcircumventtheprotectionthatchannelusagetypesoffer.AvoidusingthisfunctionwhenyouusetheDAQmxSwitchConnectfunctionortheDAQmxSwitchDisconnectfunction.Thisfunctiondoesnotpassthechangesyoumaketothosefunctions.

Page 562: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relays constchar[] Asetofrelaystoclose.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 563: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 564: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchConnectint32DAQmxSwitchConnect(constcharswitchChannel1[],constchar

switchChannel2[],bool32waitForSettling);

Page 565: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeMakesaconnectionbetweentwoswitchchannels.Whenusingthisfunction,specifyonlythetwoconnectionendpointsusingswitchChannel1andswitchChannel2.Thefunctionthenattemptstofindanavailablepathbetweenthetwochannels.

Page 566: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

switchChannel1 constchar[] Thefirstchanneltoconnect.

switchChannel2 constchar[] Thesecondchanneltoconnect.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 567: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 568: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchConnectMultiint32DAQmxSwitchConnectMulti(constcharconnectionList[],bool32

waitForSettling);

Page 569: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeMakesoneormoreconnectionsspecifiedbyaconnectionlist.Youcanspecifyonlythetwoendpoints,oryoucanspecifytheexplicitpathbetweentwoendpoints.Thisfunctioncanmakeconnectionsonmultipledevices,buteachconnectionmustresideonasingledevice.Intheeventofanerror,connectingstopsatthepointinthelistwheretheerroroccurred.IfyousetwaitForSettlingtoTRUE,thisfunctionreturnsonlyaftermakingallconnections.Ifyouwanttowaitforsettlingbetweenconnections,usethisfunctionmultipletimestomakeconnectionsseparately.

Page 570: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

connectionList constchar[] Alistofconnections,usingaspecialsyntax,tomakebetweenswitchchannels.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 571: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 572: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchCreateScanListint32DAQmxSwitchCreateScanList(constcharscanList[],TaskHandle

*taskHandle);

Page 573: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesanewswitchscanningtaskthatusesthespecifiedscanlistandappliesittothespecifiedtask.

Page 574: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

scanList constchar[] Usesaspecialsyntaxtospecifythesequenceofconnectionsanddisconnectionsforthetask.

Output

Name Type Description

taskHandle TaskHandle* Thetaskcreatedbythisfunction.

Page 575: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 576: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchDisconnectint32DAQmxSwitchDisconnect(constcharswitchChannel1[],constchar

switchChannel2[],bool32waitForSettling);

Page 577: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDisconnectstwoswitchchannels.Whenusingthisfunction,specifyonlythetwoconnectionendpointsswitchChannel1andswitchChannel2.

Page 578: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

switchChannel1 constchar[] Thefirstchanneltodisconnect.

switchChannel2 constchar[] Thesecondchanneltodisconnect.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 579: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 580: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchDisconnectAllint32DAQmxSwitchDisconnectAll(constchardeviceName[],bool32

waitForSettling);

Page 581: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeTerminatesallactiveconnectionsonthedevice,whichplacestherelaysintothetopologyresetstate.YoucanusethisfunctiontoterminateconnectionsmadebyDAQmxSwitchConnect,DAQmxSwitchOpenRelays,orDAQmxSwitchCloseRelays.Thisfunctiondoesnotalterthesettlingtimeorchannelusagesettings.Toresetthosesettings,useDAQmxResetDeviceorDAQmxSwitchSetTopologyAndReset.IfyousetwaitForSettlingtoTRUE,thisfunctionreturnsonlyafterterminatingallconnections.Ifyouwanttowaitforsettlingbetweendisconnections,usetheDAQmxSwitchDisconnectfunctionmultipletimestoterminateconnectionsseparately.

Page 582: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 583: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 584: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchDisconnectMultiint32DAQmxSwitchDisconnectMulti(constcharconnectionList[],bool32

waitForSettling);

Page 585: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeTerminatesoneormoreconnectionsspecifiedbyaconnectionlist.Thisfunctioncanterminateconnectionsonmultipledevices.Intheeventofanerror,thefunctionstopsatthepointinthelistwheretheerroroccurred.IfyousetwaitForSettlingtoTRUE,thisfunctionreturnsonlyafterterminatingallconnections.Ifyouwanttowaitforsettlingbetweendisconnections,usethisfunctionmultipletimestoterminateconnectionsseparately.

Page 586: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

connectionList constchar[] Usesaspecialsyntaxtospecifythelistofswitchconnectionstoterminate.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 587: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 588: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchFindPathint32DAQmxSwitchFindPath(constcharswitchChannel1[],constchar

switchChannel2[],charpath[],uInt32pathBufferSize,int32*pathStatus);

Page 589: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsinformationaboutthepathbetweenswitchChannel1andswitchChannel2.Ifthechannelsareconnected,thisfunctionreturnsthepathbywhichtheyareconnected.Ifthechannelsarenotconnected,thefunctionreturnsapathbywhichtheycouldbeconnected,ifoneisavailable.

Page 590: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

switchChannel1 constchar[] Thefirstchanneltoconnect.

switchChannel2 constchar[] Thesecondchanneltoconnect.

pathBufferSize uInt32 Thesizeofpath.Ifyoupass0,thisfunctionreturnsthesizeofthebufferneededtoallocate.

Output

Name Type Description

path char[] TheexistingpathoranavailablepathbetweenswitchChannel1andswitchChannel2thesamesyntaxasaconnectionordisconnectionlist.IfyoupassNULL,thisfunctionreturnsthesizeofthebufferneededtoallocate.

pathStatus int32* Thestatusoftherequestedpath.Thefollowingvaluescanbereturned:

ValueDAQmx_Val_PathStatus_Available

DAQmx_Val_PathStatus_AlreadyExists

DAQmx_Val_PathStatus_Unsupported

Page 591: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_PathStatus_ChannelInUse

DAQmx_Val_PathStatus_SourceChannelConflict

DAQmx_Val_PathStatus_ChannelReservedForRouting

Page 592: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofbytesneededtoallocate.

Page 593: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchGetMultiRelayCountint32DAQmxSwitchGetMultiRelayCount(constcharrelayList[],uInt32

count[],uInt32countArraySize,uInt32*numRelayCountsRead);

Page 594: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsthenumberoftimesasetofrelayshavebeenactuated.Usethisfunctiontotrackrelaylifetimeandusage.YoumustsetthewaitForSettlingparameterofSwitchfunctionstoTRUEtoobtainanaccuraterelaycount.

Page 595: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relayList constchar[] Thesetofrelaysyouwanttoquery.

countArraySize uInt32 Thesizeofcount.Ifyoupass0,thisfunctionreturnsthenumberofsamplesneededtoallocate.

Output

Name Type Description

count uInt32[] Numberoftimeseachspecifiedrelayhasbeenactuated.TheorderofthisarraydependsontheorderofrelayList.IfyoupassNULL,thisfunctionreturnsthenumberofsamplesneededtoallocate.

numRelayCountsRead uInt32* Thenumberofrelaycountsreadbythefunction.

Page 596: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofsamplesneededtoallocate.Forexample,malloc(n*sizeof(uInt32));

Page 597: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchGetMultiRelayPosint32DAQmxSwitchGetMultiRelayPos(constcharrelayList[],uInt32

relayPos[],uInt32relayPosArraySize,uInt32*numRelayPosRead);

Page 598: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsthecurrentpositionofasetofrelays.

Page 599: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relayList constchar[] Thesetofrelaysyouwanttoquery.

relayPosArraySize uInt32 ThesizeofrelayPos.Ifyoupass0,thisfunctionreturnsthenumberofsamplesneededtoallocate.

Output

Name Type Description

relayPos uInt32[] Thepositionofeachspecifiedrelay.TheorderofthisarraycorrespondstotheorderofrelayList.IfyoupassNULL,thisfunctionreturnsthenumberofsamplesneededtoallocate.

Value DescriptionDAQmx_Val_Open Relayisopen.DAQmx_Val_Closed Relayisclosed.

numRelayPosRead uInt32* Thenumberofrelaypositionsreadbythefunction.

Page 600: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.Forthisfunction,ifyoupassNULLforthebufferor0forthebuffersize,thisfunctionreturnsthenumberofsamplesneededtoallocate.Forexample,malloc(n*sizeof(uInt32));

Page 601: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchGetSingleRelayCountint32DAQmxSwitchGetSingleRelayCount(constcharrelayName[],uInt32

*count);

Page 602: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsthenumberoftimesasinglerelayhasbeenactuated.Usethisfunctiontotrackrelaylifetimeandusage.YoumustsetthewaitForSettlingparameterofSwitchfunctionstoTRUEtoobtainanaccuraterelaycount.

Page 603: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relayName constchar[] Therelayyouwanttoquery.

Output

Name Type Description

count uInt32* Thenumberoftimestherelayhasbeenactuated.

Page 604: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 605: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchGetSingleRelayPosint32DAQmxSwitchGetSingleRelayPos(constcharrelayName[],uInt32

*relayPos);

Page 606: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsthecurrentpositionofasinglerelay.

Page 607: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relayName constchar[] Therelayyouwanttoquery.

Output

Name Type Description

relayPos uInt32* Thepositionoftherelay.

Value DescriptionDAQmx_Val_Open Relayisopen.DAQmx_Val_Closed Relayisclosed.

Page 608: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 609: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchOpenRelaysint32DAQmxSwitchOpenRelays(constcharrelays[],bool32waitForSettling);

Page 610: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeOpensthespecifiedrelays.IfyousetwaitForSettlingtoTRUE,thisfunctionwaitsonlyafteropeningallrelays.Ifyouwanttowaitforsettlingafteropeningeachrelay,usethisfunctionmultipletimestoopeneachrelayseparately.Whenyouoperaterelaysdirectly,youcircumventtheprotectionofferedchannelusagetypes.AvoidusingthisfunctionwhenyouuseDAQmxSwitchConnectandDAQmxSwitchDisconnect.Thisfunctiondoesnotpassthechangesyoumaketothosefunctions.

Page 611: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

relays constchar[] Asetofrelaystoopen.

waitForSettling bool32 IfTRUE,thisfunctionwaitsfortheswitchestosettlebeforereturning.IfFALSE,thefunctionreturnsimmediatelyaftertheoperation.

Page 612: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 613: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchSetTopologyAndResetint32DAQmxSwitchSetTopologyAndReset(constchardeviceName[],const

charnewTopology[]);

Page 614: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeResetsaswitchdeviceandsetsitstopologytotheonespecifiedwithnewTopology.Usethisfunctiontoinitializeaswitchdevicebeforescanningormakingconnectionstoensuretheinitialstateofthatswitch.ThisfunctiondiffersfromDAQmxResetDevicebecauseitusestheinputtopologynameratherthantheoneyouspecifyinMAX.ThisfunctiondoesnotmodifythechannelusagedefaultsyouconfigureinMAX.

Page 615: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

newTopology constchar[] Theswitchtopologytouseonthedevice.Thefollowingtablelistsexamples.

ValueDAQmx_Val_Switch_Topology_1127_1_Wire_64x1_Mux

DAQmx_Val_Switch_Topology_1127_2_Wire_32x1_Mux

DAQmx_Val_Switch_Topology_1127_2_Wire_4x8_Matrix

DAQmx_Val_Switch_Topology_1127_4_Wire_16x1_Mux

DAQmx_Val_Switch_Topology_1127_IndependentDAQmx_Val_Switch_Topology_1128_1_Wire_64x1_Mux

DAQmx_Val_Switch_Topology_1128_2_Wire_32x1_Mux

DAQmx_Val_Switch_Topology_1128_2_Wire_4x8_Matrix

DAQmx_Val_Switch_Topology_1128_4_Wire_16x1_Mux

DAQmx_Val_Switch_Topology_1128_IndependentDAQmx_Val_Switch_Topology_1129_2_Wire_16x16_Matrix

DAQmx_Val_Switch_Topology_1129_2_Wire_8x32_Matrix

DAQmx_Val_Switch_Topology_1129_2_Wire_4x64_Matrix

DAQmx_Val_Switch_Topology_1129_2_Wire_Dual_8x16_Matrix

Page 616: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_1129_2_Wire_Dual_4x32_Matrix

DAQmx_Val_Switch_Topology_1129_2_Wire_Quad_4x16_Matrix

DAQmx_Val_Switch_Topology_1130_1_Wire_256x1_Mux

DAQmx_Val_Switch_Topology_1130_1_Wire_Dual_128x1_Mux

DAQmx_Val_Switch_Topology_1130_2_Wire_128x1_Mux

DAQmx_Val_Switch_Topology_1130_4_Wire_64x1_Mux

DAQmx_Val_Switch_Topology_1130_1_Wire_4x64_Matrix

DAQmx_Val_Switch_Topology_1130_1_Wire_8x32_Matrix

DAQmx_Val_Switch_Topology_1130_1_Wire_Octal_32x1_Mux

DAQmx_Val_Switch_Topology_1130_1_Wire_Quad_64x1_Mux

DAQmx_Val_Switch_Topology_1130_1_Wire_Sixteen_16x1_Mux

DAQmx_Val_Switch_Topology_1130_2_Wire_4x32_Matrix

DAQmx_Val_Switch_Topology_1130_2_Wire_Octal_16x1_Mux

DAQmx_Val_Switch_Topology_1130_2_Wire_Quad_32x1_Mux

DAQmx_Val_Switch_Topology_1130_4_Wire_Quad_16x1_Mux

DAQmx_Val_Switch_Topology_1130_Independent

Page 617: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_1160_16_SPDTDAQmx_Val_Switch_Topology_1161_8_SPDTDAQmx_Val_Switch_Topology_1163R_Octal_4x1_Mux

DAQmx_Val_Switch_Topology_1166_32_SPDTDAQmx_Val_Switch_Topology_1167_IndependentDAQmx_Val_Switch_Topology_1169_100_SPSTDAQmx_Val_Switch_Topology_1175_1_Wire_196x1_Mux

DAQmx_Val_Switch_Topology_1175_2_Wire_98x1_Mux

DAQmx_Val_Switch_Topology_1175_2_Wire_95x1_Mux

DAQmx_Val_Switch_Topology_1190_Quad_4x1_Mux

DAQmx_Val_Switch_Topology_1191_Quad_4x1_Mux

DAQmx_Val_Switch_Topology_1192_8_SPDTDAQmx_Val_Switch_Topology_1193_32x1_MuxDAQmx_Val_Switch_Topology_1193_Dual_16x1_Mux

DAQmx_Val_Switch_Topology_1193_Quad_8x1_Mux

DAQmx_Val_Switch_Topology_1193_16x1_Terminated_Mux

DAQmx_Val_Switch_Topology_1193_Dual_8x1_Terminated_Mux

DAQmx_Val_Switch_Topology_1193_Quad_4x1_Terminated_Mux

DAQmx_Val_Switch_Topology_1193_IndependentDAQmx_Val_Switch_Topology_1194_Quad_4x1_Mux

Page 618: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_1195_Quad_4x1_Mux

DAQmx_Val_Switch_Topology_2501_1_Wire_48x1_Mux

DAQmx_Val_Switch_Topology_2501_1_Wire_48x1_Amplified_Mux

DAQmx_Val_Switch_Topology_2501_2_Wire_24x1_Mux

DAQmx_Val_Switch_Topology_2501_2_Wire_24x1_Amplified_Mux

DAQmx_Val_Switch_Topology_2501_2_Wire_Dual_12x1_Mux

DAQmx_Val_Switch_Topology_2501_2_Wire_Quad_6x1_Mux

DAQmx_Val_Switch_Topology_2501_2_Wire_4x6_Matrix

DAQmx_Val_Switch_Topology_2501_4_Wire_12x1_Mux

DAQmx_Val_Switch_Topology_2503_1_Wire_48x1_Mux

DAQmx_Val_Switch_Topology_2503_2_Wire_24x1_Mux

DAQmx_Val_Switch_Topology_2503_2_Wire_Dual_12x1_Mux

DAQmx_Val_Switch_Topology_2503_2_Wire_Quad_6x1_Mux

DAQmx_Val_Switch_Topology_2503_2_Wire_4x6_Matrix

DAQmx_Val_Switch_Topology_2503_4_Wire_12x1_Mux

DAQmx_Val_Switch_Topology_2527_1_Wire_64x1_Mux

Page 619: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_2527_1_Wire_Dual_32x1_Mux

DAQmx_Val_Switch_Topology_2527_2_Wire_32x1_Mux

DAQmx_Val_Switch_Topology_2527_2_Wire_Dual_16x1_Mux

DAQmx_Val_Switch_Topology_2527_4_Wire_16x1_Mux

DAQmx_Val_Switch_Topology_2527_IndependentDAQmx_Val_Switch_Topology_2529_2_Wire_8x16_Matrix

DAQmx_Val_Switch_Topology_2529_2_Wire_4x32_Matrix

DAQmx_Val_Switch_Topology_2529_2_Wire_Dual_4x16_Matrix

DAQmx_Val_Switch_Topology_2530_1_Wire_128x1_Mux

DAQmx_Val_Switch_Topology_2530_1_Wire_Dual_64x1_Mux

DAQmx_Val_Switch_Topology_2530_2_Wire_64x1_Mux

DAQmx_Val_Switch_Topology_2530_4_Wire_32x1_Mux

DAQmx_Val_Switch_Topology_2530_1_Wire_4x32_Matrix

DAQmx_Val_Switch_Topology_2530_1_Wire_8x16_Matrix

DAQmx_Val_Switch_Topology_2530_1_Wire_Octal_16x1_Mux

DAQmx_Val_Switch_Topology_2530_1_Wire_Quad_32x1_Mux

DAQmx_Val_Switch_Topology_2530_2_Wire_4x16_Matrix

Page 620: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_2530_2_Wire_Dual_32x1_Mux

DAQmx_Val_Switch_Topology_2530_2_Wire_Quad_16x1_Mux

DAQmx_Val_Switch_Topology_2530_4_Wire_Dual_16x1_Mux

DAQmx_Val_Switch_Topology_2530_IndependentDAQmx_Val_Switch_Topology_2532_1_Wire_16x32_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_4x128_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_8x64_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_Dual_16x16_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_Dual_4x64_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_Dual_8x32_Matrix

DAQmx_Val_Switch_Topology_2532_1_Wire_Sixteen_2x16_Matrix

DAQmx_Val_Switch_Topology_2532_2_Wire_16x16_Matrix

DAQmx_Val_Switch_Topology_2532_2_Wire_4x64_Matrix

DAQmx_Val_Switch_Topology_2532_2_Wire_8x32_Matrix

DAQmx_Val_Switch_Topology_2564_16_SPSTDAQmx_Val_Switch_Topology_2565_16_SPSTDAQmx_Val_Switch_Topology_2566_16_SPDT

Page 621: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_2567_IndependentDAQmx_Val_Switch_Topology_2568_31_SPSTDAQmx_Val_Switch_Topology_2569_100_SPSTDAQmx_Val_Switch_Topology_2570_40_SPDTDAQmx_Val_Switch_Topology_2575_1_Wire_196x1_Mux

DAQmx_Val_Switch_Topology_2575_2_Wire_98x1_Mux

DAQmx_Val_Switch_Topology_2575_2_Wire_95x1_Mux

DAQmx_Val_Switch_Topology_2576_2_Wire_64x1_Mux

DAQmx_Val_Switch_Topology_2576_2_Wire_Dual_32x1_Mux

DAQmx_Val_Switch_Topology_2576_2_Wire_Octal_8x1_Mux

DAQmx_Val_Switch_Topology_2576_2_Wire_Quad_16x1_Mux

DAQmx_Val_Switch_Topology_2576_2_Wire_Sixteen_4x1_Mux

DAQmx_Val_Switch_Topology_2576_IndependentDAQmx_Val_Switch_Topology_2585_1_Wire_10x1_Mux

DAQmx_Val_Switch_Topology_2586_10_SPSTDAQmx_Val_Switch_Topology_2590_4x1_MuxDAQmx_Val_Switch_Topology_2591_4x1_MuxDAQmx_Val_Switch_Topology_2593_16x1_MuxDAQmx_Val_Switch_Topology_2593_Dual_8x1_Mux

DAQmx_Val_Switch_Topology_2593_8x1_Terminated_Mux

DAQmx_Val_Switch_Topology_2593_Dual_4x1_Terminated_Mux

Page 622: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Switch_Topology_2593_IndependentDAQmx_Val_Switch_Topology_2594_4x1_MuxDAQmx_Val_Switch_Topology_2595_4x1_MuxDAQmx_Val_Switch_Topology_2596_Dual_6x1_Mux

DAQmx_Val_Switch_Topology_2597_6x1_Terminated_Mux

DAQmx_Val_Switch_Topology_2598_Dual_Transfer

DAQmx_Val_Switch_Topology_2599_2_SPDT

Page 623: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 624: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSwitchWaitForSettlingint32DAQmxSwitchWaitForSettling(constchardeviceName[]);

Page 625: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWaitsforthesettlingtimeonthedevicetoexpire.Thedeviceresetsthistimeandbeginscountingdownagainwhenthedeviceperformsanoperation.Thisfunctioncanreturnimmediatelyifnooperationhappenedrecently.

Page 626: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Page 627: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 628: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxConnectTermsint32DAQmxConnectTerms(constcharsourceTerminal[],constchar

destinationTerminal[],int32signalModifiers);

Page 629: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesaroutebetweenasourceanddestinationterminal.Theroutecancarryavarietyofdigitalsignals,suchastriggers,clocks,andhardwareevents.Thesesourceanddestinationterminalscanbeondifferentdevicesaslongasaconnectingpublicbus,suchasRTSIorthePXIbackplane,isavailable.DAQmxConnectTermsdoesnotmodifyatask.WhenDAQmxConnectTermsruns,therouteisimmediatelyreservedandcommittedtohardware.Thistypeofroutingiscalledimmediaterouting.

Page 630: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

sourceTerminal constchar[] Theoriginatingterminaloftheroute.Youcanspecifyaterminalname.

destinationTerminal constchar[] Thereceivingterminaloftheroute.Youcanspecifyaterminalname.

signalModifiers int32 SpecifieswhetherornottoinvertthesignalroutedfromthesourceTerminaltothedestinationTerminal.Ifthedeviceisnotcapableofsignalinversionorifapreviousroutereservedtheinversioncircuitryinanincompatibleconfiguration,attemptingtoinvertthesignalcausesanerror.

Value DescriptionDAQmx_Val_DoNotInvertPolarity Donot

invertthesignal.

DAQmx_Val_InvertPolarity Invertthesignal.

Page 631: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 632: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDisconnectTermsint32DAQmxDisconnectTerms(constcharsourceTerminal[],constchar

destinationTerminal[]);

Page 633: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRemovessignalroutespreviouslycreatedusingDAQmxConnectTerms.DAQmxDisconnectTermscannotremovetask-basedroutes,suchasthosecreatedthroughtimingandtriggeringconfiguration.Whenthisfunctionexecutes,therouteisunreservedimmediately.Forthisreason,thistypeofroutingiscalledimmediaterouting.

Page 634: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

sourceTerminal constchar[] Theoriginatingterminaloftheroute.Youcanspecifyaterminalname.

destinationTerminal constchar[] Thereceivingterminaloftheroute.Youcanspecifyaterminalname.

Page 635: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 636: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxTristateOutputTermint32DAQmxTristateOutputTerm(constcharoutputTerminal[]);

Page 637: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsaterminaltohigh-impedancestate.IfyouconnectanexternalsignaltoaterminalontheI/Oconnector,theterminalmustbeinhigh-impedancestate.Otherwise,thedevicecoulddouble-drivetheterminalanddamagethehardware.Ifyouusethisfunctiononaterminalinanactiveroute,thefunctionfailsandreturnsanerror.DAQmxResetDevicesetsallterminalsontheI/Oconnectortohigh-impedancestatebutabortsanyrunningtasksassociatedwiththedevice.

Page 638: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

outputTerminal constchar[] TheterminalontheI/Oconnectortosettohigh-impedancestate.Youcanspecifyaterminalname.

Page 639: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 640: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxResetDeviceint32DAQmxResetDevice(constchardeviceName[]);

Page 641: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeImmediatelyabortsalltasksassociatedwithadeviceandreturnsthedevicetoaninitializedstate.Abortingataskstopsandreleasesanyresourcesthetaskreserved.

Page 642: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Page 643: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 644: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxControlWatchdogTaskint32DAQmxControlWatchdogTask(TaskHandletaskHandle,int32action);

Page 645: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeControlsthewatchdogtaskaccordingtotheactionyouspecify.

Page 646: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

action int32 Specifieshowtocontrolthewatchdogtask.

Value DescriptionDAQmx_Val_ResetTimer Resetstheinternal

timerto0.Youmustcontinuallyresettheinternaltimertopreventitfromtimingoutandlockingoutthedevice.

DAQmx_Val_ClearExpiration Unlocksadevicewhosewatchdogexpired.

Page 647: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 648: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCreateWatchdogTimerTaskint32DAQmxCreateWatchdogTimerTask(constchardeviceName[],constchar

taskName[],TaskHandle*taskHandle,float64timeout,constcharchannelName[],int32expState,...);

Page 649: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeCreatesandconfiguresataskthatcontrolsthewatchdogtimerofadevice.Thetimeractivateswhenyoustartthetask.

Page 650: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

taskName constchar[] Thenametoassigntothetask.Ifyouusethisfunctioninaloopandspecifyanameforthetask,youmustuseDAQmxClearTaskwithintheloopafteryouarefinishedwiththetask.Otherwise,NI-DAQmxattemptstocreatemultipletaskswiththesamename,whichresultsinanerror.

timeout float64 Thetime,inseconds,untilthewatchdogtimerexpires.AvalueofDAQmx_Val_WaitInfinitelyindicatesthattheinternaltimerneverexpires.UseDAQmx_Val_WaitInfinitelywhenyouuseatriggertosignalanexpirationofthetimer.Ifthistimeelapses,thedevicesetsthephysicalchannelstothestatesyouspecifyinexpState.UseDAQmxControlWatchdogTaskwithactionsettoDAQmx_Val_ResetTimertopreventthewatchdogtimerfromexpiring.

channelName constchar[] Thedigitallineorporttomodify.Youcannotmodifydedicateddigitalinputlines.Youcanspecifyalistorrangeofphysicalchannels

expState int32 Thestatetowhichtosetthedigitalphysicalchannelwhenthewatchdogtimerexpires.

Value DescriptionDAQmx_Val_High HighlogicDAQmx_Val_Low LowlogicDAQmx_Val_Tristate High-

impedancestate.Youcanselectthisstateonlyondeviceswithbidirectionalports,andyoucanselectitonlyforentireports.Youcannotselectthisstatefordedicateddigitaloutputlines.

Page 651: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_NoChange Expirationdoesnotaffecttheport.Donotchangethestateofanylinesintheport,anddonotlocktheport.Forexample,ifalineishighwhenthetimerexpires,thatlinestayshigh,andyoucanwritenewvaluestotheline.Youcanselectthisvalueonlyforentireports.

moreChannelsAndStates anytype(passedbyvalue)

Pairsofadditionalchannelsandthestatestosetthechannelstowhenthedevicepowersuporwhenthedeviceisreset.YoumustpassNULLattheendoftheargumentlist.Ifyoudonotwanttopassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxCreateWatchdogTimerTask("Dev1","myTask",*taskHandle,DAQmx_Val_WaitInfinitely,"Dev1/do0",DAQmx_Val_High,NULL);Ifyoupassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxCreateWatchdogTimerTask("Dev1","myTask",*taskHandle,DAQmx_Val_WaitInfinitely,"Dev1/do0",DAQmx_Val_High,"Dev1/do1",DAQmx_Val_Tristate,NULL);

Output

taskHandle TaskHandle* Areferencetothenewtask.

Page 652: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 653: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAOSeriesCalAdjustDAQmxAOSeriesCalAdjust(uInt32calHandle,float64referenceVoltage);

Page 654: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsonanAOSeriesdevice.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithreferenceVoltage.

Page 655: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+6.000Vand+9.999V.

Page 656: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 657: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxESeriesCalAdjustint32DAQmxESeriesCalAdjust(uInt32calHandle,float64referenceVoltage);

Page 658: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsonanE-Seriesdevice.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithreferenceVoltage.

Page 659: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+6.000Vand+9.999V.

Page 660: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 661: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetAIChanCalCalDateint32DAQmxGetAIChanCalCalDate(TaskHandletaskHandle,constchar

channelName[],uInt32*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 662: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeIndicatesthelastdateandtimethatthechannelunderwentachannelcalibration.

Page 663: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channelName constchar[]

Nameofthelocalorglobalchanneltoquerycalibrationfor.

Output

Name Type Description

year uInt32* Thelastyearthatthechannelunderwentachannelcalibration.

month uInt32* Thelastmonththatthechannelunderwentachannelcalibration.

day uInt32* Thelastdaythatthechannelunderwentachannelcalibration.

hour uInt32* Thelasthour,ona24-hourclock,thatthechannelunderwentachannelcalibration.

minute uInt32* Thelastminutethatthechannelunderwentachannelcalibration.

Page 664: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 665: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetAIChanCalExpDateint32DAQmxGetAIChanCalExpDate(TaskHandletaskHandle,constchar

channelName[],uInt32*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 666: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeIndicatesthelastdateandtimethatthechannelunderwentanexternalchannelcalibration.

Page 667: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channelName constchar[]

Nameofthelocalorglobalchanneltoquerycalibrationfor.

Output

Name Type Description

year uInt32* Thelastyearthatthechannelunderwentanexternalchannelcalibration.

month uInt32* Thelastmonththatthechannelunderwentanexternalchannelcalibration.

day uInt32* Thelastdaythatthechannelunderwentanexternalchannelcalibration.

hour uInt32* Thelasthour,ona24-hourclock,thatthechannelunderwentanexternalchannelcalibration.

minute uInt32* Thelastminutethatthechannelunderwentanexternalchannelcalibration.

Page 668: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 669: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetExtCalLastDateAndTimeint32DAQmxGetExtCalLastDateAndTime(constchardeviceName[],uInt32

*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 670: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeIndicatesthelastdateandtimethatthedeviceunderwentanexternalcalibration.

Page 671: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Output

Name Type Description

year uInt32* Thelastyearthatthedeviceunderwentanexternalcalibration.

month uInt32* Thelastmonththatthedeviceunderwentanexternalcalibration.

day uInt32* Thelastdaythatthedeviceunderwentanexternalcalibration.

hour uInt32* Thelasthour,ona24-hourclock,thatthedeviceunderwentanexternalcalibration.

minute uInt32* Thelastminutethatthedeviceunderwentanexternalcalibration.

Page 672: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 673: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetSelfCalLastDateAndTimeint32DAQmxGetSelfCalLastDateAndTime(constchardeviceName[],uInt32

*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 674: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeIndicatesthelastdateandtimethatthedeviceunderwentaselfcalibration.

Page 675: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Output

Name Type Description

year uInt32* Thelastyearthatthedeviceunderwentaself-calibration.

month uInt32* Thelastmonththatthedeviceunderwentaself-calibration.

day uInt32* Thelastdaythatthedeviceunderwentaself-calibration.

hour uInt32* Thelasthour,ona24-hourclock,thatthedeviceunderwentaself-calibration.

minute uInt32* Thelastminutethatthedeviceunderwentaself-calibration.

Page 676: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 677: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxMSeriesCalAdjustint32DAQmxMSeriesCalAdjust(uInt32calHandle,float64referenceVoltage);

Page 678: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsforanMSeriesdevice.YoumustconnectaknownvoltagetothedeviceandspecifythatvoltagewithreferenceVoltage.

Page 679: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+6.000Vand+9.999V.

Page 680: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 681: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxPerformBridgeOffsetNullingCalint32DAQmxPerformBridgeOffsetNullingCal(TaskHandletaskHandle,const

charchannel[])

Page 682: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposePerformsabridgeoffsetnullingcalibrationonthechannelsinthetask.Ifthetaskmeasuresbothbridge-basedsensorsandnon-bridge-basedsensors,specifythenamesofthechannelsthatmeasurebridge-basedsensorsinthechannelparameter.

Page 683: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channel constchar[] Asubsetofvirtualchannelsinthetaskthatyouwanttocalibrate.Usethisparameterifyoudonotwanttocalibrateallthechannelsinthetaskorifsomechannelsinthetaskmeasurenon-bridge-basedsensors.

Page 684: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 685: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxPerformBridgeOffsetNullingCalExint32DAQmxPerformBridgeOffsetNullingCalEx(TaskHandletaskHandle,const

charchannel[],bool32skipUnsupportedChannels)

Page 686: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposePerformsabridgeoffsetnullingcalibrationonthechannelsinthetask.Ifthetaskmeasuresbothbridge-basedsensorsandnon-bridge-basedsensors,specifythenamesofthechannelsthatmeasurebridge-basedsensorsinthechannelparameter.

Page 687: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channel constchar[] Asubsetofvirtualchannelsinthetaskthatyouwanttocalibrate.Usethisparameterifyoudonotwanttocalibrateallthechannelsinthetaskorifsomechannelsinthetaskmeasurenon-bridge-basedsensors.

skipUnsupportedChannels bool32 Specifieswhetherornottoskipchannelsthatdonotsupportcalibration.IfskipUnsupportedChannelsisTRUE,calibrationwillbeperformedonlyonsupportedchannels.IfFALSE,calibrationwillbeperformedonchannelsspecifiedbychannel.ThedefaultisFALSE.

Page 688: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 689: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxPerformBridgeShuntCalint32DAQmxPerformBridgeShuntCal(TaskHandletaskHandle,constchar

channel[],float64shuntResistorValue,int32shuntResistorLocation,float64bridgeResistance,bool32skipUnsupportedChannels);

Page 690: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposePerformsshuntcalibrationforthespecifiedchannelsusingabridgesensor.

Page 691: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channel constchar[]

Asubsetofvirtualchannelsinthetaskthatyouwanttocalibrate.Usethisparameterifyoudonotwanttocalibrateallthechannelsinthetaskorifsomechannelsinthetaskmeasurenon-bridge-basedsensors.Iftheinputisempty,thefunctionwillattempttoperformshuntcalibrationonallthechannelsinthetask.

shuntResistorValue float64 Theresistance,inohms,oftheshuntresistor.

shuntResistorLocation int32 Thelocationoftheshuntresistor.RefertotheNI-DAQmxHelpformoreinformationonbridgeconfigurations.

Value DescriptionDAQmx_Val_R1(12465) R1DAQmx_Val_R2(12466) R2DAQmx_Val_R3(12467) R3DAQmx_Val_R4(14813) R4

bridgeResistance float64 Theresistance,inohms,ofthebridgesensor.

skipUnsupportedChannels bool32 Specifieswhetherornottoskipchannelsthatdonotsupportshuntcalibration.IfskipUnsupportedChannelsisTRUE,shuntcalibrationwillbeperformedonlyonsupportedchannels.IfFALSE,shuntcalibrationwillbeperformedonchannelsspecifiedbychannelNames.ThedefaultisFALSE.

Page 692: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 693: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxPerformStrainShuntCalint32DAQmxPerformStrainShuntCal(TaskHandletaskHandle,constchar

channel[],float64shuntResistorValue,int32shuntResistorLocation,bool32skipUnsupportedChannels);

Page 694: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposePerformsshuntcalibrationforthespecifiedchannelsusingastraingagesensor.

Page 695: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channel constchar[]

Asubsetofvirtualchannelsinthetaskthatyouwanttocalibrate.Usethisparameterifyoudonotwanttocalibrateallthechannelsinthetaskorifsomechannelsinthetaskmeasurenon-bridge-basedsensors.Iftheinputisempty,thefunctionwillattempttoperformshuntcalibrationonallthechannelsinthetask.

shuntResistorValue float64 Theresistance,inohms,oftheshuntresistor.

shuntResistorLocation int32 Thelocationoftheshuntresistor.RefertotheNI-DAQmxHelpformoreinformationonbridgeconfigurations.

Value DescriptionDAQmx_Val_R1(12465) R1DAQmx_Val_R2(12466) R2DAQmx_Val_R3(12467) R3DAQmx_Val_R4(14813) R4

skipUnsupportedChannels bool32 Specifieswhetherornottoskipchannelsthatdonotsupportshuntcalibration.IfskipUnsupportedChannelsisTRUE,shuntcalibrationwillbeperformedonlyonsupportedchannels.IfFALSE,shuntcalibrationwillbeperformedonchannelsspecifiedbychannelNames.ThedefaultisFALSE.

Page 696: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 697: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxRestoreLastExtCalConstint32DAQmxRestoreLastExtCalConst(constchardeviceName[]);

Page 698: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheselfcalibrationconstantsofthedevicetothethecurrentexternalcalibrationconstants.NationalInstrumentssetstheexternalcalibrationconstantsatthefactory,andthoseconstantsremainineffectuntilyouperformanewexternalcalibrationonthedevice.Thisfunctionnullifiesanyselfcalibrationyouperformonthedevice.Ifyouhaveneverperformedaselfcalibrationonthedevice,thisfunctionhasnoeffect.

Page 699: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Page 700: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 701: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSCBaseboardCalAdjustint32DAQmxSCBaseboardCalAdjust(uInt32calHandle,float64

referenceVoltage);

Page 702: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsonforthebaseboardofanSCSeriesdevice.YoumustconnectaknownvoltagetothedeviceandspecifythatvoltagewithreferenceVoltage.

Page 703: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+6.000Vand+9.999V.

Page 704: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 705: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSelfCalint32DAQmxSelfCal(constchardeviceName[]);

Page 706: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeMeasurestheonboardreferencevoltageofthedeviceandadjuststheself-calibrationconstantstoaccountforanyerrorscausedbyshort-termfluctuationsintheoperatingenvironment.Whenyouselfcalibrateadevice,noexternalsignalconnectionsarenecessary.

Page 707: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

Page 708: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 709: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetAIChanCalCalDateint32DAQmxSetAIChanCalCalDate(TaskHandletaskHandle,constchar

channelName[],uInt32*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 710: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsthedateandtimethatthechannelunderwentachannelcalibration.

Page 711: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channelName constchar[]

Nameofthelocalorglobalchanneltocalibrate.

year uInt32 Thelastyearthatthechannelunderwentachannelcalibration.

month uInt32 Thelastmonththatthechannelunderwentachannelcalibration.

day uInt32 Thelastdaythatthechannelunderwentachannelcalibration.

hour uInt32 Thelasthour,ona24-hourclock,thatthechannelunderwentachannelcalibration.

minute uInt32 Thelastminutethatthechannelunderwentachannelcalibration.

Page 712: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 713: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetAIChanCalExpDateint32DAQmxSetAIChanCalExpDate(TaskHandletaskHandle,constchar

channelName[],uInt32*year,uInt32*month,uInt32*day,uInt32*hour,uInt32*minute);

Page 714: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsthedateandtimethatthechannelunderwentanexternalchannelcalibration.

Page 715: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskusedinthisfunction.

channelName constchar[]

Nameofthelocalorglobalchanneltocalibrate.

year uInt32 Thelastyearthatthechannelunderwentanexternalchannelcalibration.

month uInt32 Thelastmonththatthechannelunderwentanexternalchannelcalibration.

day uInt32 Thelastdaythatthechannelunderwentanexternalchannelcalibration.

hour uInt32 Thelasthour,ona24-hourclock,thatthechannelunderwentanexternalchannelcalibration.

minute uInt32 Thelastminutethatthechannelunderwentanexternalchannelcalibration.

Page 716: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 717: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSSeriesCalAdjustint32DAQmxSSeriesCalAdjust(uInt32calHandle,float64referenceVoltage);

Page 718: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsforanSSeriesdevice.YoumustconnectaknownvoltagetothedeviceandspecifythatvoltagewithreferenceVoltage.

Page 719: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+6.000Vand+9.999V.

Page 720: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 721: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxChangeExtCalPasswordint32DAQmxChangeExtCalPassword(constchardeviceName[],constchar

password[],constcharnewPassword[]);

Page 722: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeChangestheexternalcalibrationpasswordofthedevice.

Page 723: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

password constchar[] Thecurrentcalibrationpasswordforthedevice.Thispasswordiscasesensitive.ThedefaultpasswordforallNIproductsisNI.

newPassword constchar[] Thenewpasswordforthedevice.Thispasswordcanbenolongerthanfourcharacters.

Page 724: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 725: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxCloseExtCalint32DAQmxCloseExtCal(uInt32calHandle,int32action);

Page 726: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeClosesanopenexternalcalibrationsession.

Page 727: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

action int32 Specifieshowtoclosethecalibrationsession.

Value DescriptionDAQmx_Val_Action_Commit Savesthecalibration

changesmadeinthesession

DAQmx_Val_Action_Cancel Closesthesessionwithoutsavinganycalibrationchanges

Page 728: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 729: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxInitExtCalint32DAQmxInitExtCal(constchardeviceName[],constcharpassword[],

uInt32*calHandle);

Page 730: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeStartsanexternalcalibrationsessiononadevice.

Page 731: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

password constchar[] Thecurrentcalibrationpasswordforthedevice.Thispasswordiscasesensitive.ThedefaultpasswordforallNIproductsisNI.

Output

Name Type Description

calHandle uInt32* Areferencetothecalibrationsession.

Page 732: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 733: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjustDSAAICalint32DAQmxAdjustDSAAICal(uInt32calHandle,float64referenceVoltage);

Page 734: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheanaloginputsectionofaDSAdevice.YoumustconnectaknownvoltagetothedeviceandspecifythatvoltagewiththereferenceVoltageparameter.

Page 735: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.Thisvoltageshouldbebetween+4.9Vand+9.1V.

Page 736: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 737: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjustDSAAOCalint32DAQmxAdjustDSAAOCal(uInt32calHandle,uInt32channel,float64

requestedLowVoltage,float64actualLowVoltage,float64requestedHighVoltage,float64actualHighVoltage,float64gainSetting);

Page 738: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheanalogoutputsectionofaDSAdevice.Youmustusethedevicetogenerateahighvoltageandlowvoltageataspecifiedgain,measurethehighandlowvoltages,thenspecifytherequestedhighvoltage,lowvoltage,andgainalongwiththeactualhighvoltageandlowvoltage.

Page 739: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channel uInt32 Thenumberofthechanneltocalibrate.Thisnumberisthenumericportionofthephysicalchannelname,notthefullphysicalchannelname.

requestedLowVoltage float64 Thelowvoltageyouattemptedtogenerateatthegainsettingyouspecified.

actualLowVoltage float64 Theactuallowvoltageasmeasuredbyanexternalsensor.

requestedHighVoltage float64 Thehighvoltageyouattemptedtogenerateatthegainsettingyouspecified.

actualHighVoltage float64 Theactualhighvoltageasmeasuredbyanexternalsensor.

gainSetting float64 Thegainsettingyouusedwhenyouattemptedtogeneratetherequestedhighvoltageandrequestedlowvoltage.

Page 740: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 741: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjustDSATimebaseCalint32DAQmxAdjustDSATimebaseCal(uInt32calHandle,float64

referenceFrequency);

Page 742: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantforthetimebaseofaDSAdevicewithanadjustableoscillator.YoumustconnectasinusoidalsignalwithaknownfrequencytothedeviceandspecifythatfrequencywithreferenceFrequency.

Page 743: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

referenceFrequency float64 Thefrequency,inhertz,ofthesignaltouseasareferenceforcalibration.

Page 744: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 745: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust4204Calint32DAQmxAdjust4204Cal(uInt32calHandle,constcharchannelNames[],

float64lowPassFreq,bool32trackHoldEnabled,float64inputVal);

Page 746: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheinternalandexternalcalibrationconstantsfortheSCMPpodonthePXI-4204device.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithinputVal.

Page 747: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

lowPassFreq float64 Thelowpasscutofffrequency,inhertz,(6or10000)ontheSCMPpodtocalibrate.

trackHoldEnabled bool32 SpecifieswhethercalibratingfortrackHoldisenabledordisabled.

inputVal float64 Theknownvoltage,involts,touseasareferenceforcalibration.

Page 748: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 749: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust4220Calint32DAQmxAdjust4220Cal(uInt32calHandle,constcharchannelNames[],

float64gain,float64inputVal);

Page 750: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheinternalandexternalcalibrationconstantsfortheSCMPpodonthePXI-4220device.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithinputVal.Thisdeviceneedsreferencesignalsof0.0voltsatgainsof1,15,20,and310onaparticularchannelinordertoperformanoffsetcalibrationforthatchannel.Ifthosepointsarenotmanuallysupplied,theywillbeautomaticallymeasuredinternallywithsampleandholdenabled.

Page 751: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

gain float64 ThegainvalueontheSCMPpodtocalibrate.

inputVal float64 Theknownvoltage,involts,touseasareferenceforcalibration.

Page 752: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 753: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust4224Calint32DAQmxAdjust4224Cal(uInt32calHandle,constcharchannelNames[],

float64gain,float64inputVal);

Page 754: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheinternalandexternalcalibrationconstantsfortheSCMPpodonthePXI-4224device.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithinputVal.

Page 755: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

gain float64 ThegainvalueontheSCMPpodtocalibrate.

inputVal float64 Theknownvoltage,involts,touseasareferenceforcalibration.

Page 756: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 757: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1102Calint32DAQmxAdjust1102Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 758: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1102module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 759: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 760: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 761: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1104Calint32DAQmxAdjust1104Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 762: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1104module.YoumustmeasurethevoltagegeneratedbyapreviouscalltotheDAQmxSetup1104Calfunctionandspecifythemeasurementwithmeasuredoutput.

Page 763: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 764: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 765: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1112Calint32DAQmxAdjust1112Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 766: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1112module.YoumustmeasurethevoltagegeneratedbyapreviouscalltotheDAQmxSetup1112CalfunctionandspecifythemeasurementwithmeasOutput.

Page 767: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 768: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 769: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1122Calint32DAQmxAdjust1122Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 770: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1122module.YoumustmeasurethevoltageorcurrentgeneratedbyapreviouscalltotheDAQmxSetup1122CalfunctionandspecifythemeasurementwithmeasOutput.

Page 771: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 ThevoltageorcurrentmeasuredattheoutputchannelspecifiedinapreviouscalltotheDAQmxSetup1122Calfunction.

Page 772: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 773: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1124Calint32DAQmxAdjust1124Cal(uInt32calHandle,float64measOutput);

Page 774: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1124module.YoumustmeasurethevoltageorcurrentgeneratedbyapreviouscalltotheDAQmxSetup1124CalfunctionandspecifythemeasurementwithmeasOutput.

Page 775: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

measOutput float64 ThevoltageorcurrentmeasuredattheoutputchannelspecifiedinapreviouscalltotheDAQmxSetup1124Calfunction.

Page 776: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 777: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1125Calint32DAQmxAdjust1125Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 778: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1125module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 779: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 780: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 781: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1126Calint32DAQmxAdjust1126Cal(uInt32calHandle,float64refFreq,float64

measOutput);

Page 782: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1126module.YoumustmeasurethevoltagegeneratedbyapreviouscalltotheDAQmxSetup1126CalfunctionandspecifythemeasurementwithmeasOutput.

Page 783: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refFreq float64 Theknownfrequency,inhertz,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 784: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 785: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1141Calint32DAQmxAdjust1141Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 786: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1141module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 787: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 788: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 789: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1142Calint32DAQmxAdjust1142Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 790: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1142module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 791: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 792: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 793: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1143Calint32DAQmxAdjust1143Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 794: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1143module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 795: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 796: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 797: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1502Calint32DAQmxAdjust1502Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 798: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1502module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 799: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 800: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 801: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1503Calint32DAQmxAdjust1503Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 802: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1503module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 803: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 804: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 805: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1503CurrentCalint32DAQmxAdjust1503CurrentCal(uInt32calHandle,constchar

channelName[],float64measOutput);

Page 806: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecurrentcalibrationconstantsfortheSCXI-1503module.

Page 807: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

measOutput float64 Thecurrentmeasuredattheoutputofthemodule.

Page 808: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 809: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1520Calint32DAQmxAdjust1520Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 810: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-1520module.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.Thisdeviceneedsreferencesignalsof0.0voltsatgainsof1,15,20,and310onaparticularchannelinordertoperformanoffsetcalibrationforthatchannel.

Page 811: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 812: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 813: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1521Calint32DAQmxAdjust1521Cal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 814: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1521module.YoumustmeasurethevoltagegeneratedbyapreviouscalltotheDAQmxSetup1521CalfunctionandspecifythemeasurementwithmeasOutput.

Page 815: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

Page 816: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 817: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust153xCalint32DAQmxAdjust153xCal(uInt32calHandle,float64refVoltage,float64

measOutput);

Page 818: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststheexternalcalibrationconstantsfortheSCXI-153xmodule.YoumustsupplyaknownvoltagetothedeviceandspecifythatvoltagewithrefVoltage.

Page 819: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 Theknownvoltage,involts,touseasareferenceforcalibration.BothrefVoltageandmeasOutputmustbeofthesamemeasurementtype,eitherRMSvoltageorpeak-to-peakvoltage.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.BothrefVoltageandmeasOutputmustbeofthesamemeasurementtype,eitherRMSvoltageorpeak-to-peakvoltage.

Page 820: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 821: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxAdjust1540Calint32DAQmxAdjust1540Cal(uInt32calHandle,float64refVoltage,float64

measOutput,int32inputCalSource);

Page 822: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAdjuststhecalibrationconstantsfortheSCXI-1540module.YoumustmeasurethevoltagegeneratedbyapreviouscalltotheDAQmxSetup1540CalfunctionandspecifythemeasurementwithmeasOutput.

Page 823: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

refVoltage float64 TheexcitationRMSvoltagemeasuredfromthefrontofthemodule.

measOutput float64 Thevoltagemeasuredattheoutputofthemodule.

inputCalSource int32 Thecalibrationinputsourceselection.

Value DescriptionDAQmx_Val_Loopback0 Loopbacktheinternal

excitationvoltagewith0degreephaseshift.

DAQmx_Val_Loopback180 Loopbacktheinternalexcitationvoltagewith180degreephaseshift.

DAQmx_Val_Ground Connectthechanneltoground.

Page 824: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 825: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1102Calint32DAQmxSetup1102Cal(uInt32calHandle,constcharchannelNames[],

float64gain);

Page 826: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1102moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1102Calfunction.

NoteTheterminalwheremoduleoutputismeasuredwilldependontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0+/-pinsoftherearsignalconnector.Pleaserefertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 827: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 828: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 829: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1104Calint32DAQmxSetup1104Cal(uInt32calHandle,constcharchannel[]);

Page 830: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSpecifiesthechannelontheSCXI-1104moduleforcalibration.Measurecalibrationinput/outputpointsbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1104Calfunction.

NoteTheterminalwheremoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0+/-pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 831: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channel constchar[]

Thephysicalchanneltocalibrate.

Page 832: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 833: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1112Calint32DAQmxSetup1112Cal(uInt32calHandle,constcharchannel[]);

Page 834: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSpecifiesthechannelontheSCXI-1112moduleforcalibration.Measurecalibrationinput/outputpointsbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1112Calfunction.

NoteTheterminalwheremoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0+/-pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 835: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channel constchar[]

Thephysicalchanneltocalibrate.

Page 836: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 837: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1122Calint32DAQmxSetup1122Cal(uInt32calHandle,constcharchannel[],float64

gain);

Page 838: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1122moduletothespecifiedgainvalue.CalibrationI/Opointscanbemeasuredbysupplyingreferencesignalstothedeviceandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1122Calfunction.

NoteTheterminalwheremoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 839: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channel constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 840: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 841: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1124Calint32DAQmxSetup1124Cal(uInt32calHandle,constcharchannelName[],int32

range,uInt32dacValue);

Page 842: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesthespecifiedbinaryvaluetotheD/Acircuitryonthespecifiedchannelatthespecifiedrange.MeasureandspecifythevoltageorcurrentgeneratedinasubsequentcalltotheDAQmxAdjust1124Calfunction.

NoteSpecifyatleasttwocalibrationpointsforeachchannel/rangebeingcalibrated.Therecommendedbinarydatatouseforvoltagerangesare0and4095.Therecommendedbinarydatatouseforthecurrentrangeis255and4095.

Page 843: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

range int32 Therangetocalibrate.

dacValue uInt32 ThebinarynumbertowritetotheDACcircuitry.

Page 844: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 845: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1125Calint32DAQmxSetup1125Cal(uInt32calHandle,constcharchannelNames[],

float64gain);

Page 846: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1125moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1125Calfunction.

NoteTheterminalwheremoduleoutputismeasuredwilldependontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0+/-pinsoftherearsignalconnector.Pleaserefertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 847: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 848: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 849: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1126Calint32DAQmxSetup1126Cal(uInt32calHandle,constcharchannelName[],

float64upperFreqLimit);

Page 850: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSpecifiesthechannelandupperfrequencylimitontheSCXI-1126moduleforcalibration.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1126Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 851: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

upperFreqLimit float64 Thehighfrequencylimitinhertz,with0Hzasthelowfrequencylimit,whichmostcloselyencapsulatestherangestobecalibrated.

Page 852: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 853: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1141Calint32DAQmxSetup1141Cal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 854: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1141moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1141Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 855: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 856: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 857: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1142Calint32DAQmxSetup1142Cal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 858: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1142moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1142Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 859: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 860: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 861: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1143Calint32DAQmxSetup1143Cal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 862: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1143moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1143Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 863: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 864: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 865: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1502Calint32DAQmxSetup1502Cal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 866: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1502moduletothespecifiedgainvalue.CalibrationI/Opointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1502Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 867: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 868: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 869: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1503Calint32DAQmxSetup1503Cal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 870: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1503moduletothespecifiedgainvalue.CalibrationI/Opointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.SpecifyeachofthesepointsusingtheDAQmxAdjust1503Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 871: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 872: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 873: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1520Calint32DAQmxSetup1520Cal(uInt32calHandle,constcharchannelNames[],

float64gain);

Page 874: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1520moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1520Calfunction.Thisfunctionwillalsodisablesampleandholdonthemodulesothattheoutputcanbemeasuredbyexternaldevicesthatcannotsupplytheappropriatesampleandholdtimingsignals.

NoteTheterminalwheremoduleoutputismeasuredwilldependontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0+/-pinsoftherearsignalconnector.Pleaserefertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 875: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelNames constchar[]

Thephysicalchannel(s)tocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 876: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 877: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup153xCalint32DAQmxSetup153xCal(uInt32calHandle,constcharchannelName[],

float64gain);

Page 878: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-153xmoduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust153xCalfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 879: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

gain float64 Thegainvaluetocalibrate.

Page 880: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 881: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetup1540Calint32DAQmxSetup1540Cal(uInt32calHandle,constcharchannel[],float64

excitationVoltage,float64excitationFreq);

Page 882: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetstheSCXI-1540moduletothespecifiedgainvalue.Calibrationinput/outputpointscanbemeasuredbysupplyingreferencesignalstothespecifiedchannelandmeasuringtheoutputs.EachofthesepointsshouldbespecifiedusingtheDAQmxAdjust1540Calfunction.

NoteTheterminalwherethemoduleoutputismeasureddependsontheconfigurationofthemoduleinMAX.NationalInstrumentsrecommendscablingthemoduletothedigitizersothattheoutputappearsontheMCH0±pinsoftherearsignalconnector.Refertothemoduleusermanualformoreinformationontheroutingofmoduleoutput.

Page 883: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

calHandle uInt32 AreferencetothecalibrationsessionthatyoucreatedusingtheDAQmxInitExtCalfunction.

channelName constchar[]

Thephysicalchanneltocalibrate.

excitationVoltage float64 TheRMSvalueoftheinternalACexcitationvoltage.

excitationFreq float64 ThefrequencyoftheinternalACexcitationvoltage.

Page 884: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 885: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDeleteSavedGlobalChanint32DAQmxDeleteSavedGlobalChan(constcharchannelName[]);

Page 886: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDeletesthespecifiedglobalvirtualchannelfromMAX.Thisfunctiondoesnotremovetheglobalvirtualchannelfromtasksthatuseit.

Page 887: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

channelName constchar[] Nameoftheglobalvirtualchanneltodelete.

Page 888: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 889: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDeleteSavedScaleint32DAQmxDeleteSavedScale(constcharscaleName[]);

Page 890: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDeletesthespecifiedcustomscalefromMAX.Thisfunctiondoesnotremovethecustomscalefromvirtualchannelsthatuseit.

Page 891: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

scaleName constchar[] Nameofthecustomscaletodelete.

Page 892: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 893: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxDeleteSavedTaskint32DAQmxDeleteSavedTask(constchartaskName[]);

Page 894: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeDeletesthespecifiedtaskfromMAX.Thisfunctiondoesnotclearthecopyofthetaskstoredinmemory.UseDAQmxClearTasktoclearthecopyofthetask.

Page 895: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskName constchar[] Nameofthetasktodelete.

Page 896: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 897: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSaveGlobalChanint32DAQmxSaveGlobalChan(TaskHandletaskHandle,constchar

channelName[],constcharsaveAs[],constcharauthor[],uInt32options);

Page 898: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSavesthespecifiedlocalorglobalvirtualchanneltoMAXasaglobalvirtualchannel.Youmustspecifyboththelocalorglobalvirtualchanneltosaveandataskthatcontainsthatchannel.ProgrammaticallysavedglobalvirtualchannelscannotbeviewedintheDAQAssistantforversionsofNI-DAQearlierthan7.4.ToviewaprogrammaticallysavedglobalvirtualchannelinanearlierversionofNI-DAQ,firstusetheDAQAssistantinNI-DAQ7.4orlatertosavetheglobalvirtualchannel.VisittheDAQmxProfessionalDeveloperToolswebsiteformoreinformationandexamplesofprogrammaticallysavingglobalvirtualchannels.

Page 899: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetaskthatcontainsthelocalorglobalvirtualchannelyouwanttosave.

channelName constchar[]

Nameofthelocalorglobalvirtualchanneltosave.

saveAs constchar[]

Nametosavetheglobalvirtualchannelas.Ifyoupassanemptystring("")orNULL,thenamecurrentlyassignedtotheglobalvirtualchannelwillbeused.

author constchar[]

Nametostorewiththeglobalvirtualchannel.

options uInt32 Usethisparametertosetcertainoptions.Youcancombineoptionswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value DescriptionDAQmx_Val_Save_Overwrite Overwritea

globalvirtualchannelofthesamenameifoneisalreadysavedinMAX.IfyoudonotsetthisflagandaglobalvirtualchannelofthesamenameisalreadysavedinMAX,thefunctionreturnsanerror.

DAQmx_Val_Save_AllowInteractiveEditing Allowtheglobalvirtual

Page 900: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

channeltobeeditedintheDAQAssistant.Ifyousetthisflag,theDAQAssistantmustsupportallglobalvirtualchannelsettings.

DAQmx_Val_Save_AllowInteractiveDeletion AllowtheglobalvirtualchanneltobedeletedthroughMAX.

Page 901: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 902: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSaveScaleint32DAQmxSaveScale(constcharscaleName[],constcharsaveAs[],const

charauthor[],uInt32options);

Page 903: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSavesthespecifiedcustomscaletoMAX.VisittheDAQmxProfessionalDeveloperToolswebsiteformoreinformationandexamplesofprogrammaticallysavingglobalchannels.

Page 904: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

scaleName constchar[]

Nameofthecustomscaletosave.

saveAs constchar[]

Nametosavethecustomscaleas.Ifyoupassanemptystring("")orNULL,thenamecurrentlyassignedtothescaleisused.

author constchar[]

Nametostorewiththecustomscale.

options uInt32 Usethisparametertosetcertainoptions.Youcancombineoptionswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value DescriptionDAQmx_Val_Save_Overwrite Overwritea

customscaleofthesamenameifoneisalreadysavedinMAX.IfyoudonotsetthisflagandacustomscaleofthesamenameisalreadysavedinMAX,thefunctionreturnsanerror.

DAQmx_Val_Save_AllowInteractiveEditing AllowthecustomscaletobeeditedintheDAQAssistant.

Page 905: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_Save_AllowInteractiveDeletion AllowthecustomscaletobedeletedthroughMAX.

Page 906: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 907: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSaveTaskint32DAQmxSaveTask(TaskHandletaskHandle,constcharsaveAs[],const

charauthor[],uInt32options);

Page 908: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSavesthespecifiedtaskandanylocalchannelsitcontainstoMAX.Thisfunctiondoesnotsaveglobalchannels.UseDAQmxSaveGlobalChantosaveglobalchannels.ProgrammaticallysavedtaskscannotbeviewedintheDAQAssistantforversionsofNI-DAQearlierthan7.4.ToviewaprogrammaticallysavedtaskinanearlierversionofNI-DAQ,firstusetheDAQAssistantinNI-DAQ7.4orlatertosavethetask.VisittheDAQmxProfessionalDeveloperToolswebsiteformoreinformationandexamplesofprogrammaticallysavingglobalchannels.

Page 909: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

taskHandle TaskHandle Thetasktosave.

saveAs constchar[]

Nametosavethetaskas.Ifyoupassanemptystring("")orNULL,thenamecurrentlyassignedtothetaskwillbeused.

author constchar[]

Nametostorewiththetask.

options uInt32 Usethisparametertosetcertainoptions.Youcancombineoptionswiththebitwise-ORoperator('|')tosetmultipleoptions.Passavalueofzeroifnooptionsneedtobeset.

Value DescriptionDAQmx_Val_Save_Overwrite Overwritea

taskofthesamenameifoneisalreadysavedinMAX.IfyoudonotsetthisflagandataskofthesamenameisalreadysavedinMAX,thefunctionreturnsanerror.

DAQmx_Val_Save_AllowInteractiveEditing AllowthetasktobeeditedintheDAQAssistant.Ifyousetthisflag,theDAQ

Page 910: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

Assistantmustsupportalltasksettings.

DAQmx_Val_Save_AllowInteractiveDeletion AllowthetasktobedeletedthroughMAX.

Page 911: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 912: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxClearTEDSint32DAQmxClearTEDS(constcharphysicalChannel[]);

Page 913: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeRemovesTEDSinformationfromthephysicalchannelyouspecify.ThisfunctiontemporarilyoverridesanyTEDSconfigurationforthephysicalchannelthatyouperformedinMAX.

Page 914: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

physicalChannel constchar[] Thenameofthephysicalchannelyouwanttoclear.

Page 915: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 916: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxConfigureTEDSint32DAQmxConfigureTEDS(constcharphysicalChannel[],constchar

filePath[]);

Page 917: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeAssociatesTEDSinformationwiththephysicalchannelyouspecify.IfyoudonotspecifythefilenameofadatasheetinthefilePathparameter,thisfunctionattemptstofindaTEDSsensorconnectedtothephysicalchannel.ThisfunctiontemporarilyoverridesanyTEDSconfigurationforthephysicalchannelthatyouperformedinMAX.

Page 918: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

physicalChannel constchar[]

Thenameofthephysicalchannelyouwanttoconfigure.

filePath constchar[]

ThepathtoaVirtualTEDSdatasheetthatyouwanttoassociatewiththephysicalchannel.Ifyoudonotspecifythefilenameofadatasheet,thisfunctionattemptstofindaTEDSsensorconnectedtothephysicalchannel.

Page 919: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 920: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteToTEDSFromArrayint32DAQmxWriteToTEDSFromArray(constcharphysicalChannel[],uInt8

bitstream[],uInt32arraySize,int32basicTEDSOptions);

Page 921: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesTEDSdata,storedasa1Darrayof8-bitunsignedintegers,tothesensorconnectedtothephysicalchannelyouspecify.

Page 922: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

physicalChannel constchar[]

Thenameofthephysicalchannelyouwanttoconfigure.

bitstream uInt8 RepresentstheTEDSbitstreamtowritetothesensor.ThisbitstreammustbeconstructedaccordingtotheIEEE1451.4specification.

arraySize uInt32 Numberofbytesinthebitstream.

basicTEDSOptions int32 SpecifieshowtohandlebasicTEDSdatainthebitstream.

Value DescriptionDoNotWrite

IgnorebasicTEDSdata.

WritetoEEPROM

WritebasicTEDSdatatotheEEPROM,evenifthesensorincludesaPROM.YoucannotwritebasicTEDSdataifthePROMcontainsdata.

WritetoPROM

WritebasicTEDSdatatothePROM.AnysubsequentattemptstowritebasicTEDSdataresultinanerror.

Page 923: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 924: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxWriteToTEDSFromFileint32DAQmxWriteToTEDSFromFile(constcharphysicalChannel[],constchar

filePath[],int32basicTEDSOptions);

Page 925: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeWritesTEDSdatafromavirtualTEDSfiletothesensorconnectedtothephysicalchannelyouspecify.

Page 926: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

physicalChannel constchar[]

Thenameofthephysicalchannelyouwanttoconfigure.

filePath constchar[]

SpecifiesthefilenameofavirtualTEDSfilethatcontainsthebitstreamtowrite.

basicTEDSOptions int32 SpecifieshowtohandlebasicTEDSdatainthebitstream.

Value DescriptionDoNotWrite

IgnorebasicTEDSdata.

WritetoEEPROM

WritebasicTEDSdatatotheEEPROM,evenifthesensorincludesaPROM.YoucannotwritebasicTEDSdataifthePROMcontainsdata.

WritetoPROM

WritebasicTEDSdatatothePROM.AnysubsequentattemptstowritebasicTEDSdataresultinanerror.

Page 927: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 928: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetAnalogPowerUpStatesint32DAQmxSetAnalogPowerUpStates(constchardeviceName[],constchar

channelNames[],float64state,int32channelType,...);

Page 929: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeUpdatesthestatesthatanalogphysicalchannelsonadevicearesettowhenthedevicepowersuporwhenthedeviceisreset.Power-upstatesarestoredinEEPROMsthatyoucanwritetoonlyalimitednumberoftimes.Therefore,youshouldusethisfunctionasinfrequentlyaspossible.ThisfunctionwritestotheEEPROMonlyifasettingyourequestisdifferentfromtheonecurrentlystoredontheEEPROM.Thisfunctionwritespower-upstatesinsequentialorder.Therefore,ifaphysicalchannelhasmultipleentries,thelastentryisused.

Page 930: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

channelNames constchar[] Thephysicalchanneltomodify.Youcanspecifyalistorrangeofchannels.

state float64 Thepower-upstatetosetforthechannel(s)inchannelNames.

channelType int32 Thechanneltypeforthechannel(s)inchannelNames.

Value DescriptionDAQmx_Val_ChannelVoltage Voltage

output.Youcansetvoltagepower-upstatesonlyforphysicalchannelsthatsupportvoltageoutput.

DAQmx_Val_ChannelCurrent Currentoutput.Youcansetcurrentpower-upstatesonlyforphysicalchannelsthatsupportcurrentoutput.

moreChannelsStatesAndTypes anytype(passedbyvalue)

Combinationsofadditionalchannelsandstatesandtypestosetthechannelstowhenthedevicepowersuporwhenthedeviceisreset.YoumustpassNULLattheendoftheargumentlist.Ifyoudonotwanttopassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxSetAnalogPowerUpStates("Dev1","Dev1/ao0",0.0,

Page 931: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmx_Val_ChannelVoltage,NULL);Ifyoupassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxSetAnalogPowerUpStates("Dev1","Dev1/ao0",0.0,DAQmx_Val_ChannelVoltage,"Dev1/ao1",1.0,DAQmx_Val_ChannelCurrent,NULL);

Page 932: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 933: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetDigitalLogicFamilyPowerUpStateint32DAQmxSetDigitalLogicFamilyPowerUpState(constchardeviceName[],

int32logicFamily);

Page 934: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeSetsthedigitallogicfamilytousewhenthedevicepowersup.

Page 935: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

logicFamily int32 Specifiesthelogicfamilytosetthedevicetowhenitpowersup.Alogicfamilycorrespondstovoltagethresholdsthatarecompatiblewithagroupofvoltagestandards.Refertodevicedocumentationforinformationonthelogichighandlogiclowvoltagesfortheselogicfamilies.

Value DescriptionDAQmx_Val_2point5V 2.5V(compatiblewith

CMOSsignals)DAQmx_Val_3point3V 3.3V(compatiblewith

LVTTLandLVCMOSsignals)

DAQmx_Val_5V 5V(compatiblewithTTLandCMOSsignals)

Page 936: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 937: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxSetDigitalPowerUpStatesint32DAQmxSetDigitalPowerUpStates(constchardeviceName[],constchar

channelNames[],int32state,...);

Page 938: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeUpdatesthestatethatdigitalphysicalchannelsonstaticDIOdevicesaresettowhenthedevicepowersuporwhenthedeviceisreset.Power-upstatesarestoredinEEPROMsthatyoucanwritetoonlyalimitednumberoftimes.Therefore,youshouldusethisfunctionasinfrequentlyaspossible.ThisfunctionwritestotheEEPROMonlyifasettingyourequestisdifferentfromtheonecurrentlystoredontheEEPROM.Thisfunctionwritespower-upstatesinsequentialorder.Therefore,ifaphysicalchannelhasmultipleentries,thelastentryisused.

Page 939: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

deviceName constchar[] Thenameofthedevice,asconfiguredinMeasurement&AutomationExplorer(MAX),towhichthisoperationapplies.

channelNames constchar[] Thedigitallineorporttomodify.Youcannotsetpower-upstatesfordedicateddigitalinputlines.Youcanspecifyalistorrangeofchannels.

state int32 Thepower-upstatetosetforthechannel(s)inchannelNames.

Value DescriptionDAQmx_Val_High HighlogicDAQmx_Val_Low LowlogicDAQmx_Val_Tristate High-impedance

state.Youcanselectthisstateonlyondeviceswithbidirectionalports,andyoucanselectitonlyforentireports.Youcannotselectthisstatefordedicateddigitaloutputlines.

moreChannelsAndStates anytype(passedbyvalue)

Pairsofadditionalchannelsandthestatestosetthechannelstowhenthedevicepowersuporwhenthedeviceisreset.YoumustpassNULLattheendoftheargumentlist.Ifyoudonotwanttopassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxSetDigitalPowerUpStates("Dev1","Dev1/do0",DAQmx_Val_High,NULL);Ifyoupassadditionalchannelsandstates,thefunctioncallcanbesimilartothefollowingexample:DAQmxSetDigitalPowerUpStates("Dev1","Dev1/do0",DAQmx_Val_High,"Dev1/do1",DAQmx_Val_Tristate,NULL);

Page 940: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Apositivevalueindicatesawarning.Anegativevalueindicatesanerror.

Page 941: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetErrorStringint32DAQmxGetErrorString(int32errorCode,charerrorString[],uInt32

bufferSize);

Page 942: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeConvertstheerrornumberreturnedbyanNI-DAQmxfunctionintoameaningfulerrormessage.IfyoupassinavalidvalueforerrorStringanditsbufferSize,thisfunctionreturnsasmuchoftheavailabledataaspossible.IfyoupassNULLforerrorStringor0forbufferSize,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Page 943: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

errorCode int32 AnerrorcodeorwarningreturnedbyoneoftheNI-DAQmxLibraryfunctions.

bufferSize uInt32 Thesize,inbytes,ofthebufferpassedintheerrorString.Ifyoupass0,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Output

errorString char[] Themeaningfulerrormessagefortheerrornumber.IfyoupassNULL,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Page 944: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.IfyoupassinavalidvalueforerrorStringanditsbufferSize,thisfunctionreturnsasmuchoftheavailabledataaspossible.IfyoupassNULLforerrorStringor0forbufferSize,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Page 945: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

DAQmxGetExtendedErrorInfoint32DAQmxGetExtendedErrorInfo(charerrorString[],uInt32bufferSize);

Page 946: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

PurposeReturnsdynamic,specificerrorinformation.Thisfunctionisvalidonlyforthelastfunctionthatfailed;additionalNI-DAQmxcallsmayinvalidatethisinformation.IfyoupassvalidvaluesforerrorStringandbufferSize,thisfunctionreturnsasmuchoftheavailabledataaspossible.IfyoupassNULLforerrorStringor0forbufferSize,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Page 947: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ParametersInput

Name Type Description

bufferSize uInt32 Thesize,inbytes,oferrorString.Ifyoupass0,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Output

Name Type Description

errorString char[] Dynamicerrorinformation.IfyoupassNULL,thisfunctionreturnsthenumberofbytesyouneedtoallocate.

Page 948: NI-DAQmx C Reference Help · If you do not call DAQmxStartTask and DAQmxStopTask when you call NI-DAQmx Read functions or NI-DAQmx Write functions multiple times, such as in a loop,

ReturnValueName Type Description

status int32 Theerrorcodereturnedbythefunctionintheeventofanerrororwarning.Avalueof0indicatessuccess.Anegativevalueindicatesanerror.IfyoupassinavalidvalueforerrorStringanditsbufferSize,thisfunctionreturnsasmuchoftheavailabledataaspossible.IfyoupassNULLforerrorStringor0forbufferSize,thisfunctionreturnsthenumberofbytesyouneedtoallocate.


Recommended