WriteImageLocal

Writes the current image to the SD card installed to the In-Sight vision system while Online. Optionally, an SVG file may be created, which includes the overlay graphics on top of the image. This function is typically used to automatically save images of failed inspections during runtime.

Note:
  • The function requires the In-Sight vision system to be Online to send images and SVG files.
  • If you are logged on to an In-Sight vision system remotely, the screen image may not be refreshed with every image acquisition when using the function.
  • If an AcquireImage function parameter is modified while the vision system is Online, the function will send the current image.

WriteImageLocal Inputs

Syntax: WriteImageLocal(Event,Image,File Name,Max Append Value,Reset,Data Format,Save Graphic Overlays,Resolution)

Parameter Description

Event

Specifies the event that forces an update.This parameter must be a reference to one of the following:
  • The Image data structure in cell A0, containing the AcquireImage function. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.
Note: When the default Event reference is deleted, the value is replaced by a checkbox. If another cell is referenced as an event, the function will conditionally run based on the referenced cell. If the checkbox is enabled, the function will always run when any inputs to the function are updated.

Image

A reference to a cell containing an Image data structure. The default reference is to the Image data structure in cell A0.

File Name

The name of the image file to write. It also defines the name of the SVG file, if the Save Graphic Overlays parameter is enabled. Long file names are supported, including a numeric counter that can be appended to the file name as each file is written (up to the specified Max Append Value).

Max Append Value

The maximum number (0 to 9999999; default = 999) of unique image files that can be written using the specified File Name. A counter will be added to the end of the specified File Name and will increment itself as each image file is written. The counter automatically resets itself when it equals the Max Append Value; existing image files on the target system will be overwritten by new files of the same name.

The number of digits in the counter will be equal to the number of digits in the Max Append Value. For example, the default Max Append Value '999' will always cause 3 digits to be added to the FileName. If 0 is specified, then no counter will be appended to the File Name.

Reset

Restarts the counter that is appended to the specified File Name for both image and SVG files. Existing image files and SVG files on the target system will be overwritten by new files of the same name.

0 = OFF (default)

The counter will continue to increment as each image is written out, up to the Max Append Value.

1 = ON

The counter will reset to 0.

Data Format

The file format of the image that will be written out to the target host.

0 = BMP (default)

Windows bitmap format (.BMP extension).

1 = JPEG

Standard encoded JPEG format (.JPG extension).

Save Graphic Overlays

Specifies whether an SVG file is created that contains overlay graphic data for supported In-Sight Vision Tools, Geometry Functions and Graphics Functions, when their Show parameter is set to display graphics. For more information, see Vision Tools Functions, Geometry Functions and Graphics Functions. The overlay graphics uses the formatting specified by the Format Cells dialog. For more information, see Format Cells Dialog.

To view the SVG file and image file, open the SVG file with a Web browser that supports the SVG file type. The SVG file contains an internal link to the acquired image associated with it, and when the browser opens the SVG file, it follows the link to open and display the acquired image along with the overlay graphics.

Note:
  • When enabled, the SVG file will use the name specified in the File Name parameter.
  • Due to the graphics being rendered by a third-party application, such as a Web browser, the overlay graphic data will not be an exact pixel-for-pixel match.
  • In-Sight firmware does not guarantee the transmission of every SVG and image file pair. If the In-Sight vision system is overloaded, it may skip the transmission of the SVG and/or image file to ensure that inspections and/or image acquisitions are not missed.

0 = OFF (default)

Specifies that only the image will be transferred.

1 = ON

Specifies that the image and an SVG file will be transferred. When enabled, the SVG file containing the graphic overlay data will be saved into the same directory specified for the images. Use a Web browser, such as Microsoft Internet Explorer 9.0 or later, to view the graphic overlay data and images together.

Resolution

Specifies the image resolution at which the image will be exported.

1 = Full (default)

The image is exported at full resolution.

2 = Half

The image is exported at half resolution.

3 = Quarter

The image is exported at quarter resolution.

WriteImageLocal Outputs

Returns

  • An Local data structure that will write the image data contained in the specified Image data structure to a file on the target system whenever the spreadsheet is updated.
  • Returns #ERR if any input parameters are invalid, or if the SD card is not installed or is full, or if the SD card is installed but not properly formatted.

WriteImageLocal Example

WriteImageLocal($A$0,$A$0,"Image",999,0,0,0,1)

Whenever the spreadsheet updates after an image acquisition, this formula writes a bitmap image file to the SD card installed to the In-Sight vision system. The first file written would be Image000.BMP, the second Image001.BMP, and so on.

Note: A typical application would have the function be cell-state driven to save images only when a failed inspection occurs during runtime. For more information, see Cell State Dialog.