LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call same block N number of times in LAVIEW

Can you please elaborate "why" you don't want to use a loop?



Remember Cunningham's Law
0 Kudos
Message 21 of 29
(1,446 Views)
Your insistence on not using a loop is just silly. Do you think that x number of instances of your subVI really makes any sense? You've been told how to do that but it doesn't make it right.
0 Kudos
Message 22 of 29
(1,440 Views)

for examle if i used loop ,  i need to put other calucation of output  also in same loop . thats i dont want to do. only thing i will get output do some some task and send next packet.

so how to do without loop.

 

Regards

Punith

 

 

0 Kudos
Message 23 of 29
(1,427 Views)

@punee wrote:

for examle if i used loop ,  i need to put other calucation of output  also in same loop . thats i dont want to do. only thing i will get output do some some task and send next packet.

so how to do without loop.


The point of a loop is to do things repeatedly.  So what is so wrong with doing the calculations in the loop?  What is wrong with doing the send in the loop as well?  That is what any good programmer would do.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 24 of 29
(1,419 Views)

Sorry, I still don't see why this can't be done in a loop. Everything about what you describe scream loop so loudly, I have to type this wearing ear protection.
You could create an Array of all the strings you want to convert, pass it to a for loop (there's the connection between the "N" in the thread title and the "N" on the top left corner of the for loop), convert the string in the for loop and perform the action. Rinse and repeat for all stings in the array.



Remember Cunningham's Law
0 Kudos
Message 25 of 29
(1,417 Views)

You really are stubborn, and, I expect, really do not understand LabVIEW nor what you are doing.  You cited an example using C code, but your C "Send" function didn't return a value (whereas you are asking LabVIEW to do so).

 

I mocked up a dummy Send function, using Error lines so I can control the order of execution.  The top row is what we think you are asking to do, the bottom shows the equivalent loop.  The presumption (and this might be totally wrong) is that you'd do more-or-less the same thing to each Hex output.  None of us can understand why you would "hard-code" a sequence, but if you really want to do so, just do it and stop pestering us!

Ridiculous Example.png

Bob Schor

0 Kudos
Message 26 of 29
(1,403 Views)

OK Bob,

 

But i am not getting how to pass the array of string to for loop. Could you give your vi code or else can you tell me , how to create array of strings which should be constant.

 

Regards

Punith

0 Kudos
Message 27 of 29
(1,375 Views)

these pictures a drag+droppable onto a labview blockdiagram,

so you could start testing isntantly.

 

getting an array into the loop is exactly how bob showed, you connect the array to the loop and then you can either (like in bobs code) have it autoindex (so every iteration i corresponds to the array[i] element) or tunneled so you have the whole array in each itereation accessable.

 

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 28 of 29
(1,362 Views)

punee wrote:

But i am not getting how to pass the array of string to for loop. Could you give your vi code or else can you tell me , how to create array of strings which should be constant.


I thought you said you went through the tutorials.  Did you not see the second on loops and autoindexing terminals?  Please go through the tutorials and everything you have asked will make sense.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 29 of 29
(1,348 Views)