07-03-2009 10:23 AM
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).
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.
Hoping someone to help me.
Solved! Go to Solution.
07-03-2009 10:55 AM
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
07-03-2009 10:57 AM
07-03-2009 12:38 PM
07-03-2009 02:12 PM
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
07-03-2009 03:24 PM
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-
07-03-2009 05:38 PM
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-
07-03-2009 05:43 PM
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
07-03-2009 07:16 PM
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
07-03-2009 07:34 PM - edited 07-03-2009 07:36 PM
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.