LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wiring data into while loop

I am making a program which contains 10 parallel while loops.Each of the while loops contains an Intensity Graph (Waterfall) which updates at a different rate.The problem is, I have to bring data (array) into the while loop.the data is received from the network using the TCP Read function.But when I wire the array into the while loop, it is not functtioning properly and creates problems.how can I bring the array into the while loop?Can anybody help?
R.P.Kumar
thalvain@yahoo.co.in
0 Kudos
Message 1 of 3
(2,934 Views)
Look at the node where the array wire enters the while loop. If it is solid, it will pass the entire array. If it contains a bracket, it will auto-index, or pass the next element (or dimension) each time the loop executes.

Right click on the loop entrance node and select "Enable Indexing" or "Disable Indexing" depending on how you need it to work.

~Tim
0 Kudos
Message 2 of 3
(2,934 Views)
> I am making a program which contains 10 parallel while loops.Each of
> the while loops contains an Intensity Graph (Waterfall) which updates
> at a different rate.The problem is, I have to bring data (array) into
> the while loop.the data is received from the network using the TCP
> Read function.But when I wire the array into the while loop, it is not
> functtioning properly and creates problems.how can I bring the array
> into the while loop?Can anybody help?

I have a feeling that you intend for your ten loops to be fed from an
eleventh parallel loop that is servicing the TCP connection. If this is
the case, then you will need to have a way for them to communicate that
doesn't wire them together.

The best way to do this is probably to make ten queues
with unique
names. As the TCP loop produces data, it puts the data in the
appropriate queue. Each loop reads from its own queue, meaning that it
blocks or blocks with a timeout waiting for new data. You will also
need a Boolean that the ten loops read from, proably using local variables.

If you would like something simpler, then put your ten intensity charts
in the same loop that you do the TCP stuff in. Put the chart terminals
inside of a case statement so that you can select when they get new
data. Some loop iterations will update nothing, others will update a
particular chart, whichever one the TCP packet was for. Anyway, without
going into tons of detail, this is a good alternative that you might
find simpler to debug.

Have fun.
Greg McKaskle
0 Kudos
Message 3 of 3
(2,934 Views)