Specifications
Curtis 1310 Manual, Rev. B
31
1 6 F E B R U A R Y 2 0 0 8 D R A F T
5 — VCL
Analog outputs
Put_DAC(2)
This function outputs an analog voltage on the selected DAC (Digital to Analog
Converter) channel. A constant or a variable may be used as the output value.
Parameters
DAC# Identifies which DAC channel is to be read (DAC1 or DAC2).
Value The digital value of the output voltage;
the scale is 0–32767 = 0.0–10.0 volts.
Returns
0 – New value did not go out.
1 – New value output on DAC.
Error Codes Bad_ID Incorrect DAC ID was used.
Auto_Run Trying to access an automated DAC is not allowed.
Examples Put_DAC(DAC1,16383) ;Output 5V on DAC 1 signal
or
User1=16383
Put_PWM(PWM1,User1)
;a 50% pulse wave is output on Analog Output 1
Automate_DAC(2)
This function is used to automatically update the DAC output voltage. This function
only needs to be called once. After this function is called, the DAC output will run
continuously. Note that in this function, the output value must be a variable
.
Parameters
DAC# Identifies which DAC channel is to be read (DAC1 or DAC2).
Variable The variable that holds the desired output voltage;
the scale is 0–32767 = 0.0–10.0 volts.
Returns
0 – Setup did not execute.
1 – Setup successful.
Error Codes Bad_ID Incorrect DAC ID was used.
PT_Range The variable used is not acceptable.
Example User1=0
Automate_DAC(DAC1,User1)
Loop:
User1=User1+1
;this will create a 0–10V ramp wave on DAC1
If User1=32767
{
User1=0
}
;add some delay or code here
Goto Loop
☞










