Vous êtes sur la page 1sur 4

Simulator kvadraturnog enkodera.

vi
I. Description:
This example simulates the outputs of a Quadrature Encoder. A pulse train is
generated on the output of Counter A at a freqeuncy of (Pulses per Revolution *
Number of Pulses per second or minute). Counter B generates a retriggerable pulse
90 degrees out of phase with Counter A.

II. Instructions for Running:


1. Select the desired device number and counter. The lower valued counter in the
counter pair should be assigned to counter A.
2. Select the desired value for Revolutions, Pulses per Revolution, and the time base
(per second or minute).
3. Start the VI. You can switch directions by clicking the Direction button. You can
pause the encoder by clicking the Pause Encoder button.

III. Block Diagram Steps:


1. Covert the Timing Encoder Parameters to high and low time.
2. Configure both Counter A and Counter B to Output Pulse in respect to time.
3. Use Start Trigger VI to Configure Counter B to trigger from Counter0 (A) Output.
4. Use Timing VI to configure Counter A to Continuous generation.
5. Use the Start.Retriggerable Property Node to configure Counter A to be
retriggerable.
6. Use Start Task VI to start both Counter A and Counter B.
7. Use Is Task Done VI to check for errors during the generation.
8. The No Change case will test the Encoder Parameters for a change in state and will
send us to the
appropriate case.
9. The Update Speed case will occur when the speed of the encoder has been
changed by the user. The
CO.Pulse.HighTime Property Node is used to change the specs of both counters.
10. The Switch Direction case will change the direction of the encoder by reversing
the Idle State.
11. The true case that's embedded in the Pause case uses the Stop Task to Stop
Counter A. Counter B is
triggered off of Counter A so it will also be paused.
12. The false case that's embedded in the Pause case uses the Start Task to Start
Counter A after being
paused.
13. Use the Clear Task and Simple Error Handler VIs to clear the tasks and check for
errors.

IV. I/O Connections Overview:


The signal will be output on the "output" terminal of the two counters, GPCOUT0 and
GPCOUT1.

Connector Pane

Front Panel
Block Diagram

Vous aimerez peut-être aussi