From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

System crash after unhandled exception during pending A/D conversion

Anybody experienced similar phenomena and/or has a fix ?:

I'm using the DAQ components (6.0) for ActiveX (subset delivered with the NI-DAQ driver-CD) from VB 6.0 (SP6) to control measurements with a 6040/6070 E-series card.
The application starts a delayed (with CWpulse) A/D conversion and waits for the "acquired data" event. In the meantime, several other application-handled events can happen (mouse, kbd, timer, network link).
We have a watchdog application which monitores the main application, but...:

If there occurs an unhandled exception while the A/D conversion is pending, the system crashes after the "serious error..." message / error reporting of the O/S is confirmed - both on Win2000 and XP (SP1a). One can here the HDD retract and the (mostly) reboot. Two times, the system locked up so bad, it won't even restart until a complete power-cycle - of course at the customer's site... 😞
That kind of behaviour is reproduceable when I force an exception (e.g. div-by-zero) after the CWAI component was started.

I tried that on systems with NIDAQ 6.9.3 and also with 7.1, but both give me no chance to return to the O/S after the application failure.

Does anybody know about the reason for such unfriendly behaviour or can help me to solve that problem?
Any help will be much appreceated!
0 Kudos
Message 1 of 5
(2,830 Views)
Hello,

First of all please try to use the NI-DAQ 7.3. I can not promise that it leads to a solution.
The problem is that when the unhandled exeption occurs the daq-driver is not stopped and the acquisiton continious. This behavior can lead to the crash.
The only solution I can think of is to prevent the unhandled exception.

Regards
Michael Sallaberger
0 Kudos
Message 2 of 5
(2,798 Views)
If unhandled exceptions are a concern, I would recommend switching over to the DAQmx API and driver. The DAQmx driver does a much better job of gracefully handling abnormal program termination and shutting down any ongoing acquisitions.
0 Kudos
Message 3 of 5
(2,796 Views)
I'd prefer this, too - also for some other reasons, like shared ADC access by different applications.
But, as NI states, NIDAQmx can not be used under VB6... or is there a (undocumented?) possibility to use the mx API also with non-.NET development systems?
0 Kudos
Message 4 of 5
(2,780 Views)
While DAQmx is not officially supported through Visual Basic 6.0, it can be done. I am not a VB6 user and haven't tried it, but you can look at the following Knowledge Base explaining how to accomplish this. You can also look at the following MSDN article explaining how to access DLLs and the Windows API through VB. Essentially you end up making DLL calls as you normally would through VB using the DAQmx C API. I hope this helps.
0 Kudos
Message 5 of 5
(2,753 Views)