LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UP/DOWN Counter in labview... How to do it????

Help,

I have been knocking my head against a brick wall with the problem of making
an up/down counter that can be used within a program. What I need to do is
count up to a given number, outputing the individual numbers to a portion of a
program that controls communication, then count backwards, from that number to
another number (zero). the individual counts will be used elsewhere in the
program so they have to come out of the loop as it counts up/down. everytime
i attemp to control it, to count up to 120 then from 120 down to zero, the
program stops functioning the way "I" want it to, and passes the end result
only.

Ken
0 Kudos
Message 1 of 3
(4,791 Views)
Ken wrote:

> I have been knocking my head against a brick wall with the problem of making
> an up/down counter that can be used within a program. What I need to do is
> count up to a given number, outputing the individual numbers to a portion of a
> program that controls communication, then count backwards, from that number to
> another number (zero). the individual counts will be used elsewhere in the
> program so they have to come out of the loop as it counts up/down. everytime
> i attemp to control it, to count up to 120 then from 120 down to zero, the
> program stops functioning the way "I" want it to, and passes the end result
> only.

Assuming that you are generating your count value OK, then try writing to a local
variable from within the loop and then rea
ding the most the local variable in the
section
of the program that controls your comms.

Another option may be to have a sequence within the loop, with the comms stuff in
a
frame which is after the chunk of code which changes the counter value/ does other
stuff.

If you get really stuck e-mail me direct

Andrew
0 Kudos
Message 2 of 3
(4,791 Views)
Ken wrote:

> Help,
>
> I have been knocking my head against a brick wall with the problem of making
> an up/down counter that can be used within a program. What I need to do is
> count up to a given number, outputing the individual numbers to a portion of a
> program that controls communication, then count backwards, from that number to
> another number (zero). the individual counts will be used elsewhere in the
> program so they have to come out of the loop as it counts up/down. everytime
> i attemp to control it, to count up to 120 then from 120 down to zero, the
> program stops functioning the way "I" want it to, and passes the end result
> only.
>
> Ken

Do you use a while loop? If so, have you turned OFF autoindexing on the tunnel? I
have the same but reverse
d problem, I wanted an array of numbers, not the
individual ones. It helped for me! Good luck!

Regards
Stefan
0 Kudos
Message 3 of 3
(4,791 Views)