Curtis 1232E/34E/36E/38E & 1232SE/34SE/36SE Manual, os 30
133
24 NOVEMBER 2015
8 — VCL
AUTOMATE_FREQUENCY_OUTPUT()
This function sets up the PD Driver (pin 2) PWM output to yield a frequency
proportional to the input variable at an execution rate of 16 ms. This output can be
used to drive an electronic speedometer or tachometer.
An additional VCL variable called Frequency_Output_Duty_Cycle works in
conjunction with the Automate_Frequency_Output() function to modify the duty
cycle of the output. The default value of Frequency_Output_Duty_Cycle is 50% (or
16384).
Syntax Automate_Frequency_Output()
Parameters
@Source Index of source value to be the input.
MinInput Holds the minimum value for the input.
MaxInput Holds the maximum value for the input.
MinOutput HoldstheminimumvaluefortheoutputinHz.
MaxOutput HoldsthemaximumvaluefortheoutputinHz.
Note: Thefrequencyrangeis0–4000Hz,with4Hzbeing
theminimumactivefrequency,and0–3Hz=Off.
Returns
0 – PWM not automated.
1 – PWM automated.
Error Codes
Param_Range is returned when a parameter is out of range.
PT_Range is returned when the Parameter Table Index is out of range.
Example
TosetupthePDDrivertooutput500–1500Hz(atdutycycle=25%)formotor
speed in the range 100–4000 rpm:
Frequency_Output_Duty_Cycle = 8192 ;set duty cycle = 25%
Automate_Frequency_Output(@ABS_Motor_Speed,100,4000,500,1500)