NI-DAQ™mx C Reference

DAQmxConfigureLogging

int32 DAQmxConfigureLogging (TaskHandle taskHandle, const char filePath[], int32 loggingMode, const char groupName[], int32 operation);

Purpose

Configures TDMS file logging for the task.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task used in this function.
filePath const char [] The path to the TDMS file to which you want to log data.
loggingMode int32 Specifies whether to enable logging and whether to allow reading data while logging. Log mode allows for the best performance. However, you cannot read data while logging if you specify this mode. If you want to read data while logging, specify Log and Read mode.
ValueDescription
DAQmx_Val_OffDisable logging for the task.
DAQmx_Val_LogEnable logging for the task. You cannot read data using DAQmx Read when using this mode. If you require access to the data, read from the TDMS file.
DAQmx_Val_LogAndReadEnable both logging and reading data for the task. You must use DAQmx Read to read samples for NI-DAQmx to stream them to disk.
groupName const char []

The name of the group to create within the TDMS file for data from this task. If you append data to an existing file and the specified group already exists, NI-DAQmx appends a number symbol and a number to the group name, incrementing that number until finding a group name that does not exist. For example, if you specify a group name of Voltage Task, and that group already exists, NI-DAQmx assigns the group name Voltage Task #1, then Voltage Task #2. If you do not specify a group name, NI-DAQmx uses the name of the task.

For digital input tasks, NI-DAQmx creates a group for each virtual channel in the task. For each created group, NI-DAQmx appends a hyphen and the virtual channel name to the group name.

operation int32 Specifies how to open the TDMS file.
ValueDescription
DAQmx_Val_OpenOpen an existing TDMS file, and append data to that file. If the file does not exist, NI-DAQmx returns an error.
DAQmx_Val_OpenOrCreateOpen an existing TDMS file, and append data to that file. If the file does not exist, NI-DAQmx creates a new TDMS file.
DAQmx_Val_CreateOrReplaceCreate a new TDMS file, or replace an existing TDMS file.
DAQmx_Val_CreateCreate a new TDMS file. If the file already exists, NI-DAQmx returns an error.

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.