LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loop

Hi All,

 

Can somebody help me?

For some reason if I use Loop structure with a working code and I want to use/indicate the genereted data, the VI does not do that. It is constantly showing 0. 

 

Thank you in advance.

 

Best regards,

Adam2

 

0 Kudos
Message 1 of 10
(3,253 Views)

Hi Adam,

 

when you're talking about those "element" and "numeric" indicators: they only show values after the loop has finished - due to DATAFLOW!

THINK DATAFLOW!

 

 You also should learn how/when to use BuildArray nodes as well as IndexArray functions:

input no cycle rev A_BD.png

This does the same as your VI, I just removed unneeded functions.

I didn't change the behaviour at all as I didn't understand the goal you want to reach with this VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,240 Views)

I'm not trying to pick on you but.  for illustative purposes lets try a picture comparing your code with equivalent code that did not run amok through the Rube-Goldberg factory.

!1-1.png

Now comes the hard part.  Understanding WHY those two code segments are identical.  The help file and the getting started tutorial will help a lot.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 10
(3,227 Views)

Hi GerdW,

 

I have just started using Labview and yes you are right I need to learn each and every basic functions to use properly Labview but unfortunately my time is running out and now only the results are important.

Anyway my goal is to save and compare the data of the two indicators (without the multiplication) on each step through the whole loop. And based on the results some more actions should be done.

 

i hope i could explain myself.

And thanks for the lectures.

 

Regards,

Adam

0 Kudos
Message 4 of 10
(3,204 Views)
Obviously, you have to do the comparison inside the loop. The way you have it, you get only one result and that is only after the for loop finishes. You can't just say 'only the results are important' when you lack the basic knowledge to get any sort of results at all.
Message 5 of 10
(3,195 Views)

Nobody knows everything especially when learning a new language. At least I can't.

 

Also know that when somebody asks a silly question you just can not beleive it (I feel the same, not with Labview of course), but I beleive, learn without questions is kind of impossible.

("Sometimes you have to fall before you can fly.")

 

If my program just works fine I do not care how much power it is consuming and how it looks like.

 

Sorry for asking silly questions, I can not do anything with it until I understand everything.

Thanks your comment, critics help you develop.

0 Kudos
Message 6 of 10
(3,152 Views)

Hey Adam 

What did you mean by use/indicate the genereted data ?

or rather when do you want to use the data ? (after the loop is done executing or while the loop is running )

 

 

Derick Mathew
0 Kudos
Message 7 of 10
(3,148 Views)

Its not that the question was silly its that even after resolving the code to the simplest terms that generate the same data in the same manner we can't understand what you really wanted to do.  There is nothing in your post to tell us why the outputs you have are not what you want the vi to do.

 

What are the requirements for the vi?


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 10
(3,129 Views)

Hello,

Meanwhile I started to think, and I have realized I truly asked a "no-answer" question. 

I have almost finished the program, only saving is missing. I attached the VI.

This time my question is: Is it possible to save into a file (readable by excel) which includes the followings? 

- Coloumns: the same as in the cluster, rows: iteration steps (first row: headers showing the names of the indicators in the cluster)

- two different files: one for the "auto" diagram, and one for the "user" diagram

 

How should I think to solve this problem? (last time the DATAFLOW, and reading again the basics really helped.)

 

Thanks for your help.

 

Adam

 

Download All
0 Kudos
Message 9 of 10
(3,085 Views)

After a long day, I managed to make the VI to create the file I wanted.

Problem solved. 🙂

0 Kudos
Message 10 of 10
(3,060 Views)