LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clear outputs in a for loop

Solved!
Go to solution

Hi guys,

 

I have a problem, so I activate some timed values on the Analog-outputs from my RedLab card.

The problem is that when I stop the program, the Outputs are still activate.

 

 

How can I solve this problem?

 

Best regards max

 

 

0 Kudos
Message 1 of 8
(3,238 Views)

I'm not trying to be snide, but if you want the outputs to change after your FOR loop finishes, you have to put in code that changes them after the FOR loop finishes.

 

I'm guessing you need 4 more copies of "A OUT" outside the loop.

Or you could compare "i" to "N-1" inside the loop and do something special on the last loop iteration.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 8
(3,224 Views)

Well, I tried it in the way you see in the attachment.

It works for the present but my for loop work further till the begun time is at the end.

 

Maybe anybody have a solution?

 

Only for explanation, the  upper part is in a while loop.

 

greetz max

0 Kudos
Message 3 of 8
(3,203 Views)

Maybe we have a language problem, but I don't see why you did what you did.

 

I suggested putting four(additional) copies of the A OUT vi outside the FOR loop (in your original doc) and using them to set your final values.  Make sure they execute AFTER the for loop is done.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 8
(3,200 Views)

Ok, I think now I know what you mean.

The problem is how should I stop the Program during work? How can I stop the For loop earlier?

 

greetz max

0 Kudos
Message 5 of 8
(3,196 Views)
Solution
Accepted by topic author max_wie

What version of LabVIEW?

 

I forget which version introduced it, but lately you can add a CONDITIONAL TERMINAL to a FOR loop.

Use it to stop the loop if a button is clicked or if the voltage goes above 3.14159 Volts, or whatever.

 

You could also use a basic WHILE loop, set the inputs to AUTO-indexing, and compare "i" to N-1 yourself, within the loop.

 

Stop if STOP BUTTON = TRUE or i = N-1 or V > 3.14159...

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 8
(3,190 Views)

Also, please do not embed pictures inside of a Microsoft Word document. Simply post the picture directly. PNG, JPG, or GIF ONLY -  NO BITMAPS (and DON'T change the extension of a .bmp to get around the upload filter).

0 Kudos
Message 7 of 8
(3,175 Views)

thank you for your help. Robot Very Happy

 

greetz max

 

 

0 Kudos
Message 8 of 8
(3,152 Views)