Enable Encoders

NI-Motion VI

Enable Encoders

Enables one or more of the unmapped encoder resources.

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Encoder Map (Disabled) is the bitmap of encoder resources to enable.
Encoder 1—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 2—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 3—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 4—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 5—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 6—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 7—If true, the encoder is enabled. If false, the encoder is disabled (default).
Encoder 8—If true, the encoder is enabled. If false, the encoder is disabled (default).
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

The Enable Encoders VI enables one or more independent encoder channels for use as general-purpose encoder inputs. It has no effect on encoders that are mapped to axes and being used for axis feedback. These feedback encoders are automatically enabled/disabled when their corresponding axis is enabled or disabled with the Enable Axes VI. Bit locations corresponding to mapped encoders are ignored, as are encoder resources that do not exist. For example, encoder resources 5 through 8 are ignored for controllers that support a maximum of four axes.

Typical uses for independent encoder inputs include velocity monitoring, masters for master-slave gearing, and digital potentiometer applications.

Example

To enable encoders 3 and 4 on the motion controller, call the Enable Encoders VI with the following Encoder Map.

Encoder 1  Encoder 2  Encoder 3 Encoder 4   Encoder 5  Encoder 6  Encoder 7  Encoder 8 
False  False  True  True   False  False  False  False 

Normally, because encoders 1, 2, 5, and 6 are set to False, they is disabled when you execute this VI. However, if encoder 2 is already being used as feedback for axis 2 and axis 1 is not being used, the disable False for Encoder 2 is ignored resulting in the following enabled encoders.

Encoder 1  Encoder 2 Encoder 3  Encoder 4   Encoder 5  Encoder 6  Encoder 7  Encoder 8 
False  True  True  True   False  False  False  False 

There is a limit on the number of enabled encoders supportable at the faster update rates. Attempting to enable too many encoders generates an error. Refer to the Enable Axes VI for more information about update rate limitations.