LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Array

Solved!
Go to solution

Hello, wanna ask a small question. 

How to return an element from an array in labview? because im trying to return an element from boolean array and check whether it is true or false, then proceed to other operation. so far I only did until generating an array and change an element inside. The location will be input by the user, the element from that location will then be taken out and check whether it is true or false. if it is true, it will carry out the specific operation and the true in that element will be change to false at the end of the operation.Screenshot 2024-04-27 112430.png

0 Kudos
Message 1 of 4
(288 Views)
Solution
Accepted by Bondorudo03

Use Index Array primitive.

Message 2 of 4
(268 Views)

Thank you! Btw, is there anyway to improve this part?

question 2.png

The green line that connect the replace subset function, is from the for loop, is there anyway to make it clean, like connecting it to an independent block but that block represent the data from array

0 Kudos
Message 3 of 4
(232 Views)

Hi Bondorudo,

 


@Bondorudo03 wrote:

The green line that connect the replace subset function, is from the for loop, is there anyway to make it clean, like connecting it to an independent block but that block represent the data from array


In LabVIEW you need to obey "THINK DATAFLOW!", so the wire is the variable!

There is no "more clean" way to transfer data from source to sink than using a wire!

 

(You could straigthen the wire so it has no bends…)

 

The part to improve is your two stacked FOR loops! Here you could use a simple InitArray function instead!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(154 Views)