Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a complete NI-DAQmx reference?

Is there a complete NI-DAQmx reference where I can search for a function and find out about it's parameters, maybe a brief explanation of the function does etc.   "NI-DAQmx Help" that I get to from my Start Menu does not include functional references. For example I like to be able to search for "DAQmxRegisterSignalEvent" or any other function in <NIDAQmx.h>. 

 

Thanks

Devor  

0 Kudos
Message 1 of 9
(4,133 Views)
0 Kudos
Message 2 of 9
(4,121 Views)

If you want the Function Reference for your version of NI-DAQmx, check under Start » Programs » National Instruments » NI-DAQ » Text-Based Code Support » NI-DAQmx C Reference Help.  This includes all of the functions and parameters needed to call them.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 9
(4,114 Views)

 

Thank you Seth, indeed I have looked at the "C Reference Help". It's incomplete -  I couldn't find reference to the function I was looking for. I just ended up spending a lot of time reading without getting even a clue about the information I was looking for. It was very frustrating.

0 Kudos
Message 4 of 9
(4,107 Views)

Hmmm, when I search the C Reference Help for "DAQmxRegisterSignalEvent" the only result returned is the reference page for this function.

 

Is the issue that this reference page is incomplete or that you were unable to locate it?

DAQmxRegisterSignalEvent
int32 DAQmxRegisterSignalEvent (TaskHandle taskHandle, int32 signalID, uInt32 options, DAQmxSignalEventCallbackPtr callbackFunction, void *callbackData);
Purpose
Registers a callback function to receive an event when the specified hardware event occurs.
When you stop a task explicitly any pending events are discarded. For example, if you call DAQmxStopTask then you do not receive any pending events.
Parameters
Input  
Name Type Description 
taskHandle  TaskHandle The task used in this function. 
signalID  int32  The signal for which you want to receive results. Value  Description 
DAQmx_Val_SampleClock   Sample clock 
DAQmx_Val_SampleCompleteEvent   Sample complete event 
DAQmx_Val_ChangeDetectionEvent   Change detection event 
DAQmx_Val_CounterOutputEvent   Counter output event 
 
options  uInt32  Use this parameter to set certain options. You can combine flags with the bitwise-OR operator ('|') to set multiple options. Pass a value of zero if no options need to be set. Value  Description 
0   The callback function is called in a DAQmx thread. This is the default value. 
DAQmx_Val_SynchronousEventCallbacks   The callback function is called in the thread which registered the event. In order for the callback to occur, you must be processing messages.
Windows This option is supported only on Windows.
 
  Note If you are receiving synchronous events faster than you are processing them, then the user interface of your application might become unresponsive. 
 
callbackFunction  DAQmxSignalEventCallbackPtr  The function that you want DAQmx to call when the event occurs. The function you pass in this parameter must have the following prototype:
int32 CVICALLBACK Callback (TaskHandle taskHandle, int32 signalID, void *callbackData); 
Upon entry to the callback, the taskHandle parameter contains the handle to the task on which the event occurred. The signalID parameter contains the value you passed in the signalID parameter of this function. The callbackData parameter contains the value you passed in the callbackData parameter of this function.
Passing NULL for this parameter unregisters the event callback function.  
callbackData  void *  A value that you want DAQmx to pass to the callback function as the function data parameter. Do not pass the address of a local variable or any other variable that might not be valid when the function is executed. 
Return Value
Name Type Description 
status  int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. 
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 5 of 9
(4,102 Views)

 

Thats very promissing, Seth. Thank you for the response.  Sounds like there is a version issue. What version of the -C- rerference are you using and how can one get it? 

0 Kudos
Message 6 of 9
(4,092 Views)

I'm using the version that is installed when you install ANSI C support with NI-DAQmx 9.3.  I would try this version for the latest in bug fixes, hardware support, and up-to-date documentation.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 9
(4,090 Views)

I re-installed NI-DAQ from your link (9.3) and the help can find the function - thank you.  But now I can't find descriptions of constants like DAQmx_Val_SampleCompleteEvent flag? This is one of the system constants that gets passed to DAQmxRegisterSignalEvent for example? 

 

The only description I found for DAQmx_Val_SampleCompleteEvent  says it's a  "Sample complete event"?  I was hoping for little more than that, like mention of causal steps that lead to a "Sample complete event" so we can debug issues such as the flag never going up or if need characterization of it's causal timing profile.  Are system constants explained yet in another volume of the manuals?

 

0 Kudos
Message 8 of 9
(4,077 Views)

If you click on "hardware events" in the sentance under Purpose you will be directed to the NI-DAQmx Help topic on the various events represented by the constants.  The reason this is in the NI-DAQmx Help instead of in the C Reference Help is because Events are accessible from many programming languages, so details on this topic is in a centralized location.

 

This article provides some further information on what each of the events involves.  However, it doesn't offer details on timing profiles and such because that is very device, driver version, and system dependant.  For the "Sample complete event", this event fires after a sample clock period is complete (one sample gathered on each channel).

 

Events are an advanced feature in NI-DAQmx and are often not as well documented as other functionality, due to unique behavior between certain hardware devices and system configurations.  When possible, events fire as soon after the criteria for the event are met as possible. However, because Windows is not a deterministic operating system, timing can't be guaranteed and if too many events occur, some will be ignored by the system if they come in too quickly.

 

The best recommendation for troubleshooting events is to first verify that the cause for the event actually occured.  Have samples been returned on all channels?  If not, then the issue is in either the configuration of the channel, timing, or trigger.  If a sample is available on all channels and the event still hasn't fired, then there is likely an issue with the way the event is configured. 

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 9 of 9
(4,061 Views)