# Communication

The Communication application step allows you to configure your connection and file writing settings.

The following settings are available in the Communication app step:

- Industrial Ethernet settings allow you to set up an input and output stream over Ethernet/IP, PROFINET, SLMP, or Modbus TCP.
- FTP Server settings allow you to connect your device to an FTP server.
- Write Image settings allow you to define the conditions and properties for writing images to file.
- Write File settings allow you to define the conditions and properties for writing job reports to file.
- Write TCP/IP settings allow you to define the conditions and properties for writing files over a TCP/IP connection.

Note: Adding an input to Communication application step disables the property control in the other app steps. This is because an Input Property overwrites the property of another snippet with a GetBufferData() function.
Configure Industrial Ethernet settings:

Setting | Description
--- | ---
Target Protocol | Select the Industrial Ethernet protocol that you would like to use: None Ethernet/IP PROFINET SLMP Modbus TCP Server
Byte/Word Order | Specifies the bit order for words and bytes read by the system.
0 = Big endian | Stores the most significant byte first, and subsequent bytes in descending order.
1 = Little endian | Stores the least significant byte first, and subsequent bytes in ascending order.
2 = Big endian with 16-bit word swapping | Applies big endian byte style, and switches the word pair order for double word types. (16-bit words)
3 = Little endian with 16-bit word swapping | Applies little endian byte style, and switches the word pair order for double word types. (16-bit words)
100 = Default | Uses the default setting.
Input/Output Data Contents | Click Format Data to open a dialog in the center of the screen, where you can configure the contents of the input and output buffer:
Settings | Description
--- | ---
Inputs | Add tool property reports to include them in your input data. To select the tool property you want to link, click +to open the tool properties dropdown. Once you have added a tool property, you can change the Data Type and Size (bytes) properties of the following tool property settings. Note: You can only change the Size (bytes) property if you set the Data Type of the tool property to String or Byte-Swapped String. To remove a tool property from the list, select the tool property and click –. To change the order of the tool properties in the list, select a tool property and click the up or down arrows.
Outputs | Add tool property reports to include them in your output data. To select the tool property you want to link, click +to open the tool properties dropdown. Once you have added a tool property, you can change the Data Type and Size (bytes) properties of the following tool property settings. Note: You can only change the Size (bytes) property if you set the Data Type of the tool property to String or Byte-Swapped String. To remove a tool property from the list, select the tool property and click –. To change the order of the tool properties in the list, select a tool property and click the up or down arrows.

Configure FTP Server settings:

Setting | Description
--- | ---
Server | The FTP address for the server you want to connect your device to.
User Name | A valid user name for the FTP server.
Password | The password for the given user name.

Configure Write Image settings:

Setting | Description
--- | ---
Enabled | Enable or disable image writing. You can also use the link icon next to the toggle to link a boolean tool property, which makes image writing conditional on that tool property value.
Storage | Select which storage drive you want your device to write images to. The available options are:
Storage Setting | Connected Device | Save Location
--- | --- | ---
Local Device | In-Sight vision system | In-Sight device Note: You must use FTP software, such as FileZilla Client, to view files. For more information, see How to View Files Stored on In-Sight Device.
In-Sight Emulator | Host PC
PC | PC Note: Saving to a PC is only supported using an FTP/SFTP server.
FTP Server | Any device | Specified FTP server
SFTP Server | Any device | Specified SFTP server
- File Path | Define the file path for image writing on the selected storage drive. When connected to an In-Sight emulator, and saving to the PC, you can write the file to any location where you have operating system write permissions. You can enter the following file path types to this field:
  Path | Example
  hardcoded | X:/, X:/Subdir
  UNC | //Cognex/shared/
  mapped drive | M:/Subdir
  relative | ../../Subdir
