Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DigitalReadTask get -200089

Hallo ,

I am trying to use the following code of vb.net to read the channel of a PCI-NI6509. and i get the following error: Taskname specified confilicts with an existing task name status code:-200089   

Is my code correct? i did close the channel everytime after i read .

 

 

Public Class NI_DIO
    Public Function ReadChannel(ByVal Channel As Integer) As UInt32
        Dim ReadTask As Task = New Task( "DigitalReadTask" )

        Dim xData As UInt32
        Try
            Dim P As String = "Dev1/port" & (4 * Channel) & "_32"
            ReadTask.DIChannels.CreateChannel(P, "port0", ChannelLineGrouping.OneChannelForAllLines)
            Dim reader As DigitalSingleChannelReader = New DigitalSingleChannelReader(ReadTask.Stream)

            xData = reader.ReadSingleSamplePortUInt32()
            ReadTask.Dispose()
        Catch ex As DaqException
        Finally
            ReadTask.Dispose()
        End Try
        Return xData
    End Function
End Class

Message Edited by birders on 03-10-2009 11:45 AM
Message Edited by birders on 03-10-2009 11:45 AM
0 Kudos
Message 1 of 2
(3,519 Views)
hello birders,

does this error occur every time you start your program?
may it be, that you have concfigured a task with the same name in Measurement and Automation Explorer?

kind regards,

Robert H
NI germany
0 Kudos
Message 2 of 2
(3,490 Views)