09-02-2010 03:00 AM - edited 09-02-2010 03:07 AM
Phatin a écrit :
I did drop in some temporary indicators. I also went ahead and expanded the screen capture to show a bit more of the local VI so you can see that the results being fed to the subtract function should not be changing, and that because of the error, it essentially locks up the VI since it won't read any more values with the read VI. Anyway, it can still be seen that the subtract function is still errs.
I've never really noticed a lag in performance with the retain value feature turned on; however, I did for the heck of it turn it off. And to my extreme astonishment, the subtract function begins to operate correctly. Because as I understand the feature, it should not be influencing the results of the program in any way; it should just be recording the results for later viewing. And it doesn't interfere if I try it in a simpler VI. So unfortunately I'm still at a loss as to why the error is occuring, but at least that helps to narrow down the issue, and it's one more option for working around it.
Since the problem should be related only to the probe display, you could also wire the subtraction result out of the loop, using autoindexation, and check in the resulting array that the result of the operation is actually correct.
09-02-2010 08:45 AM
Except by adding in the indicators, that shows that the actual result of the operation is wrong. Also, as mentioned, the result as it goes into the shift register uses the wrong value, so that when the next iteration of the while loop runs, the read function tries to read "0" files. And even though it isn't shown in the prior images, the while loop is set to end when the total number of samples read reaches a certain value; which can never happen when the read function isn't reading any samples. So that also goes to show that the actual result from the subtract function is the -2, and that "-2" is not just the result being displayed by the probe.
I think I'd have to go with Ravens Fan and Ben that this must be a bug with the retain value function. In which case, it becomes an issue for NI to solve.
09-02-2010 09:56 AM
We're interested. Did you have any luck recreating the behavior in a VI I can test?
09-02-2010 10:06 AM
No luck so far. But I haven't been dedicating a lot of time to trying this. I can see about getting approval to send the actual program to National Instruments though if I can get an official request for it.
08-11-2013 06:26 PM
Hi:
. I am using LabView 2012 SP1 f4. I recently run into this problem in my program the result I get is always zero no matter I put in. In my program I created a sub VI to calculate the speed of a moving object using the current position minus the last position to find the defference over the current time. The answear I get is always zero. I even try using the math formula with the same error. If I invert one of the inputs to a negative value then I get an output which it is an addition of the two values.
I try something else, I placed an addition tool in the same VI and using the same two signals get a result, it works fine. If I negate one of the signals I get zero for result. Now I have a program that does not work.
08-11-2013 07:20 PM - edited 08-11-2013 07:20 PM
@Toro wrote:
Now I have a program that does not work.
I don't think your problem is related to the issues discussed in this three year old thread that has alredy been marked as solved. You should really start a new thread, giving you the opportunity to mark the solution to your issue once we solve it.
In any case, you say that you have a program that does not work. Can you attach it? How do you get the "last position" (e.g. feedback node, event data node, local variable, etc.). What is the datatype of your "signal"? Could it be you have a race condition?