Math Math & Logic Tool - Expression
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Expression text box is used to construct a mathematical formula that processes tool results and data. Enter data by either using the keyboard and typing in the name of the mathematical function or job/tool data, or utilize the Vision Tools Tree, Mathematics Tree, Text Tree and/or Vision Data Access Tree on the left-hand side, and the Job and Tool Data Symbol Tree on the right-hand side, to assemble the formula. You can enter items by either double-clicking the items, or highlighting them and pressing the Insert button.
- If the Expression references a tool that has been deleted, the reference will automatically be replaced by "Job.MissingArg" in the formula. The tool will return a Fail until the reference is corrected.
- When constructing formulas, EasyBuilder does not correctly parse tool names that begin with a cell address (e.g. A3_MyTool or P10_SortTool). If expressions need to be created for those tools, rename the tool before creating the formula.
When determining if a text string matches another string, use the Exact Function. The If Function is used when comparing values; EasyBuilder returns an Error when the If Function attempts to compare strings.
Example: The text string being used by a Read ID Codes Identification Tool needs to be compared to a string being read by a Read Text Identification Tool, to ensure they match. The following formula could be constructed in the Expression: Exact(IDCode_1.String,Text_1.Result).
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Vision Tools Tree contains additional edge functions that can be used to construct your Expression. Functions can be added to the Expression by one of three methods:
- Expand the Edge tree, select the desired function and then press the Insert button.
- Expand the Edge tree, and double-click the desired function.
- Using a keyboard, type the name of the desired function directly in the text box of the Expression.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Mathematics Function Tree contains mathematical functions that can be used to construct your Expression. Functions can be added to the Expression by one of three methods:
- Expand the Mathematics tree, select the desired function and then press the Insert button.
- Expand the Mathematics tree, and double-click the desired function.
- Using a keyboard, type the name of the desired function directly in the text box of the Expression.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Text Function Tree contains functions to format alphanumeric data for display and communications, and can be used to construct your Expression. Functions can be added to the Expression by one of three methods:
- Expand the Text tree, select the desired function and then press the Insert button.
- Expand the Text tree, and double-click the desired function.
- Using a keyboard, type the name of the desired function directly in the text box of the Expression.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Vision Data Access Tree contains additional data that is not available by default that can be used to construct your Expression. Functions can be added to the Expression by one of three methods:
- Expand the Vision Data Access tree, select the desired function and then press the Insert button.
- Expand the Vision Data Access tree, and double-click the desired function.
- Using a keyboard, type the name of the desired function directly in the text box of the Expression.
- The list of functions available is contingent upon the cursor's placement in the Expression. If the cursor is located within the Expression in a location that prohibits a mathematical function from being added, those functions are unavailable until the cursor is in a location where they can be added.
- EasyBuilder only supports Blobs, Edges and Patterns Vision Data Access functions.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Job and Tool Data Symbol Tree contains the data output by Location and/or Inspection Tools, as well as Input lines and job data, such as image acquisition parameters. The job and tool data are symbolic references to the values contained within them. Symbols can be added to the Expression by one of three methods:
- Expand the tree, select the desired symbolic reference and then press the Insert button.
- Expand the tree, and double-click the desired symbolic reference.
- Using a keyboard, type the name of the desired symbolic reference directly in the text box of the Expression.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Insert button is used to place mathematical functions and symbols into the Expression. Select the desired mathematical function or symbol and then press the Insert button to add the function or symbol to the Expression.
![Closed](../../Skins/Default/Stylesheets/Images/transparent.gif)
The Open Parenthesis, Comma and Close Parenthesis buttons are used to construct mathematical formulas. Press the appropriate button to add them to your formula.