I have a multi function LV7.1 application using E-series card (DAQcard-6062 or PCI-6040). Function 1 is a multi channel AI + DI/O utilizing traditional NI-DAQ and function 2 is a multi channel AI/O + DI/O utilizing IN-DAQmx. Both functions run flawless when accessed individually and single time from the application and without running or accessing any other function. Given this NI-DAQ mix in the same application, it is recommended that "After using a device in Traditional NI-DAQ, you must reset the device before you can use that device in NI-DAQmx." (Traditional NI-DAQ Device Reset.vi). This seems to work if the AI using tradition NI-DAQ is done with a single channel. However, the problem seems to be that when AI using traditional NI-DAQ and with multiple channels – and before proceeding to the second function which utilizes the NI-DAQmx, the Device Reset.VI locks up and never returns! Any suggestions.
My first question would be why are you using traditional DAQ and MX at the same time on the same board? Since your device supports DAQmx, I would suggest using DAQmx for your entire application. Mixing the two drivers on the same board can be a little "dangerous" and should generally be avoided.
If you are new to DAQmx and need some help re-coding your traditional DAQ program, let us know and we can help you through it. Once you get the hang of it, you'll find that DAQmx is much simplier, easier to use, and robust than traditional DAQ. Also, there is a wealth of example programs built into LabVIEW under Help >> Find Examples >> Hardware Input and Output >> DAQmx.
I remember couple of years ago I had a similar problem when resetting the card using Device Reset.VI . The PC did not lock, but the application slowed down for some time then used to recover. The problem was I was scanning at a high scan rate (50 kHz), and the buffer size was set accordingly large enough to handle scans. Nidaq took time to re-free the memory allocated for the buffer. You may want to rewrite the libraries in DaqMx.
I’m using traditional DAQ and DAQmx, however, not at the same time but rather on a separate functions targeting the same DAQ board- i.e. the user would select option 1 from the application’s main menu which uses traditional DAQ, the function ends and ideals at the main menu, then the user may select option 2 to run which is coded with DAQmx. The two options are totally separate and independent functions. I wrote the original application with traditional DAQ ten years ago. However, I recently added 5 more functions, which I coded in DAQmx. I’m already in process of converting the old function in DAQmx. I just need a short-term solution for my end user to be able to run the application as it is until I release the new code. Currently we have been cycling power on the DAQ board every time when switching between options, it works but not practical. I also have a SR in progress with NI but have not gotten any positive FB from the app eng. BTW, thanks for the response I was away from work last week and just got back.
The Device Reset.VI always return a fault in the status output. I am using AI/O clear.VI to clear task before device reset. The DI/O clear.VI always returns a fault after DIO read or write. Try it. BTW, thanks for the response.
@Sasmar wrote: The Device Reset.VI always return a fault in the status output. I am using AI/O clear.VI to clear task before device reset. The DI/O clear.VI always returns a fault after DIO read or write. Try it. BTW, thanks for the response.
What error code is returned by Device Reset? You mentioned earlier that Device Reset was hanging. Under what conditions does it hang, and under what conditions does it return an error? I am trying to reproduce this, but I am not seeing the same problem that you are. Are you using NI-DAQ 7.3 or some other version?
Joe, I’m away from the workstation to give you the error #. Using NI-DAQ7.3, try traditional DAQ, AI six channels or more with low S/R (ex. 1Khz) with couple of lines DI/O R/W for a few secs., conclude acquisition with AI Clear.VI and DI/O Clear.VI. The D/IO Clear.VI will return error at this point. If you continue the VI and terminate it with Device Clear.VI, the status line returns an error as well. If you follow the same above scenario and end the VI without the Device Clear.VI, then run Device Clear.VI all by itself it will hang, LV will not respond afterward. Thanks.
Have you tried the traditional VI "Device Reset"? This should reset the device and make it available for use by DAQmx. If that doesn't work then you can always do it by going into MAX, right clicking on "traditional DAQ devices," and clicking "Reset Driver for Traditional DAQ." This is the sure way to make the device available for DAQmx.