Reference Manual
Chapter
4
IVC-2D
©
SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
193
Communication
Send to FTP
This tool replaces the previous version of the Send to FTP tool. The previous version is
made obsolete in IVC 3.1 SR1, and we recommend that the new tool is used instead.
This tool is used for saving files on an FTP server, files that contain an image, a data block
or values from the table. The saved files can either be used for debugging purposes or
when developing programs using the Emulator as device.
The device will log on to the FTP server using the supplied user name and password. If
there is a firewall between the device and the FTP server and there are problems connec-
ting to the FTP server, setting
Passive mode
to
True
may help.
The files are saved in the location and with the name specified by the
Directory
and
File-
name
parameters. You can use expressions to create filenames based on values from the
table and results from other steps. For example, by setting
Directory
to
‘images’
, and
Filename
to:
='image_no_' + str(V2) + '.jpg'
the image will be saved in the
images
directory on the FTP server with the file name
image_no_19.jpg
, if the table row 2 contains the value
19
.
Images can be saved in either raw, grayscale JPEG, or color JPEG format. Images saved in
raw format can be imported and used in IVC Studio. Use the raw format if the images are
to be used by the Emulator; make sure that the file names have the extension .raw (2D
and 3D images) or .img (3D images). Note that the raw format is no longer compatible with
bmp for 2D images. Use instead the bmp option for this. When saved in grayscale JPEG
the image is saved without any added graphics (such as ROIs and results added by other
tools), whereas they would be included if saved in color JPEG format.
The
Quality factor
parameter sets the compression ratio for the images when saving in
JPEG format.
When saving data, the tool saves the values from the table to the file, from row number
Table index
and up to (but not including) row number
Table index
+
Number of elements
.
The tool can transmit images and table data in the same call. In this case, the filename and
folder will specify the location for the image file, and the table information will be stored in a
file called “TableData.txt”. This file will be stored in a folder called Data which is located in
the image folder. For example, if the image file is specified as ‘
im-
ages\110114\image_xx.jpg
’, the table data will be stored in the file
‘im-
ages\110114\data\TableData.txt’
.
If a data block is transmitted, no other data type is allowed, and the parameters
Table
index
and
Image bank
must be set to -1.
Note:
the parameter
Timeout
refers to interruptions during the transfer of FTP data. E.g. if
the parameter is set to 1000 ms (1 second), the transfer will still be successful even if the
total time of the transfer exceeds 1 second. The transfer will in this case report timeout
only if the time between two consecutive data packets containing the image exceeds 1
second.
The parameter
Quote command
can be used to send a generic command to the FTP
server. If this parameter is used, the command text entered in the parameter will be sent
to the FTP server immediately after a successful connection. If the parameter is empty
(default), no command will be sent. If the FTP server fails to interpret or handle the com-
mand, the connection will be terminated and no data will be sent.
The tool can store table data in two formats:
Configuration
This format is compatible with the Get from FTP tool and the table
data file can only hold one set of data. The first row in the file speci-
fies the number of data rows, and each of the following rows con-
tain datatype and actual data.
Note:
The Emulator does
not emulate this
tool. See section
Handling the
Emulator for more
information.