LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

every value subtract of last value

Solved!
Go to solution

Try running yoru VI with highlight execution on.  Then you'll learn a lot about how your VI works.

 

You don't want to subtract from 2.  You want to subtract 2  (at least according to your original message.).

 

Put a wait function inside your loop and the indicator back in there.  That will slow down the loop execution also so you can see each and every step.

 

Finally.  Actually First.  TAKE THOSE TUTORIALS.

0 Kudos
Message 11 of 24
(1,798 Views)

I have tried a lot of times, but I just need that for every time then loop goes from the first value would be subtract 2, 300-2 then got 298 and from the last value, 298, would be subract 2 again and so on. Could you might help?

 

Thanks

0 Kudos
Message 12 of 24
(1,793 Views)

I did help.  Make the simple changes I suggested.

0 Kudos
Message 13 of 24
(1,790 Views)

I did, but I only got 298 and the value dont goes to for every 2 values.., hmz.., could you take picture for example how it should look?

 

Thanks

0 Kudos
Message 14 of 24
(1,784 Views)

Attach your VI.

0 Kudos
Message 15 of 24
(1,780 Views)

I have tried, but got message - The attachment's passvalue.vi content type (application/labview) does not match its file extension and has been removed. Could you create your own VI and attached I will download.

 

Thanks

0 Kudos
Message 16 of 24
(1,774 Views)
Solution
Accepted by topic author JohnP2356
0 Kudos
Message 17 of 24
(1,766 Views)
Solution
Accepted by topic author JohnP2356

Super!!!! It works, thank you very much. Respect 🙂

0 Kudos
Message 18 of 24
(1,759 Views)

The problem here is this task is so simple that we can't show you anything without basically doing your homework.  You need to stop randomly trying things and think about the problem.  This is common problem for people new to LabVIEW, they get tempted to just connect wires in new places and hope that will give them correct results.  That's BAD because even if you do get correct results it may not work in all cases and you will have a bug that's very hard to debug.  Smiley Frustrated

 

So, In your last block diagram you are subtracting 300 from 2 (2 - 300 = -298) on the first iteration of your loop.  Is that what you wanted to do... I don't think so.  So fix that first.  You also said Yes, it should stop at zero  AND Yes, it should loop 300 times.  Think about that and you'll see the two are mutually exclusive if you're subtracting 2.  You need to pick one or the other. 

 

EDIT:  Oh well, never mind then.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 19 of 24
(1,756 Views)

@JohnP2356 wrote:

Super!!!! It works, thank you very much. Respect 🙂


You're supposed to mark Raven's Fan's post as the solution.  Not your own.  Smiley Wink

 

Don't worry.  This happens a lot and I think you can change it if you want.  Just pick his post.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 20 of 24
(1,746 Views)