06-03-2015 07:40 AM
Can you please elaborate "why" you don't want to use a loop?
06-03-2015 07:47 AM
06-03-2015 08:38 AM
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
06-03-2015 08:56 AM
@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.
06-03-2015 08:57 AM
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.
06-03-2015 12:42 PM
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!
Bob Schor
06-04-2015 03:04 AM
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
06-04-2015 03:34 AM
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.
06-04-2015 05:57 AM
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.