Task Objects

Most of the classes in the NI-DAQmx .NET library cannot be instantiated directly. These classes are used as sub-objects of the Task class.

For example, to modify the SamplesPerChannel property of the Timing class, use the Timing property of the Task class to get an instance of the Timing class that corresponds to the task. The following code demonstrates how to access the Timing object.

VB.NET

'Create a new NI-DAQmx Task 
Dim myTask as New Task("myTask")
'Access the subobjects of the Task class
myTask.Timing.SamplesPerChannel = 1000

C#

//Create a new NI-DAQmx Task
Task myTask = new Task("myTask");
//Access the subobjects of the Task class
myTask.Timing.SamplesPerChannel = 1000;