LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I get compilation errors under weird circumptances. Why?

As attached, the VI works fine.
But when in the 2nd step of the sequence (i.e. step 1), in the most inner
for
loop, I try to replace the "MEAN" VI of the 8th set of values (i.e. #7) by
a
manual mean (as I did for all the other 7 sets of values), I get
compilation
errors as soon as I run the VI.
These errors are:

Compiler error. Report this problem to National Instrument Tech support.
copy cvt, csrc=040

Compiler error. Report this problem to National Instrument Tech support.
bad mode in_GenCopy Convert Num Code xc=040

Compiler error. Report this problem to National Instrument Tech support.
genFPushOp bad type: xc=040

What can I do to fix it?
Thank you.v
0 Kudos
Message 1 of 4
(2,652 Views)
I ran your VI and i couldn't replicate the problem, BUT on looking at your diagram you have alot of coercion dots. It may help, but try changing the representation of the dividing factor (4) to Single, and add a convert 'To Single Precision Float' after the Mean.vi. I have included the changes in the example below.

If it doesn't solve your problem, at least your program will run a little faster.

Kim
0 Kudos
Message 2 of 4
(2,652 Views)
Thanks for the tip, but it doesn't work any better.
In fact, the executable file you gave me also crashes, producing the exact same compilation error message as mine. I'm afraid it it somehow hardware, or computer-related...
In addition to that, my problem is actually that I cannot get rid of the Mean.vi without making the program crash. That's why the mean is of the set of values #7 is computed using Mean.vi
In this configuration, it works just fine on my mmachine, but as soon as I replace this last mean computation my a manual computation that is supposed to do the same (a summation followed by a division by 4 - either integer or single, I tested both now), it produces this compilation error.
Does anybody know if it can be computer-rela
ted, or DAQ board-related, or anything else, since it works on your system?

Thanks

Loris
0 Kudos
Message 3 of 4
(2,652 Views)
When i said i ran the example i meant, just the code, minus the AO/AI functions. And in the place of the AI's i put an array constant containing 8 values. So basically all that tells you is the code works. Maybe you should try that too? - it'll tell you if there's a problem with your copy of LV or PC.

Have you contacted NI with the error codes as they suggest?

It is a bit strange that it works with the Mean.vi, but not without. Try making the changes you need to, but keeping the Mean.vi with no connections in the diagram, at the beginning for instance. It seems like a long-shot, but it's worth a try.

You could also change the For loop completely, so you calculate the mean using a different method (see attached example).


I also find it unlikely it could be the DAQ board if the problem only occurs when you try and get rid of the Mean.vi from the diagram. I guess it would be worth testing it with MAX though, just to be sure.

Let me know how you get on..

Kim
0 Kudos
Message 4 of 4
(2,652 Views)