Component: DAC Output (Outputs: General)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 2.0 (Release)
Category Outputs: General


Image DAC Output component

CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the Digital to Analogue Converter peripheral.

Examples

Example to configure the DAC output and ramp up the output voltage to create a sawtooth waveform.

FC6 Icon.png DAC Example Sawtooth


If the Scope traces property is set to Yes then the DAC voltage will be shown on the Data Recorder window.

DAC Stream.jpg


Example to configure the DAC output and control the output voltage to create a sine waveform.

FC6 Icon.png DAC Example Sine

DAC Stream2.jpg

Downloadable macro reference

SetOutput

Sets the output voltage of the DAC

Parameters

UINT DAC_Value
The value to output to the DAC


Return value

This call does not return a value


Disable

Disables the DAC output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Enable

Enables the DAC Output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

GetValue

Gets the Name property value

Parameters

STRING Name
The name of the property


Return value

STRING


SetValue

Sets the Value for the named property

Parameters

STRING Name
Name of property to update
STRING Value
The new value for the property


Return value

This call does not return a value


GetList

No additional information


Parameters

STRING Name


Return value

STRING



Property reference

Channel

This property is of type Fixed list of ints and can be referenced with the variable name CHANNEL.

DAC Channel number

DAC Output Pin

This property is of type Single digital pin and can be referenced with the variable name PORT.

DAC Output Pin

Vref Option

This property is of type Fixed list of ints and can be referenced with the variable name VREFOP.

Selects the maximum reference value for the DAC

Vref Voltage

This property is of type Floating point and can be referenced with the variable name VrefVol.

Reference Voltage, Used to calculate the Voltage resolution.

Control Bits

This property is of type Signed integer and can be referenced with the variable name BITS.

Number of digital control bits

Resolution

This property is of type Line of text and can be referenced with the variable name Res.

Maximum output resolution based on number of control bits.

Voltage Resolution

This property is of type Floating point and can be referenced with the variable name VoltRes.

Specifies the Resolution per digital bit in terms of Voltage.

Scope Traces

This property is of type True or false and can be referenced with the variable name ScopeTraces.

Selects if the scope traces are automatically generated or not

Output Voltage

This property is of type Floating point and can be referenced with the variable name OutVolt.

Simulated output voltage from the DAC output pin, based on VREF voltage, DAC control bits

and output control value.