Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Is the a reset for error 50103 in VB.NET

I have a program running in VB.NET that keeps popping up the error 50103.(The specified resource is reserved)  I am wondering if there is any way to reset this error without having to quit the program.  Once the program gets this error you have to cancel out of the program and restart.  The program will run fine for a while then the error reappears.  I have looked for the cause but can't find it.  Any suggestions?

0 Kudos
Message 1 of 5
(4,015 Views)

Hi,

 

Instead of bypassing this error, you may want to discover the root of the cause.  Depending on what your program actually does, there could be several causes to this issue.  Refer to the Causes of NI-DAQmx Error -50103 "The Specified Resource is Reserved" KnowledgeBase to narrow down the cause.

 

If after reading this KnowledgeBase, your issue remains unresolved, respond to this post.

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 2 of 5
(3,985 Views)

I have tried to resolve the problem but without any success.  I read through the possible causes of the errors and the only one that might be causing it is Case 2.  I am getting the error in the analogincallback procedure.  This is the code for that procedure:

 

 

Private Sub AnalogInCallbackSpeeds(ByVal ar As IAsyncResult)Try

 

If LowVoltsTestActive = False Then

ReadPLCBit(

 

"Running_Speed_Test", PLCBit, ReadOK)Else

ReadPLCBit(

 

"Running_LV_Test", PLCBit, ReadOK)End If

 

If runningTask Is ar.AsyncState And PLCBit = True Then

data = analogInReader.EndReadWaveform(ar)

 

'If LowVoltsTestActive = False Then

ReadYokoValue(YokoActive)

 

'End If

 

'Plot your data here

SpeedsDataTable(data, dataTable)

analogInReader.BeginMemoryOptimizedReadWaveform(SamplesPerChan, analogCallback, myTask, data)

 

Else

runningTask =

Nothing

myTask.Dispose()

WriteBit(

Sleep(20)

"Fire_Triac", False)'(100) v1.0.0.13

gMotorRunTimedone =

True

 

End If

 

myTask.Dispose()

runningTask =

Catch ex As DaqExceptionNothing

MessageBox.Show(ex.Message &

gMotorRunTimedone =

" AnalogInCallbackSpeeds")True

 

End Try

 

End Sub

0 Kudos
Message 3 of 5
(3,972 Views)

Sorry about the code.  When I copied it that is what it looked like on here. 

0 Kudos
Message 4 of 5
(3,971 Views)

Hi,

 

For some reason, I assumed that this was a DAQmx error.  I apologize for that mistake.  What hardware are you using with this code?

 

If your code is running for some time before it throws the "resources reserved" error, then it's most likely that the issue is with your code.  To test this, you may want to run an example program with your hardware to see if the same behavior occurs.

 

If you haven't already, you may want to make certain that you are only configuring and closing your task once within your program.  If you are running these operations in a loop, this may be the reason for this error.

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 5 of 5
(3,936 Views)