ReadResult

Imports values from the cells of one In-Sight vision system (the sender) to a separate vision system (the receiver.) Several ReadResult functions can be used to import results from multiple In-Sight slave vision systems into a single spreadsheet on the receiving vision system.

Note:
  • Both the sending and receiving In-Sight vision systems must be Online.
  • When using the WriteResult and ReadResult functions, it is strongly recommended that the In-Sight vision system using the ReadResult function be configured as a network trigger Master, and that the vision system(s) using WriteResult be configured as network trigger Slaves. This allows the results to be synchronized so the Master will read the results generated by the Slave(s) in response to the current trigger. For more information, see WriteResult and AcquireImage.

ReadResult Inputs

Syntax: ReadResult(Acquire Image,Host Name,Timeout)

Parameter Description

Acquire Image

A reference to the default Image data structure in cell A0, which specifies the source of the acquisition trigger.

Host Name

Specifies the network name of the In-Sight vision system that will send results. The spreadsheet of the In-Sight sender must contain a WriteResult function that references cells containing the values to send to the receiver.

Note:
  • If the spreadsheet on the In-Sight "receiver" vision system contains multiple ReadResult functions, each function must reference the Host Name of a different In-Sight sender. In other words, only one receiver vision system can read data from a WriteResult cell on a sender vision system.
  • If an invalid Host Name is specified, the connection may take up to 30 seconds to timeout.

Timeout

The number of milliseconds to wait for the In-Sight sender vision system to write its results out to the In-Sight receiver, including the acquisition time. (0 to 120000; 0 does not timeout)

ReadResult Outputs

Returns

A Result data structure containing the values imported from the specified In-Sight sender. Returns #ERR if any of the input parameters are invalid; if there is a network error; or if the results are not received within the specified Timeout period.

Results

When the ReadResult function is initially inserted into a cell, a table containing the first four results imported from the In-Sight sender vision system will be automatically created in the spreadsheet.

The function automatically inserted into the spreadsheet to create the result table is:

GetResult(Result, Index)

Returns the indexed value from the Result data structure. The values are indexed according to the order of cell references in the WriteResult function on the In-Sight sender.

Note: ReadResult automatically returns 4 entries in the result table, corresponding to the first 4 results imported from the In-Sight sender and contained in the Result data structure. The table can be expanded to return additional results by copying cells from the table and pasting them into empty cells, then incrementing the Index value for each additional result to return.

ReadResult Example

Assume two In-Sight vision systems, Sender and Receiver, are connected to a network. A job is configured on each vision system as follows:

Sender:

A0 = AcquireImage with the Trigger set to Manual

A1 = 'Number of Acquisitions:

A2 = 'Number of Acquisitions x 2:

A3 = Timer("00:00:05",32)

A4 = WriteResult($A$0,$D$1,$D$2)

D1 = Count($A$0,9999999,0,0)

D2 = D1*2

  • The AcquireImage cell (A0) is configured for a trigger.
  • The Timer function in cell A3 initiates a manual trigger every 5 seconds.
  • Cell D1 contains a Count function to accumulate the number of acquisitions, while D2 multiplies the number of acquisitions by two.
  • Finally, the WriteResult function in cell A4 makes the acquisition data available for the Receiver vision system.

Receiver:

A0 = AcquireImage with the Trigger set to Continuous

A1 = 'Number of Acquisitions:

A2 = 'Number of Acquisitions x 2:

A4 = ReadResult($A$0,"Sender Host Name",0)

B4 = GetResult($A$4,0)

C4 = GetResult($A$4,1)

D1 = GetResult($A$4,0)

D2 = GetResult($A$4,1)

D4 = GetResult($A$4,2)

E4 = GetResult($A$4,3)

  • The AcquireImage cell (A0) is configured for continuous triggering.
  • The ReadResult function in cell A4 pulls data from the WriteResult function on Sender.
  • The rest of the populated cells (B4, C4, D1, D2, D4, E4) contain GetResult functions to illustrate the zero-based indexing of the Result structure in cell A4.

By placing both vision systems Online, the ReadResult and WriteResult functions can be seen in action:

  • After 35 seconds, seven (7) acquisitions have occurred.
  • The Receiver vision system stays synchronized with the values from Sender.
  • Note that cells D4 and E4 on Receiver return #ERR since the WriteResult function on Sender is only passing two values.