WriteImageFTP
Writes the current image to an FTP server on the network. 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.
- 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.
-
The image width is based on the width of the source image. The width will be adjusted, if needed, making it word-aligned (a multiple of 4). The width will be adjusted up to the next multiple of 4. If this new width is greater than the source image's width, the width will be adjusted down to the previous multiple of 4.
- Jobs containing this function that are saved in In-Sight Explorer 3.3.0 or higher are only compatible with In-Sight Explorer 3.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.
- 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.
- When using the In-Sight emulator as an FTP Server, by default, files are written to the Emulator folder (C:\ProgramData\Cognex\In-Sight\Emulators\x.x.x). In addition to this directory, files can be written to a user-defined location (Authorized FTP directory). For more information on the Emulator directory and the Authorized FTP directory, see Emulation Panel.
WriteImageFTP Inputs
Syntax: WriteImageFTP(Event,Host Name,User Name,Password,Image,File Name,Max Append Value,Reset,Data Format,Save Graphic Overlays,Resolution,Disable FTP 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. Note:
|
|||||||
A valid user name for the target system's FTP 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 FTP 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. Note: When writing files to the Authorized FTP Directory, the File Name path must precisely match the specified Authorized FTP Directory path in the Options dialog. Images can also be written to any sub-directories within the Authorized FTP Directory (the sub-directory must exist). For example, if the Authorized FTP Directory is C:\temp and the name of the file is "Failed", the File Name must be specified as "c:\temp\Failed". If writing to a sub-directory "Images", the File Name will be "C:\temp\Images\Failed". If only specified as "Failed", the file will be written to the default Emulator directory.
|
|||||||
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 FTP Queuing |
Specifies whether or not images should be queued prior to FTP transfer.
|
WriteImageFTP Outputs
Returns |
Note:
|
WriteImageFTP Example
WriteImageFTP($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.