WriteImageSFTP
Writes the current image to an SFTP server on the network, communicating over the SSH protocol. 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.
- This function cannot be used to transfer images to another In-Sight vision system or Emulator; a vision system may only serve as a client on a SFTP network.
- 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 a memory-intensive job containing the function is executed repeatedly, the FTP command "Get image.jpg" (or .bmp) may fail because the vision system's memory becomes too fragmented. The job will continue to execute correctly.
- If an AcquireImage function parameter is modified while the vision system is Online, the function will send the current image.
- Jobs containing this function that are saved in In-Sight Explorer 4.3.0 or higher are only compatible with In-Sight Explorer 4.3.0 and higher.
- The port number of the FTP server connection can be changed by appending the host name (or IP address) with a colon (:) then the new port number. For example, if the current Host Name was PRODUCTION1, to change the port number from the default (port 21) to port 34, the Host Name parameter would be specified as PRODUCTION1:34.
-
The Emulator folder is located: C:\ProgramData\Cognex\In-Sight\Emulators\x.x.x (Windows 7/Windows 10). For more information, refer to the Emulation Panel.
- If the default location of the saved images is kept as the Emulator folder, allowing more than 250 image files to be stored in the directory will prevent a firmware update of the vision system. Remove the image files from the directory to restore firmware update capability. For more information, see Update Firmware Dialog.
WriteImageSFTP Inputs
WriteImageSFTP(Event,Host Name,User Name,Password,Image,File Name,Max Append Value,Reset,Data Format,Save Graphic Overlays,Resolution,Disable SFTP Queuing)
| Parameter | Description | ||||||
|---|---|---|---|---|---|---|---|
Specifies the event that forces an update.This parameter must be a reference to one of the following:
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. |
|||||||
|
The host name (or IP address) of the target device on the network where the image file will be written. The target device can be an In-Sight emulator, or any other host acting as an FTP server on the network. An In-Sight vision system may only serve as a client on a SFTP network. The WriteImageSFTP function cannot be used to transfer images to another In-Sight vision system or Emulator. Note:
|
|||||||
|
A valid user name for the target system's SFTP server. This user name is not required to exist on the In-Sight vision system that is writing the image file. |
|||||||
|
A valid password for the target system's SFTP server. The password is case-sensitive, and its length cannot exceed 15 characters. Note:
|
|||||||
|
A reference to a cell containing an Image data structure. The default reference is to the Image data structure in cell A0. |
|||||||
|
The name of the image file to write; 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). If no path is specified, the image file will be written to the default directory of the FTP server on the target host. |
|||||||
|
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. |
|||||||
|
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.
|
|||||||
|
The file format of the image that will be written out to the target host.
|
|||||||
|
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, 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:
|
|||||||
| Resolution |
Specifies the image resolution at which the image will be exported.
|
||||||
| Disable SFTP Queuing |
Specifies whether or not images should be queued prior to FTP transfer.
|
WriteImageSFTP Outputs
|
Returns |
Note:
|
WriteImageSFTP Example
WriteImageSFTP($A$0,"SYSTEM1","admin","*",$A$0,"\IMAGES\TEST",999,0,0,0,1,0)
Whenever the spreadsheet updates after an image acquisition, this formula writes a bitmap image file across the network to the IMAGES directory located on the host named SYSTEM1. The user name admin, its password, and the IMAGES directory must already exist on SYSTEM1, or #ERR will be returned in the spreadsheet. The first file written would be TEST000.BMP, the second TEST001.BMP, and so on.