flex_set_inhibit_output_momo

NI-Motion Functions

flex_set_inhibit_output_momo

Device Compatibility

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

Set Inhibit Output MOMO

Usage

status = flex_set_inhibit_output_momo(u8 boardID, u16 mustOn, u16 mustOff);

Purpose

Sets the inhibit outputs using the MustOn/MustOff protocol.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
mustOn u16 bitmap of inhibit outputs to force on
mustOff u16 bitmap of inhibit outputs to force off

Parameter Discussion

mustOn is the bitmap of inhibit outputs to force on:

D8 D7 D6 D5 D4 D3 D2 D1 D0
mustOn 8  mustOn 7  mustOn 6  mustOn 5  mustOn 4  mustOn 3  mustOn 2  mustOn 1  0

For D1 through D8:
   1 = Inhibit output forced On
   0 = Inhibit output unchanged (default)

mustOff is the bitmap of inhibit outputs to force off:

D8 D7 D6 D5 D4 D3 D2 D1 D0
mustOff 8  mustOff 7  mustOff 6  mustOff 5  mustOff 4  mustOff 3  mustOff 2  mustOff 1  0

For D1 through D8:
   1 = Inhibit output forced Off
   0 = Inhibit output unchanged (default)

Using This Function

This function controls disabled inhibit outputs being used as general-purpose outputs. You can directly set the inhibit outputs to a logical On or Off state.

Note  This function has no effect on enabled inhibit outputs. These outputs are directly controlled by their corresponding axes.

Using the MustOn/MustOff protocol allows you to set or reset individual inhibit outputs without affecting the other inhibit outputs. This gives you tri-state control over each output: On, Off, or Unchanged. A one (1) in a bit location of the MustOn bitmap turns the inhibit On, while a one (1) in the corresponding location of the MustOff bitmap turns the inhibit Off. A zero (0) in either bitmap has no affect, so leaving both the MustOn and MustOff bits at zero is effectively a hold, and the state of the inhibit output is unchanged. If you set both the MustOn and MustOff bits to one (1), it is interpreted as a MustOn condition and the inhibit is turned On.

      Must On –>
Must Off
   1 0
1 On Off
0 On Unchanged
Note  This function sets the logical state of an inhibit output On or Off (True or False). The polarity of the inhibit outputs determine if an On state is active high or active low. Refer to the Configure Inhibit Outputs function for more information.

The Set Inhibit MOMO function allows individual control of the inhibit outputs without requiring a shadow value to remember the state of other outputs not being set or reset with the function.

Example

To turn inhibit output 1 On, output 4 off, and leave the other inhibit outputs unchanged, call the Set Inhibit MOMO function with the following parameters:

mustOn = 0x02, which corresponds to the following bitmap:

D8 D7 D6 D5 D4 D3 D2 D1 D0
mustOn  8  mustOn  7  mustOn  6  mustOn  5  mustOn  4  mustOn  3  mustOn  2  mustOn  1  0
0 0 0 0 0 0 0 1 0

mustOff = 0x10, which corresponds to the following bitmap:

D8 D7 D6 D5 D4 D3 D2 D1 D0
mustOff  8  mustOff  7  mustOff  6  mustOff  5  mustOff  4  mustOff  3  mustOff  2  mustOff  1  0
0 0 0 0 1 0 0 0 0