Jump to Label on ConditionInserts a conditional jump in a program.
| Device Compatibility
|
Must Off (False)
is the bitmap of bits that must be False to satisfy the condition:
|
|||||||||||||||||||||||||||||||||||||||||||||||
Must On (False)
is the bitmap of bits that must be True to satisfy the condition:
|
|||||||||||||||||||||||||||||||||||||||||||||||
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:
|
|||||||||||||||||||||||||||||||||||||||||||||||
Condition Code (True)
is the qualifying condition for the jump, as follows:
|
|||||||||||||||||||||||||||||||||||||||||||||||
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.
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.
|
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).