Evaluate

Executes In-Sight functions, as well as inserting formulas into the spreadsheet. Evaluate executes commands for retrieving information from, and making changes to, vision systems.

Note:
  • In-Sight functions that return a data structure cannot be executed using the Evaluate command. However, these functions can be inserted into the In-Sight spreadsheet. For more information, see Structures Functions.
  • Changes made to the In-Sight system settings using the Evaluate command are temporary. Rebooting the vision system will discard any changes. To save settings to the proc.set file, use the Store Settings command. For more information, see Store Settings.

Evaluate Inputs

Syntax: EV [command]

Parameter Description

Command

Any supported In-Sight function, or a legal string of functions, as well as general commands.

Note: Any inputs that are enclosed in quotation marks must be enclosed by quotes when sent to the vision system.

Evaluate Outputs

Note: The results of the expression are dependent on the command that is executed.
  • A status code, followed by the number of characters (in bytes) for the results, then the results in XML format.

    Status Codes Description
    1 The command was executed successfully.
    0 Unrecognized command.
    -1 The cell ID is invalid.
    -2 The command could not be executed.
    -4 The vision system is out of memory.
    -6 User does not have Full Access to execute the command. For more information, see User Access Settings Dialog.
  • The number of characters (in bytes) contained within the output that follows.
  • The results of the expression in XML format (only shown if the status code is 1).

    Note: The results of the expression are dependent on the command that is executed.

Example: Remotely Place a Formula into a Spreadsheet Cell

The general syntax to remotely place an In-Sight formula into a spreadsheet cell using the Evaluate command is as follows:

Syntax: EV [Column][Row] [Cell state] [Formula]

Parameter Description

Column

The column letter of the cell value to set (A to Z).

Row

The row number of the cell value to set (0 to 399).

Cell state

The current state for the specified cell (0 = Disabled; 1 = Enabled). For more information, see Cell State Dialog.

Note:
  • Cell state can also reference (absolute or relative) another cell. If the referenced cell is empty, the cell state will be 0.
  • If a Controls Function, containing a text label, is inserted into the spreadsheet with the cell state specified as disabled, the GUI will only show the graphic associated with the control. The text label remains hidden in the spreadsheet until the cell state is modified within the spreadsheet. For more information, see Controls Functions.

Formula

A combination of values, functions, arguments, and operators used to create a formula.

Example: Remotely Insert Basic Functions

  1. Assume the spreadsheet is configured as follows:

    A3 = 3
    A4 = 4
    A5 = 5
    A6 = 6

    Formulas can be inserted into the In-Sight spreadsheet using a remote connection.

  2. While logged on to the vision system through a telnet client, type the following command: EV A8 1 Sum(1,2,A3:A6)

    The In-Sight responds with a status code (1) followed by the number of bytes (0) of XML data returned. This evaluate command inserts the formula Sum(1,2,A3:A6) into Cell A8.

    Note: The actual result returned by the Sum spreadsheet function, 21, is not returned by this Evaluate command as XML data; use the Get Value command to retrieve this result instead.

Example: Remotely Insert Functions with Property Sheets

Functions that contain parameters selected from a property sheet can also be remotely inserted into the spreadsheet. From the telnet client, type the following command: EV A2 1 ExtractBlobs($A$0,0,0,0,40,276,381,450,0,0,8,-1,0,0,2,1,100,100000,0)

As shown in the following image, the vision system responds with a status code (1) and the size (0) of XML data returned:

The ExtractBlobs function has successfully been inserted into cell A2 of the spreadsheet:

Example: Retrieve Information from the Vision System Using the Evaluate Command and In-Sight Functions

Syntax: EV [command]

  1. Assume that an In-Sight spreadsheet contains an IDMax data structure in cell A2 that was obtained from a ReadIDMax function. The decoded string is returned in the adjacent cell, as follows:

    A2 = ReadIDMax($A$0,0,0,0,308.750,445,67.500,73.750,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,7,0,0,0,2,0,0,0,1,0,0,2)

  2. Using a telnet client, log on to the vision system and type EV GetString(A2) as follows:

    The vision system returns a status code of 1, indicating that the command was executed successfully. The next line reports that 25 bytes of XML data were returned, while the final line consists of the results of the expression, formatted in XML.

Example: Retrieve In-Sight Network Settings Using the Evaluate Command

While logged on to a vision system from a telnet client, type EV GetNetwork() to retrieve the system network settings. The telnet client output is shown in the following image:

The vision system responds with a status code of 1 to indicate that the command was executed successfully. The next line contains the size (554 bytes) of the XML data to follow; the remaining lines consist of the actual XML data that was returned.

Example: Change In-Sight Settings Using the Evaluate Command

This example sets the Idle Timeout, Read Timeout, Connection Retry, Local Port, Remote Port, and Passive Transfers FTP settings on an In-Sight 8402 vision system. While logged on to the vision system from a telnet client, issue the following command: EV SetFTPSettings(120,120,1,21,21,0)

The telnet client output is shown in the following image:

The vision system responds with a status code of 1, indicating that the command successfully executed. Next, 18 represents the number of XML output bytes to follow. Finally, the actual XML data is shown.