LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FOR loop

Solved!
Go to solution

Hy guys.

I started programming in LabVIEW, but I got stuck. I would like to compare every two consecutive element of an array. I started to do this in a for loop, but I don't know how to get the two consevutive element.

kerdes.PNG

Could you help me out?

P.s: My really task is: I have an 10 different data in a file but they appear in the file more then 1 time and I have to write those 10 data in an array. The following program contain's the idea how I thinked that I can resolve it.

0 Kudos
Message 1 of 5
(3,002 Views)
Solution
Accepted by topic author Dombi_Kristóf

arr.png

 

For consecutive elements use the first case.

The second one removes all duplicates.

 

Message 2 of 5
(2,995 Views)

Thank you. It was really helpful. 
Can I have one more question...? What did you wiring for the output, array3, when the case structure is FALSE? Many times I wanted to use the CASE stucture without wiring the FALSE part, but I can't do that.

0 Kudos
Message 3 of 5
(2,980 Views)

Hi Dombi,

 

IF false THEN dont change array data

How to not change array data? Just wire them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,976 Views)

Hi Kristóf!

Not entirely sure what you are trying to achieve, but I may have a relevant example lying around.
This VI generates an array from the given elements "Options" in a way that no element is chosen twice. Have a look at the algorithm, you may find it useful!


rANDOMaRRAY.png

Cheers!

Message 5 of 5
(2,897 Views)