nimcReadMotionIOData

NI-Motion Functions

nimcReadMotionIOData

Device Compatibility

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

Read Motion I/O Data

Usage

status = nimcReadMotionIOData(TnimcDeviceHandle deviceHandle, TnimcAxisHandle axisHandle, TnimcMotionIOData attribute, TnimcData* data);

Purpose

Reads status and data from the motion inputs and outputs.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
deviceHandle TnimcDeviceHandle assigned by Measurement & Automation Explorer (MAX)
axisHandle TnimcAxisHandle axis to read
attribute TnimcMotionIOData attribute to read
data TnimcData* the value for the attribute you are reading

Parameter Discussion

axisHandle is the axis to read data from. Valid values are 1 through 30. On motion controllers that support fewer than thirty axes, reading non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError).

attribute is the attribute to read. The following are valid attributes:

  • TnimcMotionIODataForwardLimitActive
  • TnimcMotionIODataReverseLimitActive
  • TnimcMotionIODataForwardSoftwareLimitActive
  • TnimcMotionIODataReverseSoftwareLimitActive
  • TnimcMotionIODataHomeInputActive
  • TnimcMotionIODataInhibitInActive
  • TnimcMotionIODataInPositionActive
  • TnimcMotionIODataDriveReadyActive
  • TnimcMotionIODataInhibitOutActive

data is the value for the attribute you are reading in the following structure:

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

Based on the attribute, the correct member of TnimcData will be returned by the motion controller. The values of the other elements in the structure are undefined.

Read boolData in the TnimcData structure to poll the status of the limit, home, inhibit-in, in-position, and drive ready inputs, and the status of the inhibit-out output. TnimcTrue indicates that the signal is active and TnimcFalse indicates that the signal is inactive.

Using This Function

Use this function to read the status and data from the motion inputs and outputs on the motion controller. You can read the status of these motion inputs and outputs at any time, regardless of whether they are enabled. The limit and home input status during a Find Reference move is undefined. Refer to Write Motion I/O Data for more information.

Caution  If this function uses reflective memory, it should not be used for event checking. In this case, only use the information returned by this function for display purposes. Refer to Reflective Memory Functions for more information.
Note  The active state of the signals determines if an On state is active high/active closed or active low/active open. Refer to Write Motion I/O Data for more information about active state and general information about the signals.
Note  Refer to Function Execution Times for benchmark timing information about your controller.

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this function with a 73xx controller:

  • The minimum pulse width for the inhibit-in input to be detected is approximately 1 ms.
  • On the NI PCI-7390 controller, the TnimcMotionIODataInhibitInActive attribute does not return a valid value unless the inhibit-in signal is enabled.
  • On the NI PCI-7390 controller, the TnimcMotionIODataInPositionActive attribute does not return a valid value unless the in-position signal is enabled.

NI SoftMotion Controller Considerations

The following includes considerations you must make when you are using this function with the NI SoftMotion Controller:

The NI SoftMotion Controller does not support the TnimcMotionIODataInPositionActive, TnimcMotionIODataDriveReadyActive, and TnimcMotionIODataInhibitOutActive attributes.