LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Code in debug runs ok, but in realease mode fails - uses PCI-6704

This is a weird one.

I've inherited an application that since being installed on a PC with a PCI-6704 card it behaves strangely.

The application performs many tests and measurements, the first set of measurements being voltages. When the tests are run the first time, the measurements make sense, i.e. valid readings of around 1mV. Yet when the tests are run again, the readings are 76V, which is quite a difference. The only way to get the test to work properly again, is to close and re-open the application.

The weirdness doesn't stop there. If run in debug mode, then the tests work fine and can be repeated again and again, without restarting the software. Furthermore, the application displays th
e same behaviour with nothing connected to the DAQ card!

This means I cannot debug the problem too easily.

The application resets the DAQ card to default settings, to no avail (least not in release mode).

More weirdness, the very same application runs fine on a PC with an AT_MIO_16DE-10 card, in both debug and release configuration.

I tried 'excluding' all measurements made after the ones in question, in order to see if some specific test or line of code was responsible. With all subsequent test code excluded, the measurements are OK in release mode. I tried 'un-excluding' code line by line until I found a line that caused the problem. Having found it, I then 'excluded' all lines in the routine containing the found line, to produce a version I new to work OK, and it failed, after having worked an hour earlier! I believe this rules out compiler bugs, as the it produces a build that's OK one minute and fails the next.

The NI_DAQ version is 6.7.0f6 on a NT4 workstation.
I'll try the newer 6.9.2 version from the web.

Failing this, any other suggestions? Are there some peculiarities with the card I need know about?

Has anyone any other suggestions?

Many Thanks (if only for reading this!)

Simon Reeve
0 Kudos
Message 1 of 3
(2,969 Views)
Hello

I just wanted to make sure if you were using the PCI-6704 to actaully make measurements. Becuase this card is only a software timed analog output board. Since it is software timed, it wasnt really meant for generating waveforms(if that is what you are doing).
The AT-MIO card is a multifunction device that has analog outputs and analog inputs, 8 software timed digital lines and 2 counters, so you can take analog measurements with it.

So are you using the board to generate the signals that you are measuring with the AT-MIO device?
If you are not sure whether there is something in the code, you can try running the examples that should be on your machine, that demonstrate analog output operations. They can be found under CVI\samples\daq\ao

Hope this helps


Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(2,969 Views)
Fixed it!


There were numerous variables that were not initialised prior to use within functions. In particular, buffers used by SCAN_Start. Clearly, the compiler in debug mode initialises vars, but not in release config.

Also, my frustration led me to quote the wrong card! well spotted.

Thanks

Simon Reeve
0 Kudos
Message 3 of 3
(2,969 Views)