Contains methods that access tasks, scales, and global channels stored in Measurement & Automation Explorer (MAX), performs immediate operations on DAQ hardware, and creates classes from which you can get information about the hardware.

Derives from

  • MarshalByRefObject
  • ISynchronizeCallbacks
  • ISupportSynchronizationContext

Syntax

Namespace: NationalInstruments.DAQmx

public class DaqSystem : MarshalByRefObject, ISynchronizeCallbacks, ISupportSynchronizationContext

Remarks

Note

Example applications are located in the <Public Documents>\National Instruments\NI-DAQ\Examples\DotNET4.x directory or in the Start menu at National Instruments»NI-DAQmx»NI-DAQmx Examples.

You can use the DaqSystem class to get information about an NI-DAQmx system or perform operations on an NI-DAQmx system. You cannot instantiate the DaqSystem class directly, instead, use the static Local property to retrieve an instance of the DaqSystem class. The DaqSystem class contains methods and properties that you can use to determine information about an NI-DAQmx system. For example, the following code displays all of the NI-DAQmx tasks that are stored in Measurement & Automation Explorer (MAX):


'Print the name of each task saved in MAX to the console
For Each taskName As string In DaqSystem.Local.Tasks
Console.WriteLine(taskName)
Next


//Print the name of each task saved in MAX to the console
foreach (string taskName in DaqSystem.Local.Tasks)
{
Console.WriteLine(taskName);
}

Thread Safety

All members of this type are safe for multithreaded operations.

Properties

NameDescription
Devices

Indicates the names of all devices installed in the system.

DriverMajorVersion

Indicates the major portion of the installed version of NI-DAQmx, such as 7 for version 7.0.

DriverMinorVersion

Indicates the minor portion of the installed version of NI-DAQmx, such as 0 for version 7.0.

DriverUpdateVersion

Indicates the update portion of the installed version of NI-DAQmx, such as 1 for version 9.0.1.

GlobalChannels

Indicates an array that contains the names of all global channels saved on the system.

IsReadOrWriteLate

Obsolete: The IsReadOrWriteLate property is deprecated. Please use the Timing.SinglePoint.WaitForNextSampleClock method instead. Will warn if used
Determines if a hardware-timed single-point read or write operation is overdue on the current thread. The IsReadOrWriteLate property has been deprecated in favor of the WaitForNextSampleClock(double) method.

LastDaqWarning

Gets the DaqWarningEventArgs for the last DaqWarning event that occurred.

Local

Gets an instance of the DaqSystem class that represents the local DAQ system.

Scales

Indicates an array that contains the names of all custom scales saved on the system.

SwitchChannels

Obsolete: This property is obsolete. Will warn if used
Gets an array that contains the switch channel names of devices installed in the system.

SwitchRelays

Obsolete: This property is obsolete. Will warn if used
Gets an array that contains the switch relay names of devices installed in the system.

SwitchTopologies

Obsolete: This property is obsolete. Will warn if used
Gets an array containing the names of all switch topologies.

SynchronizeCallbacks

Specifies how events and callback delegates are invoked.

SynchronizingObject

Obsolete: Use SynchronizeCallbacks to specify that the object marshals callbacks across threads appropriately. Will warn if used
Gets or sets the object that marshals event-handler and callback calls.

Tasks

Indicates an array that contains the names of all tasks saved on the system.

Methods

NameDescription
AddCDaqSynchronizationConnection(string)

Adds a cDAQ Sync connection between devices. The connection is not verified.

AddNetworkDevice(string, string, bool, double)

Adds a Network cDAQ device to the system and, if specified, attempts to reserve it.

AddNetworkDevice(string, string, double)

Adds a Network cDAQ device to the system. This method does not attempt to reserve the device after the device is successfully added.

AutoConfigureCDaqSynchronizationConnections(string, double)

Detects and configures cDAQ Sync connections between devices.

ClearLastDaqWarning()

Clears the value of the LastDaqWarning property, by setting the error code to zero and the error string to a blank string.

CloseSwitchRelays(string, bool)

