Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

A first chance exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll

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

 

 

0 Kudos
Message 1 of 5
(3,914 Views)

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

0 Kudos
Message 2 of 5
(3,840 Views)

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

Best Regards,
Jignesh Patel
Principal RF Software Engineer
0 Kudos
Message 3 of 5
(3,833 Views)

Is there a similar article for Measurement Studio with Visual Studio?

 

Thanks!

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

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

Best Regards,
Jignesh Patel
Principal RF Software Engineer
0 Kudos
Message 5 of 5
(3,799 Views)