Analog input sample code, 12 universal inputs, Universal inputs – High Country Tek DVC80 User Manual

Page 36

Advertising
background image

P/N: 021-00154, Rev. A.6 - updated for V4.7 Tools

Page | 36

the form y = gain * x + offset where x is the analog input’s value and y is the scaled value. This is convenient to
c
o
n
v
e
rt
a
s
ensor voltage to actual units like PSI.
The Gain / Offset Calculator was designed in order to help the application developer calculate values for Gain
and Offset.


Calculations:
LowBits = (Low End Value / Scaling Factor)
HighBits = (High End Value / Scaling Factor)
Note: The Scaling Factor is dependent on the Input chosen
Gain = (High End Engineering Units - Low End Engineering Units) / (HighBits - LowBits)
Offset = (High End Engineering Units - Low End Engineering Units) - (HighBits * Gain)



Analog Input Sample Code

3.12

Universal Inputs

There are two Universal Inputs available on
the DVC5 and three Universal Inputs on the
DVC7/10, consult your hardware manual for
features available on individual modules.
These inputs are programmable to accept
the most common sensor outputs. On the
DVC5/10 each Universal input also has a
Reference output pin that can supply a
voltage to a circuit like a potentiometer. The
DVC7 provides a single common regulated
reference output for all Analog and
Universal input circuits with a 500ma current load limit.

New with the 4.7 release each Universal input can be configured as a digital input by selecting the Active High
or Active Low button in the lower right hand corner of the configuration window. When one of these is selected
the Uni_1 name will be set to true when the voltage input exceeds 2.5 volts for Active High and false for Active
Low.

Three types of inputs are supported and are selectable for each of the inputs. They are Analog input (Voltage) /
Current, RPM Pulse Input and Counter Mode input types. A fourth type of input is Quadrature and using this
requires two Universal inputs to be used. On the DVC7/10 these are inputs 2 and 3 and on the DVC5 these are
inputs 1 and 2. Quadrature is a method of determining speed direction using two pulse inputs.

On the DVC10 each universal input can have one of four ranges namely: –1 to +1volts, 0 to +5volts, 0 to
+10volts or 0ma to 22ma. On the DVC7 each universal input can have one of two ranges namely: 0 to +5volts or

Code Comments
If (Ana_1 > 5%) Then

If Input % is greater than 5%

PWM_1 = Ana_1

Sets an PWM% output to the Analog Input %

PWM_1.Dir = Ana_1.Dir

Set direction of a dual coil based on input (if centered enabled)

If (Ana_1.MaxF) then

Test if Maximum Volts threshold reached

If (Ana_1.MaxRF) then

Test if Reference Maximum volts threshold reached

Ana_1.MaxRF = 0

Clear /Reset condition or flag (retry)

Advertising
This manual is related to the following products: