08-24-2010 07:29 AM
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?
08-26-2010 10:22 AM
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.
08-27-2010 08:04 AM
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 =
NothingmyTask.Dispose()
WriteBit(
Sleep(20)
"Fire_Triac", False)'(100) v1.0.0.13gMotorRunTimedone =
TrueEnd If
myTask.Dispose()
runningTask =
Catch ex As DaqExceptionNothingMessageBox.Show(ex.Message &
gMotorRunTimedone =
" AnalogInCallbackSpeeds")TrueEnd Try
End Sub
08-27-2010 08:06 AM
Sorry about the code. When I copied it that is what it looked like on here.
08-30-2010 03:12 PM
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.