Jump to Label on Condition

NI-Motion VI

Jump to Label on Condition

Inserts a conditional jump in a program.

Details

Device Compatibility

DeviceCompatibility
7330
N
7340
Y
7344
Y
7350
Y
7390
N
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Must Off (False) is the bitmap of bits that must be False to satisfy the condition:
Must On 0—If true, bit must be false. If false, do not care (default).
Must On 1—If true, bit must be false. If false, do not care (default).
Must On 2—If true, bit must be false. If false, do not care (default).
Must On 3—If true, bit must be false. If false, do not care (default).
Must On 4—If true, bit must be false. If false, do not care (default).
Must On 5—If true, bit must be false. If false, do not care (default).
Must On 6—If true, bit must be false. If false, do not care (default).
Must On 7—If true, bit must be false. If false, do not care (default).
Must On 8—If true, bit must be false. If false, do not care (default).
Must On (False) is the bitmap of bits that must be True to satisfy the condition:
Must On 0—If true, bit must be true. If false, do not care (default).
Must On 1—If true, bit must be true. If false, do not care (default).
Must On 2—If true, bit must be true. If false, do not care (default).
Must On 3—If true, bit must be true. If false, do not care (default).
Must On 4—If true, bit must be true. If false, do not care (default).
Must On 5—If true, bit must be true. If false, do not care (default).
Must On 6—If true, bit must be true. If false, do not care (default).
Must On 7—If true, bit must be true. If false, do not care (default).
Must On 8—If true, bit must be true. If false, do not care (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.
Resource (0) is the axis control or other resource involved in the condition.
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.
Condition Code (True) is the qualifying condition for the jump, as follows:

Value Definition
0 Less Than
1 Equal
2 Less Than Or Equal
3 Greater Than
4 Not Equal
5 Greater Than Or Equal
6 True
7 Home Found
8 Index Found
9 High Speed Capture 0 (axes) or 0x20 (encoders)
10 Position Breakpoint 0 (axes) or 0x20 (encoders)
11 Reserved
12 Velocity Threshold
13 Move Complete
14 Profile Complete
15 Blend Complete 0 (axes)
16 Motor Off
17 Home Input Active
18 Limit Input Active
19 Software Limit Active
20 Program Complete (program)
21 IO Port Match I/O port 1–8
Jump to Label (1) is the arbitrary label number to jump to. Valid label numbers are from 1 to 65,535.
Match Type (All) selects the type of match required for the bitmap, as follows.

Value  Definition
0 All
1 Any

Match Any means that a match of any bit (logical OR) is sufficient to satisfy the condition while Match All requires a complete pattern match (logical AND) of all bits.

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.
Condition Resource Out is the Axis, Vector Space, ADC, or Encoder you wired into the VI. Use Condition Resource Out to pass the device to another VI and/or to display information about the device.
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 Jump to Label on Condition VI controls the flow of execution in a stored program by defining a conditional jump to any label within the program. In addition to condition codes set as the result of a previous data operations VI, you can test virtually any instantaneous status of axes or resources to decide whether to jump or not.

There are two distinct groups of conditions. The first group, conditions 0 through 5, test the result of the most recent logical, mathematical, or data transfer operations VI. Refer to the Data Operations VIs for more information about mathematical or data transfer operations. These condition codes test whether the result of the latest logical, mathematical, or data transfer VI is less than zero, equal to zero, less than or equal to zero, greater than zero, not equal to zero, or greater than or equal to zero. For these conditions, the Resource, Must On, Must Off, and Match Type parameters are not required and their values are ignored.

Note  You can program unconditional jumps by setting the condition to True (6).

The second group, conditions 7 and above, test a specific multi-axis, multi-encoder, program, motion I/O, or general-purpose I/O status. Where applicable, you can select the appropriate resource with the resource parameter.

Program Complete is similar to the first condition group in that Must On, Must Off, and Match Type parameters are not required and their values are ignored. You set resource equal to the appropriate program number to test. The balance of the conditions in this group test status bitmaps and VIs similar to each other as described in the remainder of this section.

The Must On, Must Off, and Match Type parameters work together to define a bitmap of True and False bits that must be matched to satisfy the condition. The Match Type parameter allows you to select between an OR match, where any matching bit is sufficient, and an AND match, where all status bits must match the True/False bitmap defined by Must On and Must Off.

Using the Must On/Must Off protocol gives you tri-state control over each match bit: True, False, or Don't care. A True in a bit location of the Must On bitmap sets the match bit to True, while a True in the corresponding location of the Must Off bitmap resets the match bit to False. A False in either bitmap has no affect, so leaving both the Must On and Must Off bits at False defines the bit as do not care. If you set both the Must On and Must Off bits to True, it is interpreted as a Must On condition and the match bit is set to True.

The Limit Input Active and Software Limit Active conditions create a combined status bitmap where if either the forward or reverse limit is active, the bit is True.

Example

To perform a conditional jump to label 99 if either axis 3 is move complete or axis 4 is still moving (move not complete), call the Jump to Label on Condition VI with the following parameters:

Condition = Move Complete (13)
Must On corresponds to the following bitmap

Must On 0  Must On 1  Must On 2  Must On 3  Must On 4  Must On 5  Must On 6  Must On 7  Must On 8 
False  False  False  True  False  False  False  False False

Must Off corresponds to the following bitmap

Must Off 0  Must Off 1  Must Off 2  Must Off 3  Must Off 4  Must Off 5  Must Off 6  Must Off 7  Must Off 8 
False  False  False  False True False  False  False False

Match Type = Any (1)
Jump to Label = 99

In this example, the move complete status of the other axes are do not care and the Match Type is set to match either axis 3 move complete (On) or axis 4 move not complete (Off).