Specifications

Curtis 1310 Manual, Rev. B
43
1 6 F E B R U A R Y 2 0 0 8 D R A F T
Encoder Inputs
The encoder inputs can also be used as digital inputs. Pulling any of these pins
down to ground will cause the input to turn Off. Leaving it open will cause
it to be read On, as internally these 4 encoder inputs are pulled high to 5V.
Care must be taken not connect these inputs to any voltage above 5.5V or the
controller may be damaged.
If (SW_23 = ON)
{
;put code here to run when encoder 1 channel A (J4-1) is On
}
If (SW_24 = OFF)
{
;put code here to run when encoder 1 channel B (J4-2) is Off
}
These inputs also have the edge triggered variables SW_#_up and SW_#_
Down.
If (SW_23_Up = ON)
{
;put code here to run when encoder 1 channel A goes
;from On to Off
SW_23_Up = OFF
;clear the bit so VCL can read it next time around.
}
The encoder channels can also be used to read a single pulse train. In the basic
wiring configuration, Fig. 3, this can be seen on J4-3, encoder 2 channel A.
When using the Setup_Encoder function, it is important to turn off any fault
checking. The normal ENC#_Count and ENC#_Vel variables will be valid.
Note that ENC#_Dir and ENC#_Error have no meaning in a single pulse
train measurement.
Setup_Encoder(ENC2, ENC_COUNT, 0, 0)
;count mode with error checking turned off
Normally, the encoder will be powered by the +5 volt supply on J4-15 (ground
is J4-16). The current leaving this pin is measured and placed in the variable
ADC11_Output. Checking the actual values against a known nominal value
will allow the VCL to catch a disconnected encoder/sensor (current is too low
on ADC11) or a short/excessive current (current is too high on ADC11).
If (ADC11_Output < 10)
{
;Error! encoder is disconnected, current draw is too low
}
5 — VCL