Automate_DAC(2)
This function is used automatically update the DAC output voltage. This function only need be
called once. After this function is called, the DAC output it will run continuously. Note that in
this function, the output variable must be a variable.
Parameters
DAC# Identifies which DAC channel is to be read
• can be DAC1 or DAC2
Variable The variable that hold the desired output voltage
• The scale is 0-32767 = 0.0 to 10.0 volts.
Returns
0 – Setup did not execute.
1 – Setup successful.
Error Codes
Bad_ID = an incorrect DAC ID was used.
PT_Range = the Variable used is not acceptable
Examples
User1 = 0
Automate_DAC (DAC1, User1)
Loop: User1 = User1 +1 ;This will create a 0 to 10 volt ramp wave on DAC1
If User1 = 32767
{
User1 = 0
}
; add some delay or code here
Goto Loop
1310 Vehicle Control System Users Manual Release Rev B Page 31 of 51