LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exclude a iteration

Solved!
Go to solution

Hi.

 

I have to exclude a value from an forloop, and i don't how to do..

I've done an example of what I want to do on the vi that i have join

 

Explication :

when the iteration 5 appears, we go directly to the value 6 without take care about what we are supposed to do for the value 5.

 

Thanks

Peter.

Labview 2010
0 Kudos
Message 1 of 11
(3,611 Views)

Hi Peter,

 

maybe you need to use a shift register as shown in the attachment?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(3,607 Views)

Hi,

Thanks for your answer.

 

In this solution it duplicate the iteration #6 . And I just want one opération by iteration. Smiley Sad

 

Peter.

Labview 2010
0 Kudos
Message 3 of 11
(3,603 Views)

If your need only to remove an element from array, it is better to use delete from array

If you plan to add more actions on array elements and want to skip an iteration, then you need to do nothing on "skipped" iteration. Autoindexing does not have "Disable terminal" to skip it, so number of your elements will not change - it does not suit you. 

0 Kudos
Message 4 of 11
(3,594 Views)

Sorry my vi's example seems to be not clear, so I join you the original VI;

 

In fact, the problem come from this part of the VI

 Capture.PNG

The SubVi has some parameters whose one is the adress of the device. The device at the adress 6 is missing, so I don't want to call him thus skip the iteration #6.
.

Peter.

Labview 2010
0 Kudos
Message 5 of 11
(3,587 Views)

Place a case inside the loop which does nothing if the loop i is 6, defaul the current code.

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 11
(3,583 Views)

What should I put in the case ? Sorry I'm a notice on Labview

Peter.

Labview 2010
0 Kudos
Message 7 of 11
(3,579 Views)

If you want to go with your code, you need to reduce the iteration count by one and change the "=5" to ">=5", else you are doing one operation twice.

 

Why is there a delay in the loop? Does it matter what happens in the loop or is only the output array important?

 

Here are some possible interpretations, assuming you want the loop with the delay. If only the output matters, used the second option and delete the loop.

Message 8 of 11
(3,578 Views)
Solution
Accepted by topic author Peter Saraiva

@Peter Saraiva wrote:

The SubVi has some parameters whose one is the adress of the device. The device at the adress 6 is missing, so I don't want to call him thus skip the iteration #6. 



Maybe like this?

 

Also:

  • Your lower loop consumes 100% of the CPU while doing nothing. It needs a small wait
  • Change the 8 frame sequence into a state machine.
  • etc.
Message 9 of 11
(3,576 Views)

Hi Altenbatch,

 

Thanks a lot of your investment .

 

I can't open your VIs because on this computer I have the 2009 version of Labview. I shall inform you on monday when I shall have tried it on my desktop computer

 

Stay in touch.

 

Regards.

Peter.

Labview 2010
0 Kudos
Message 10 of 11
(3,549 Views)