Obsolete: This method is obsolete. Will warn if used
Closes the specified relays.

ConnectSwitchChannels(string, string, bool)

Obsolete: This method is obsolete. Will warn if used
Makes a connection between two switch channels.

ConnectSwitchChannels(string, bool)

Obsolete: This method is obsolete. Will warn if used
Makes one or more connections between switch channels as specified by the connection list.

ConnectTerminals(string, string)

Creates a route between a source and destination terminal.

ConnectTerminals(string, string, SignalRoutingModifiers)

Creates a route between a source and destination terminal with the specified signal modification.

CreateSwitchScanTask(string, string)

Obsolete: This method is obsolete. Will warn if used
Creates a new switch scanning task with the sequence specified in the scan list.

CreateWatchdogTimerTask(string, string, double, string[], WatchdogDOExpirationState[])

Creates a task to configure and control the watchdog timer of a static DIO device. The timer activates when you start the task.

DeleteGlobalChannel(string)

Deletes the specified global channel that is stored in Measurement & Automation Explorer (MAX).

DeleteScale(string)

Deletes the specified custom scale that is stored in Measurement & Automation Explorer (MAX).

DeleteTask(string)

Deletes the specified task that is stored in Measurement & Automation Explorer (MAX).

DisconnectAll(string, bool)

Obsolete: This method is obsolete. Will warn if used
Terminates all active connections on the device, which places the relays into the topology reset state.

DisconnectSwitchChannels(string, string, bool)

Obsolete: This method is obsolete. Will warn if used
Terminates a connection between two channels.

DisconnectSwitchChannels(string, bool)

Obsolete: This method is obsolete. Will warn if used
Terminates one or more connections between switch channels as specified by the disconnection list.

DisconnectTerminals(string, string)

Removes signal routes you created by using ConnectTerminals(string, string, SignalRoutingModifiers).

GetAnalogPowerUpStatesWithOutputType(string, out double[], out AOPowerUpOutputBehavior[])

Gets the states that analog physical channels on a device are set to when the device powers up or when the device is reset.

GetDevicePowerUpState(string, out string[], out double[], out string[], out double[])

Gets the power up states for analog physical channels.

GetDevicePowerUpState(string, out string[], out DigitalPullUpPullDownResistorState[])

Gets the resistor level for lines when they are in tristate logic.

GetDevicePowerUpState(string, out string[], out DigitalPowerUpState[])

Gets the power up states for digital physical lines.

GetDisconnectedCDaqSynchronizationPorts(string, double, out bool)

Verifies configured cDAQ Sync connections between devices.

GetLogicFamilyPowerUpState(string)

Gets the digital logic family for a device.

GetPhysicalChannels(PhysicalChannelTypes, PhysicalChannelAccess)

Gets an array that contains the physical channel names of devices installed in the system.

GetSavedChannelInfo(string)

Creates a SavedChannelInfo object that you can use to retrieve information about the specified global channel stored in Measurement & Automation Explorer (MAX).

GetSavedScaleInfo(string)

Creates a SavedScaleInfo object that you can use to retrieve information about the specified custom scale stored in Measurement & Automation Explorer (MAX).

GetSavedTaskInfo(string)

Creates a SavedTaskInfo object that you can use to retrieve information about the specified task stored in Measurement & Automation Explorer (MAX).

GetSwitchRelayCount(string)

Obsolete: This method is obsolete. Will warn if used
Returns the number of times a relay has actuated on switches that support querying the relay count.

GetSwitchRelayCounts(string)

Obsolete: This method is obsolete. Will warn if used
Returns the number of times a set of relays have actuated.

GetSwitchRelayPosition(string)

Obsolete: This method is obsolete. Will warn if used
Returns the current position of a single relay.

GetSwitchRelayPositions(string)

Obsolete: This method is obsolete. Will warn if used
Returns the current position of a set of relays.

GetTerminals(TerminalTypes)

Gets an array that contains the terminal names of devices installed in the system.

LoadDevice(string)

Creates a Device that you can use to control the specified device or get information about that device.

