LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter 7.1

I've read through the message boards but I’m still stuck.
I've got a stepper motor cycling back and forth and data being collected at the end of each position for (X) amount of cycles. This process pauses when the environment deviates more then 1°C then resumes when its back in spec. I want to count each cycle of the stepper motor(there, then back = 1 cycle) but the counter resets when the program resumes. Can someone explain or give me another method that will get around this or better yet attach something that I can just drop in. I'm using labview 7.1 and shift registers still make no sense to me.
0 Kudos
Message 1 of 5
(2,726 Views)
You say that the process pauses then resumes and the counter resets. Is the process a subVI or a loop that is called again when the process resumes? If so, using an initialized shift register will retain the data from the previous call.

A shift register provides a loop (for or while) with access to the previous value(s) of data written to its right terminal. Put a shift register in a loop. Wire the i terminal to the right terminal of the shift register. Wire numeric indicators to both the left terminal and to the i terminal inside the loop. Put a Wait(ms) function with the wait set to 1000 inside the loop. Run it and watch the indicators. Note particularly the value of the left indicator on the second run. Then try initializing the shift register by connecting a control or constant to the left terminal from outside the loop. See the attached VI.

Lynn
0 Kudos
Message 2 of 5
(2,712 Views)
I've attached a jpeg of my program, A picture is worth more type of thing. I'm still working on the example but its still rough going.

I've read through the message boards but I’m still stuck.
I've got a stepper motor cycling back and forth and data being collected at the end of each position for (X) amount of cycles. This process pauses when the environment deviates more then 1°C then resumes when its back in spec. I want to count each cycle of the stepper motor(there, then back = 1 cycle) but the counter resets when the program resumes. Can someone explain or give me another method that will get around this or better yet attach something that I can just drop in. I'm using labview 7.1 and shift registers still make no sense to me.
0 Kudos
Message 3 of 5
(2,704 Views)
I modified my demo to add a section that increments the Initialization count on every third iteration of the loop.

Lynn
0 Kudos
Message 4 of 5
(2,696 Views)
Hi Brier_Raider,

It looks like your program is off to a good start. The demo provided above is a good place to start in understanding shift registers.

Attached below is a weird way for me to provide you with an answer, but as you said, sometimes an image is worth 1000 words. What I've done is taken your image, and modified it in paint. If you want to count the number of times that case within your case structure executes, you will want to wire your VI similar to that in the picture.

When the integer enters the case structure, it will increment if you are executing the True case. If it is the False case, we will pass the wire through without modification.

The shift registers will be on each side of both the inside and outside while loops, and will store the current count value in each loop's iteration.

Its a crude image, but hopefully it delivers the message.


Robert
0 Kudos
Message 5 of 5
(2,663 Views)