Link Type: |
EQ (hex 0x10, dec 16) - Equals |
Link Value: |
Value to compare against (unused by MathOK and MathERR) |
Range: |
-32,768 to 32,767 for EQ, NEQ, LES, LTS, GTS, GES |
Note: These link types are available only in firmware version 20011113 and later.
This family of link types is used to analyze the results of the RMC's three math commands: Add (+), Subtract (-), and MulDiv ('). These link types evaluate the results of the last math command that was issued on the axis running the event sequence. Therefore, these link types can be used any time after the math command is issued (including on the same step) up until another math command is issued on that axis.
All of these link types are non-blocking. That is, if the condition they check for is true, then they jump to the step referenced by the Link Next field. However, if the condition they check for is false, then they jump to the next step.
These link types can be divided into three groups:
Detecting Math Overflows
The MathERR (0x13) and MathOK (0x12) link types jump to the Link Next step if there was or was not respectively an overflow in the last math command. Refer to each of the math commands for details on when overflows will occur.
Detecting Equality
The EQ (0x10) and NEQ (0x11) link types are used to compare the results of the last math command with the Link Value. The Link Value will be displayed in RMCWin as a signed 16-bit value. However, because the sixteen bits either match between the result and the Link Value or they do not, these link types can be used to compare with unsigned or position values, although the Link Value may be displayed incorrectly in RMCWin.
Detecting Less Than or Greater Than
To determine if one value is greater or less than another, one of twelve link types should be used. There are four comparison types (>, <, ³, and £) for each of three ranges (signed, unsigned, and position). The range refers to how the 16-bit result from the last math command and the 16-bit Link Value are interpreted:
For the signed compares, each is treated as a signed 16-bit number with a range of -32,768 to 32,767. Use LTS, LES, GES, and GTS for signed compares.
For unsigned compares, each is treated as an unsigned 16-bit number with a range of 0 to 65,535. Use LTU, LEU, GEU, and GTU for unsigned compares.
For position compares, each is treated as having the same range as an axis's position unit range. The axis whose position range will be used is selected with bits 4-6 of the MODE word on the link type's step. These are the same bits used to select the axis for the math commands themselves. Use LTP, LEP, GEP, and GTP for position compares.
If there is any chance of an overflow in the math operation, then you must first use a MathERR or MathOK link type to handle the case where there was an overflow, and then do any compares you want to do with the value. Comparing an overflowed value will likely give incorrect or unexpected results.
Note: The Link Value is always treated as a constant when used in a comparison. However, you are not limited to comparing with a constant. You can use math commands to compute a value or copy a register into the Link Value field of the step that has the comparison link type.
Using with the Link Type and Link Value Dialog Box
Under Link Type Category, select System-wide (Basic, non-axis).
Under Link Type, select Math Compares/Errors.
Under Link Condition, select whether you want to jump on a successful math operation, an overflow, or on a comparison.
If you selected to jump on a comparison, then select the comparison type (=, <, >, etc.) and enter the value to compare with.
If you selected a relational comparison (any comparison other than equal or not equal), then select the type of the result and compare values (signed, unsigned, or position units).
If you selected a relational comparison for position values, then select the axis whose position unit range you want to use.
Note: This axis is encoded in bits 4-6 of the step's Mode word. Therefore, changing this value will change the Mode for the event step. Ensure that this is acceptable for the command on that event step. If it is not, then you will need to move the link type to another step.
Using without the Link Type and Link Value Dialog Box
In the Link Type field, enter one of the link types listed at the top of this topic. You must enter it in hexadecimal.
For the MathERR and MathOK link types, enter 0 for the Link Value. Otherwise, enter the value you want to compare with.
Copyright (c) 1997-2015 by Delta Computer Systems, Inc.