LoadPhysicalChannel(string)

Creates a PhysicalChannel that you can use to configure and retrieve TEDS information for the specified physical channel.

LoadScale(string)

Loads a scale that is stored in Measurement & Automation Explorer (MAX).

LoadSwitchChannel(string)

Obsolete: This method is obsolete. Will warn if used
Creates a SwitchChannel that you can use to get the switch channel capabilities and set the usage type for the switch channel.

LoadTask(string)

Loads a task that is stored in Measurement & Automation Explorer (MAX).

OpenSwitchRelays(string, bool)

Obsolete: This method is obsolete. Will warn if used
Opens the specified relays.

ReadIDPinMemory(string, string, out byte[], out uint)

Reads bitstream and format code from the memory connected to selected ID Pin.

RemoveCDaqSynchronizationConnection(string)

Removes a cDAQ Sync connection between devices. The connection is not verified.

SaveGlobalChannel(Channel, string, SaveOptions)

Saves the specified local or global channel to Measurement & Automation Explorer (MAX) as a global channel, under the virtual name it was given when it was created and with specified author and options values.

SaveGlobalChannel(Channel)

Saves the specified local or global channel to Measurement & Automation Explorer (MAX) as a global channel, under the virtual name it was given when it was created.

SaveGlobalChannelAs(Channel, string, string, SaveOptions)

Saves the local or global channel to Measurement & Automation Explorer (MAX) as a global channel, under the specified name and specified author and options values.

SaveGlobalChannelAs(Channel, string)

Saves the local or global channel to Measurement & Automation Explorer (MAX) as a global channel, under the specified name.

SaveScale(Scale)

Saves the specified custom scale to Measurement & Automation Explorer (MAX) under the name it was given when it was created.

SaveScale(Scale, string, SaveOptions)

Saves the specified custom scale to Measurement & Automation Explorer (MAX) under the name it was given when it was created and with specified author and options values.

SaveScaleAs(Scale, string, string, SaveOptions)

Saves the specified custom scale to Measurement & Automation Explorer (MAX) under the specified name and with specified author and options values.

SaveScaleAs(Scale, string)

Saves the specified custom scale to Measurement & Automation Explorer (MAX) under the specified name.

SaveTask(Task, string, SaveOptions)

Saves the specified task and any local channels it contains to Measurement & Automation Explorer (MAX) under the name it was given when it was created, with specifed author and options values.

SaveTask(Task)

Saves the specified task and any local channels it contains to Measurement & Automation Explorer (MAX) under the name it was given when it was created.

SaveTaskAs(Task, string)

Saves the task and any local channels it contains to Measurement & Automation Explorer (MAX) under the specified name.

SaveTaskAs(Task, string, string, SaveOptions)

Saves the task and any local channels it contains to Measurement & Automation Explorer (MAX) under the specified name and with specified author and options values.

SetAnalogPowerUpStatesWithOutputType(string, double[], AOPowerUpOutputBehavior[])

Sets the states that analog physical channels on a device are set to when the device powers up or when the device is reset.

SetDevicePowerUpState(string, string[], double[], string[], double[])

Updates the power up states to which to set analog physical channels on a device when the device powers up or when you reset the device.

SetDevicePowerUpState(string, string[], DigitalPullUpPullDownResistorState[])

Sets the resistor level for lines when they are in tristate logic.

SetDevicePowerUpState(string, string[], DigitalPowerUpState[])

Updates the power up states to which to set digital physical channels on a device when the device powers up or when you reset the device.

SetLogicFamilyPowerUpState(string, LogicFamily)

Sets the digital logic family to use when the device powers up.

SwitchFindPath(string, string)

Obsolete: This method is obsolete. Will warn if used
Returns information about the path between two switch channels.

TristateOutputTerminal(string)

Sets a terminal to high-impedance state.

WriteIDPinMemory(string, string, byte[], uint)

Writes provided bitstream and format code to the memory connected to selected ID Pin.

Events

NameDescription
DaqWarning

Occurs when the NI-DAQmx driver issues a warning.