flex_setu32

NI-Motion Functions

flex_setu32

Device Compatibility

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

Set u32

Usage

status = flex_setu32(u8 boardID, u8 resource, u16 attr, u32 value);

Purpose

Sets the general software settings.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
resource u8 resource selector
attr u16 type of information you want to set
value u32 new value to which attribute is set

Parameter Discussion

resource is the resource that the attribute you selected is set to.

attribute is the selector for the type of data you want to set. Legal values are defined as constants in the NI-Motion header files MotnCnst.h (for C/C++ users) and motncnst.bas (for Visual Basic users) and are listed in the following section.

value is the new value to which the data you selected is set.

Using This Function

The Set u32 function sets selected software settings as specified by attribute. This function can set values that are stored as integers.

The following table includes the attributes you can set, their descriptions, possible values, and the devices they work on.

Attribute  Resource  Constant  Description  Values
NIMC_BP_
WINDOW
Axis or encoder 0x0200 After the axis encounters a breakpoint, the axis must move outside the breakpoint window before it can rearm for another breakpoint. This is used to prevent oscillation from sending multiple breakpoint outputs from the same breakpoint position. The default is 0.
Note Note  The breakpoint window must be smaller than the breakpoint modulus or period. A modal error is generated when the breakpoint window is larger than the loaded breakpoint modulus or period.
0 to 255
NIMC_PULL_IN_
WINDOW
Axis 0x0400 For closed-loop stepper axes, an area around the target position that determines whether or not to do any more pull-in moves. Once within the area, the motion controller stops doing pull-in tries. The default is 1. 0 to 32,767
NIMC_PULL_IN_
TRIES
Axis 0x0401 The maximum number of times the closed-loop stepper axis tries to reach the target position. It will try until it is within the range specified by NIMC_PULL_IN_WINDOW or until it reaches this maximum. The default is 3. 0 to 32,767
NIMC_STOP_TYPE_
ON_SWITCH
Axis 0x0403 Changes the behavior of the stop that is performed when a limit switch or home switch is encountered. This setting applies to all axes.
Caution  When selecting a value other than NIMC_HALT_STOP, make sure that there is enough space between the limit switch and the physical end of travel for the axis to decelerate. Failure to do so could cause physical damage to the system.
The following attributes are available:
  • NIMC_DECEL_STOP (0)—the axis decelerates smoothly to a stop
  • NIMC_HALT_STOP (1)—(default) the axis performs an immediate, full torque/stop (halt stop)
  • NIMC_KILL_STOP (2)—zeroes the command and activates the inhibit/output
0 to 2
NIMC_STEP_
DUTY_CYCLE
Axis 0x0600 Duty cycle of the step output. This function sets the duty cycle to either 25% or 50%. 25 or 50
NIMC_DECEL_
STOP_JERK
Axis 0x0500 When this attribute is set to 1, jerk is turned off when any of the following stop conditions are met:
  • calling Stop Motion with NIMC_DECEL_STOP as the stopType
  • encountering a software limit
  • encountering a hardware limit or home switch with the Set u32 attribute NIMC_STOP_TYPE_ON_SWITCH set to NIMC_DECEL_STOP (0)
The default value of 0 means that the deceleration uses the s-curve time value defined in Load S-Curve Time.
0 or 1