LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building Array/Case structure/Boolan

Need some help before im going nuts!

The solution is probely very simple but i cant figure it out

 

I want to bulid an array containing vales.

This array shall ad an new value(not overwriting the old one), but put it one the net place in the array everytime the case structure goes true.

 

Any one that can help m? I have an photo underneath showing where i am today

 

 

 

0 Kudos
Message 1 of 7
(4,534 Views)
You just need a shift register with a build array in the true case. The false case is wired straight through.

Of course, your code will never work because the comparison is done outside the loop. And, using that select function is just plain silly.
0 Kudos
Message 2 of 7
(4,525 Views)

Hi LCT3,

 

I think you are looking to do something with the build array function. If I understand correctly you are trying to add a value to the end of your array when a case structure is true? I have created a quick example illustrating how to do this with a button inside a loop. Take a look at it and see how it works!

 

Conditionally Build Array.png

 

The image is a snippet, so if you are using LabVIEW 2011, you can save that .png to your computer and just drag it into your block diagram and it will turn into code. If you are using an earlier version of LabVIEW, I have attached the same code saved in 8.0 so you can open it.

 

I hope that helps, please let me know if you have any questions about it.

 

 

0 Kudos
Message 3 of 7
(4,523 Views)

Hi LTC3,

 

Just to add to the other guys - good service or what Smiley Wink

 

  • Shift registers allow you to store data between one iteration of a loop and the next.  There is a good explanation of how these work here.
  • The execution order in LabVIEW is defined by dataflow.  Dataflow means that a node will only execute when all its inputs are available, and it will not return its output until it has completed its execution.  Nodes can be anything (loops, functions, SubVIs).  More on this here.
  • Also, the select function is not required as you are saying "if True, return True", "if False, return False"

Logic.png


Regards,

Peter D

0 Kudos
Message 4 of 7
(4,520 Views)

Still aint working.

 

The task for this VI is to read from an TDMS file stored on the computer.

(Im using Excel plugin to check the file afterwards)

Then i want to search this file data,based on time.

Then i want to store the data from the file between start and finish time  selected in the VI, putting the data into a new array ,and later display them onto av graph .and make an new file of them.

 

Are sending the VI who generates the file,and reads the file.

 

 

Download All
0 Kudos
Message 5 of 7
(4,506 Views)


Im not a newbe in Labview so i have tried it out alredy

The problem sems to be the data im sending into the array.

 

And the logig before the case is to make sure im getting data from reading  a file , only between a lower and upper limit of time.

 

(Sorry for my bad English , im Norwegian)

 

 

0 Kudos
Message 6 of 7
(4,502 Views)

Your Search/Split string only sends out a single result (the last) due to you not building an array. Probe the wire and you'll see. Could that be the reason?

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(4,468 Views)