Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Channel output persistense: does it go with Task or Writer?

I need to figure out whether the physical output stays in the assigned state as long as the DigitalSingleChannelWriter exists, or as long as the Task whose stream the writer was created from exists...

Thanks in advance.
0 Kudos
Message 1 of 7
(4,138 Views)
Hi,

Which application are you using this function in?

George
0 Kudos
Message 2 of 7
(4,121 Views)
I am writing a VB.NET class that will control a stepper motor driver. Direction is one of the digital inputs on the driver, so I was wondering whether I want to make the task or the writer an internal variable in the class so the state is preserved as long as the object is alive
0 Kudos
Message 3 of 7
(4,112 Views)
Anatoly,

What type of hardware are you using and what signals are you referring to?

Regards

Dan
National Instruments
0 Kudos
Message 4 of 7
(4,089 Views)
Dan:

I am using a PCI 6014 board and using a digital out channel, here's sample code:

digitalWriteTask.DOChannels.CreateChannel(mDirectionChannelName, System.String.Empty, _
ChannelLineGrouping.OneChannelForAllLines) 'create virtual channel with no name

Dim writer As DigitalSingleChannelWriter = New DigitalSingleChannelWriter(digitalWriteTask.Stream)


If where = ShutterDirection.CW Then
writer.WriteSingleSampleSingleLine(True, True) 'pull the line high
Else
writer.WriteSingleSampleSingleLine(True, False) 'pull line low, triggering syringe pump
End If
0 Kudos
Message 5 of 7
(4,086 Views)
Hi,

The value on the output line will stay until the task is cleared. Have a Great Day!

George
0 Kudos
Message 6 of 7
(4,076 Views)
So in .NET, this translates to whenever the Task object is disposed.

Chris W
.NET DAQmx Team
National Instruments
0 Kudos
Message 7 of 7
(4,068 Views)