flex_load_camming_parameter

NI-Motion Functions

flex_load_camming_parameter

Device Compatibility

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

Load Camming Parameter

Usage

i32 status = flex_load_camming_parameter(i32 boardID, i32 axisID, TnimcCammingParameter attribute, NIMC_DATA* data);

Purpose

Loads other camming parameters, such as master axis position offset and slave axis position offset.

Parameters

NameTypeDescription
boardID i32 assigned by Measurement & Automation Explorer (MAX)
axisID i32 axis to configure
attribute TnimcCammingParameter attribute to configure
data NIMC_DATA* value to load for the specified attribute

Parameter Discussion

axisID is the axis to configure. Valid values are NIMC_AXIS1 through NIMC_AXIS30. On motion controllers that support fewer than thirty axes, configuring non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes for axis resource IDs.

attribute is one of the following camming parameters:

attribute Number
TnimcCammingParameterMasterCycle 0
TnimcCammingParameterMasterOffset 1
TnimcCammingParameterSlaveOffset 2

data is the value to set for the specified attribute. Use the doubleData element of the following structure to set the attribute value:

struct{
   i32 longData;
   u8 boolData;
   f64 doubleData;
} NIMC_DATA;

Use one of the following steps to load the appropriate value:

  • TnimcCammingParameterMasterCycle—Set the doubleData element of the NIMC_DATA structure to the master cycle in user units.
  • TnimcCammingParameterMasterOffset—Set doubleData element of the NIMC_DATA structure to the master offset in user units.
  • TnimcCammingParameterSlaveOffset—Set doubleData element of the NIMC_DATA structure to the slave offset in user units.

Using This Function

Use this function to configure various parameters of the camming operation:

  • Master Cycle defines when the camming operation is going to repeat based on the master position. You can configure the master cycle at the same time you configure the camming master using the Configure Camming Master function.
    Note  You cannot change the master cycle after camming is enabled.
  • Master Offset is applied to the master position when camming is enabled. This attribute shifts the position modulus to compensate for the fact that the camming cycle may not start at 0. For example, if you have a master cycle of 4000 and a master offset of 0, the camming operation repeats at ..., -8,000, -4,000, 0, 4,000, 8,000, ... If you change the master offset to 1000, the camming operation repeats at ..., -7,000, -3,000, 1,000, 5,000, 9,000, ....

    The default value for the master offset is 0, and the valid range of values for the master offset is 0 to (Master Cycle – 1).
    Tip  The master offset is applied only when camming is started or enabled.
  • Slave Offset is applied when the camming cycle begins. This offset is used to adjust the camming profile when the beginning and ending positions for the slave axis are not the same. You can change the slave offset at anytime, but the change takes effect on the next camming cycle.

    The default value is 0.

Refer to the Camming section of the NI-Motion Help for more information about camming operations.