06-09-2011 04:20 PM
I occasionally get this untrappable error. Probably about 10,000 times each time I run my code. Doesn't happen with every DAQmx function call, nor does it happen all the time in the same line of code:
A first chance exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll
Is it anything I need to worry about? If there a fix?
NationalIntruments.Common v8.9.35.302
NationalInstruments.DAQmx v9.035.105
06-11-2011 07:12 AM
Ok. Figured out my code problem, but the error I referred to is still not trapped.
I had inadvertantly Disposed of the task I was trying to reserve. The error fell through to the Catch block, but the error referred to in previous post was still generated, sometimes as many as 20 times before re-looping. In otherwords, I see one error message in my log file, a whole lot of the other message in the output window.
Code (doing this from memory so syntax might be off):
public Class DIO
Private DOTask1 as Task = DaqSystem.Local.LoadTask("doTask1")
Private DOTask2 as Task = DaqSystem.Local.LoadTask("doTask2")
private Sub ReserveTask()
dim bOK as boolean = False
dim iTries as Integer = 0
While Not bOK And (iTries < 500)
Try
iTries += 1
DOTask1.Control(Control.Reserve)
bOK = True
Catch oE as Exception
LogError(oE.Message.ToString & vbTab & iTries.ToString)
End Try
End While
End Sub
End Class
06-12-2011 08:54 PM
Hi Steverino.
There is a knowledge base article for First Chance Exception that you can find here. If you follow the debugging steps you will be able to zone in on the code causing this error.
Regards,
Jignesh P
06-13-2011 01:32 PM
Is there a similar article for Measurement Studio with Visual Studio?
Thanks!
06-14-2011 10:29 PM
Hi Steverino,
I would like to get some background information from you:
Can you tell me more about your application?
As well as what type of DAQ card you using?
What version of Measurement Studio do you have?
Regards,
Jignesh P