flex_read_dac_rtn

NI-Motion Functions

flex_read_dac_rtn

Device Compatibility

Device Compatibility
7330
N
7340
Y
7344
Y
7350
Y
7390
N
NI SoftMotion Controller for CANopen—Xenus
Y
NI SoftMotion Controller for CANopen—Accelnet
Y

Read DAC

Usage

status = flex_read_dac_rtn(u8 boardID, u8 axisOrDAC, i16* DACValue);

Purpose

Reads the commanded DAC output value for an axis.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrDAC u8 axis or DAC to read
DACValue i16* commanded DAC output value

Parameter Discussion

axisOrDAC is the axis or DAC to read. Valid axis or DAC resources are NIMC_AXIS1 through NIMC_AXIS30 and NIMC_DAC1 through NIMC_DAC30. On motion controllers that support fewer than thirty axes, reading non-existent axes or DACs returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and DAC Outputs for axis and DAC resource IDs.

DACValue is the 16-bit commanded DAC output value from the PID loop, where +32,767 corresponds to +10 V output and –32,768 corresponds to –10 V output.

Using This Function

This function returns the value of the specified DAC output. When sent to an axis, this function returns the value of the primary DAC mapped to that axis. The signed 16-bit value returned corresponds to the ±10 V full scale range of the DAC.

This function is used to monitor the output command from the PID loop. When the DAC output is connected to a torque block servo amplifier, you can use this value to calculate motor torque or to monitor the acceleration and deceleration portions of a trajectory to see how close the control loop is to saturating at its maximum torque limits.

When the DAC output is connected to a velocity block servo amplifier, the DAC value read is a direct representation of the instantaneous commanded velocity.