LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wait until the acquisition is done

Solved!
Go to solution

Hi 

 

I need some help. I've done a VI that acquire and count edges. The acquisition will stop and go to another case structure once the counter meet the requirement. However, it doesn't work as wanted. See the picture below (also attached).

 

Sans titre.JPG 

 

What i want is, when the number of encoder line z reach some value, all the acquisition will be stopped and go to the next case structure.

 

I cannot connect the output of "More Than" to Stop button (as figure below) as it will stop all the program.

 

Sans titre.JPG 

 

Hoping someone to help me.  

 

0 Kudos
Message 1 of 21
(4,244 Views)

Fird,

 

Yep- the state machine you've created doesn't work to do what you want.  So, let us back off the coding for a bit and go to paper.  My interperation may be off a bit but, is it fair to say that you want "code" to meet the following requirements?:

 

1) aquire waveforms from a (or multiple) device(s) simultaineously

2) end all data aquisition on a condition of the data in one of the aquired waveforms

3) continue to another process once data aquisition is ended

 

Once we define the objective we can implement it in LV


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 21
(4,234 Views)
Yes. The objectives you mentioned are absolutely correct!
0 Kudos
Message 3 of 21
(4,232 Views)
If you want to go to the next state, under no circumstances do you want to wire a true value to the while loops termination terminal. A true value terminates the loop. There should be a false constant wired there. You want your case statement to either name the next state if acquisition is complete or the current state if the acquisition is not complete.
0 Kudos
Message 4 of 21
(4,211 Views)

Fird,

 

I've read your problem and what i can understad is that you want to do a state machine, with a state to adquire data and anothers states to do others things, in your program you must to replace the tunnels for shiftregisters in the while loop. Im sending you a exemplo of a state machine. Dont forget that all tunnels of the cases must be connected to the shifter register, if you do like that, the Stop Button will service just to finish the program whenever you want.

 

I hope that helps you

SaCi

0 Kudos
Message 5 of 21
(4,200 Views)

Dennis, 

 

Thanks for your suggestion.

 

SaCi,

 

Thanks for the VI. I believe it is very helpful. I will try to implement in my VI.

 

-FiRd- 

 

 

0 Kudos
Message 6 of 21
(4,188 Views)

Hi, 

 

I've tried the suggestion by SaCi using a virtual input (please refer to attachment). 

 

However, the input from the square wave is not counted at all which I don't know why. Since the edge of square wave is not counted, it won't go to the next case structure.

 

SaCi and Dennis, any idea.

 

Btw Dennis, could you explain in a figure about your suggestion.

 

Thanks

 

-FiRd- 

0 Kudos
Message 7 of 21
(4,177 Views)

Fird, I just have labview 8.5, could you save your last program in this version, because with version 8.5 i cant open VI's built in version 8.6.

 

saci

0 Kudos
Message 8 of 21
(4,175 Views)

Looking your problem again i notice that you just checking when the pulses are positive and dont count the edges of transitions. Im sending you a program that count the transitions of a square wave generated by a simulate signal. The program count the falling edges but if you want count the rise edges you just need to modify simples things.

 

hope helps you

 

Saci

0 Kudos
Message 9 of 21
(4,166 Views)

Hi SaCi,

 

Sorry for late reply.

 

Attached is the version of 8.5.

 

Actaully, if I refer to the objectives as mentioned previously, the device will count the edge and one it reach one value, all the acquisition will stop and go to the next case structure.

 

Thanks.  

 

 

Message Edited by Fird on 07-03-2009 07:36 PM
0 Kudos
Message 10 of 21
(4,162 Views)