If the path does not exist on the In-Sight vision system or the emulator host PC, the tool creates the folder. If the path or FTP/SFTP credentials are invalid on the FTP/SFTP server, the tool does not return #ERR. Tip: Depending on your FTP/SFTP server, a valid file path can contain forward slashes or back slashes. Make sure to use a file path convention that your file server accepts. If you leave this field blank, you send the file to one of the following default locations: Local device: Default directory of the device. In-Sight emulator: %USERPROFILE%\Documents\In-Sight 3D EasyBuilder\In-Sight Emulator FTP Server: The default directory of the specified FTP server. SFTP Server: The default directory of the specified SFTP server.
File Name | Define the file name you want your device to use when writing images. Also defines the name of the SVG file. Note: Follow the restrictions of the operating system on the permitted characters. You can format the append value parameter of the File Name.
File Type | Select the file type you want your device to use when writing images. The available options are: BMP JPEG
Overlay Graphics | When you enable Overlay Graphics, the vision system saves the image and a SVG file that includes the graphics. Open the SVG file in your browser to see the image with overlay graphics. 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.
0 = OFF | Only the image gets transferred.
1 = ON (default) | Both image and an SVG file get transferred. When enabled, the SVG file containing the graphic overlay data is saved into the same directory specified for the images. Use a web browser to view the overlay graphics data and images together.
Note: When enabled, the SVG file uses 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 graphics data is not an exact pixel-for-pixel match.
Add Timestamp | Enable to insert a timestamp after the file name. If the append value is also enabled, the timestamp is inserted before the append value.
Timestamp Format | Enable to configure the formatting of the timestamp. Select a format.
Append Value | Enable to append a numerical value to the file name based on the Max Append Value settings.
Max Append Value | Define the maximum value of the suffix that the device adds to the file name for each image. The minimum value is 0, the maximum value is 9999999. The default value is 999. A counter is incrementing as each image file is written, and added to the end of the specified File Name if no format specifier is used; otherwise, the counter is added at the location of the format specifier. The counter automatically resets when it equals the Max Append Value; the existing image files on the target system are overwritten by new files of the same name.
File Name Preview | Visual representation of the configured file name options.

Configure Write File settings:

Setting | Description
--- | ---
Enabled | Enable or disable file writing. You can also use the link icon next to the toggle to link a boolean tool property, which makes file writing conditional on that tool property value.
Storage | Select which storage drive you want your device to write files to. The available options are: Local Device FTP Server SFTP Server
File Path | Define the file path for file writing on the selected storage drive. Tip: Depending on your FTP/SFTP server, a valid file path can contain forward slashes or back slashes. Make sure to use a file path convention that your file server accepts.
File Name | Define the file name you want your device to use when writing files.
File Type | Select the file type you want your device to use when writing files. The available options are: TXT HTML XML CSV
Add timestamp | Enable or disable the addition of a timestamp for each file.
Timestamp format | Define the timestamp format using a combination of MM, DD, and YY in your order of preference.
File Name Preview | Displays a preview of the file name based on your file name and timestamp settings.
Write Type | Define what to do when a file by the same name already exists: Overwrite - replaces the previous contents of the file with the new contents Append - adds the new contents to the file after the previous contents
File Contents | Click Format String... to open a dialog in the center of the screen, where you can configure the contents of the files:
Settings | Description
--- | ---
Starting/Ending | Leading Text: provide the text string you want to include at the beginning of the files. Trailing Text: provide the text string you want to include at the end of the files. Terminators: define what terminators the files use: Carriage Return (CR) Line Feed (LF) CR+LF
Use Delimiter | Use Delimiter: enables or disables delimiters in the files. When enabled, use the radio buttons to select one of the following delimiter types: Standard: Comma Space Tab Semicolon Underscore Other
Arguments | Add tool property reports to your arguments to include them in your files. Click Add or press A to open the tool properties dropdown, and select the tool property you want to link. To remove a tool property from the list of arguments, select the tool property and click Delete. To change the order of the tool properties in the list of arguments, select a tool property and click Up or Down.
Output | The Output text box displays a preview of file contents based on your settings.

Configure Write TCP/IP settings:

Settings | Description
--- | ---
Enabled | Enable or disable file writing. You can also use the link icon next to the toggle to link a boolean tool property, which makes file writing conditional on that tool property value.
Mode | Select the mode of writing: TCP Client: the camera acts as a TCP client. TCP Server: the camera acts as a TCP server.
Host Name | Specify the host name for your device.
Port | Specify the port number you want the device to use.
Timeout | Specify the length of time in seconds that the device can be idle before the connection is terminated.
Packet Type | Select the packet type according to string terminators: String CR+LF String CR(13) String LF(10) String Nullchar(0) String with Custom Terminator
Custom Terminator | Define a custom numerical string terminator (0-255). To enable this setting, set the Packet Type parameter to String with Custom Terminator.
Max Packet Size | Define the maximum packet size.
Output String | Click Format String... to open a dialog in the center of the screen, where you can configure the contents of the files:
Settings | Description
--- | ---
Starting/Ending | Leading Text: provide the text string you want to include at the beginning of the files. Trailing Text: provide the text string you want to include at the end of the files. Terminators: define what terminators the files use: Carriage Return (CR) Line Feed (LF) CR+LF
Use Delimiter | Use Delimiter: enables or disables delimiters in the files. When enabled, use the radio buttons to select one of the following delimiter types: Standard: Comma Space Tab Semicolon Underscore Other: define a custom delimiter
Arguments | Add tool property reports to your arguments to include them in your files. Click Add to open the tool properties dropdown, and select the tool property you want to link. To remove a tool property from the list of arguments, select the tool property and click Delete. To change the order of the tool properties in the list of arguments, select a tool property and click Up or Down.
Output | The Output text box displays a preview of file contents based on your settings.