0% found this document useful (0 votes)
24 views39 pages

Interface Protocol DNNFXXX TCP UDP EN

Uploaded by

Tarik Tepe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views39 pages

Interface Protocol DNNFXXX TCP UDP EN

Uploaded by

Tarik Tepe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

EN

DNNF012
DNNF020
TCP/IP or UDP Integration of uniVision Products into Control Systems

Interface Protocol

Subject to change without notice


Available as PDF version only
Version: 1.0.1
As of: 5/04/2021
www.wenglor.com
EN
Table of Contents

1. Use for Intended Purpose�����������������������������������������������������������������������������������������������������������������������3

2. Network Overview������������������������������������������������������������������������������������������������������������������������������������4

3. Settings in uniVision��������������������������������������������������������������������������������������������������������������������������������5

4. TIA Sample Program�����������������������������������������������������������������������������������������������������������������������������11


4.1 Receiving Process Data from TCP Device������������������������������������������������������������������������������������������ 11
4.2 Receiving Process Data from UDP Device����������������������������������������������������������������������������������������� 15
4.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Answers������������������������������������������������ 18

5. TwinCAT3 Sample Programs�����������������������������������������������������������������������������������������������������������������24


5.1 Receiving Process Data from TCP Device������������������������������������������������������������������������������������������ 25
5.2 Receiving Process Data from UDP Device����������������������������������������������������������������������������������������� 27
5.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Answers������������������������������������������������ 29

6. Rockwell Sample Programs������������������������������������������������������������������������������������������������������������������32


6.1 Receiving Process Data from the TCP Device����������������������������������������������������������������������������������� 32
6.2 Receiving Process Data from the UDP Device����������������������������������������������������������������������������������� 34
6.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Responses������������������������������������������� 36

2 Table of Contents
1. Use for Intended Purpose
The instructions show, for example, integration of uniVision products into various control environments via the
TCP/IP or UDP interface. These instructions are in addition to the control sample programs and show, among
other things, which changes are necessary for a different network configuration or for a different number of
characters transmitted via TCP/IP or UDP.

The following uniVision products can be integrated in this way:

uniVision
all-in-one software

Image Analysis Profile Analysis

Smart Camera Smart 2D/3D Profile Sensor

VisionSystem2D Control Unit with 2D/3D Profile Sensors

uniVision Software 3
EN
The sample programs are available for the following control environments:
• Siemens PLC S7-1200 with TIA Portal V15
• Beckhoff TwinCAT3
• SPS 1769-L18ERM-BB1B from Allen-Bradley with Studio 5000 Logix Designer V32

Depending on the control environment, the sample program contains a different scope of functions. In gener-
al, the following functions are possible in the control sample programs:
• Receiving process data from the TCP device
• Receiving process data from the UDP device
• Sending LIMA commands (e.g. trigger commands) via TCP/IP and receiving LIMA answers

NOTE!
The control sample programs are supported starting with uniVision version 2.4.0.

2. Network Overview
The uniVision product, the PLC and PC with uniVision software, and the control software must be on the
same network. The following network settings are used in the sample program.

PLC
IP address: 192.168.100.50
Subnet mask: 255.255.255.0

uniVision product PC with uniVision software and


IP address: 192.168.100.1 control software
Subnet mask: 255.255.255.0 IP address: 192.168.100.10
Subnet mask: 255.255.255.0

4 Network Overview
3. Settings in uniVision
The following steps are necessary to start the uniVision software:
1. Install and open uniVision software for Windows (article number: DNNF020)
2. S
 et up the network configuration of the uniVision product via the uniVision software. To do this, select the
uniVision product in the device list and click Properties.

3. D
 ouble-click to connect to the uniVision product and load a template onto the product.

uniVision Software 5
EN
4. S
 et the trigger mode to software or trigger in order to later use the LIMA interface via TCP/IP and send
trigger commands to the uniVision device.

5. In order to send process data via TCP/IP or UDP, the TCP or UDP device must also be available in the
project tree and configured accordingly.

NOTE!
The TCP device and UDP device for communicating with the control system are already
preconfigured in the template. Alternatively, a new project can be created and the TCP or
UDP device added manually to the project from the toolbar.

6 Settings in uniVision
4. Any character count, preamble, separator and postamble can be configured on the TCP or UDP device.
In addition, the output mode should be set to “Formatted” in order to define a fixed character count. This
makes it easier to read out the process data on the control system.

uniVision Software 7
EN
5. If the output mode is set to “Formatted”, the character count for the various data types can be configured
under “Formatting options”.

NOTE!
In the example, a total of eight characters are used for “integral numbers” and “floating point
numbers” (incl. sign and comma). A character is used for bool data type results.

8 Settings in uniVision
6. T
 he character count should also be selected for the replacement value defined under troubleshooting. In
the example, eight characters are also used for the error replacement value.

uniVision Software 9
EN
7. T
 he total number of characters sent via TCP or UDP can be determined under “Output” on the TCP or UDP
device.

8. S
 ave the project on the uniVision device and store it as a starter project in the device’s properties.

10 Settings in uniVision
4. TIA Sample Program
The TIA sample program is created with a Siemens PLC S7-1200 with TIA Portal V15. It includes the following
use cases:
• Receiving process data from the TCP device
• Receiving process data from the UDP device
• Sending LIMA commands (e.g. trigger commands) via TCP/IP and receiving LIMA answers

4.1 Receiving Process Data from TCP Device


The TIA sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
The TCP process data is sent via port 32002 by default.

If a different network setting or another port is used on the uniVision product, the sample program must be
adapted accordingly.
To do this, open the function module “FB2 Process Data Device TCP” and click on “Start Configuration” on
network 1 “Receive process data”.

uniVision Software 11
EN
Enter the IP address and port under “Partner”.

The TIA sample program is created for process data with a length of 81 characters. If a different character
count is required, the sample program must be adapted accordingly.

NOTE!
The total number of characters sent via TCP as process data can be determined in the
uniVision software on the TCP device under “Output” (see section 3 “Settings in uniVision”
on page 5). Preamble, separator and postamble as well as prefixes must be included in the
character count!

12 TIA Sample Program


To do this, adjust the character count under “LEN” on network 1 “Receive process data”.

The sample program also includes direct conversion of the characters into an integer (DINT) for the first
string. The number of characters or data type for the first integer can be changed as desired.

Compile the sample program, load it onto the control system and connect it online.

uniVision Software 13
EN
The “DB2 Process Data Device TCP” data block receives the process data sent by the TCP device. The data
is received as individual characters (Char).

For the first string, conversion to another data type is shown on the DINT for example purposes.

14 TIA Sample Program


4.2 Receiving Process Data from UDP Device

The TIA sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
UDP process data is sent via port 32002.

If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly.
To do this, open the data block “DB5 UDP Address” under “System blocks” and enter the IP address of the
uniVision product under “REM_IP_ADDR”.

The TIA sample program is created for process data with a length of 81 characters. If a different character
count is required, the sample program must be adapted accordingly.

NOTE!
The total number of characters sent via UDP as process data can be determined in the
uniVision software on the UDP device under “Output” (see section 3 “Settings in uniVision”
on page 5). Preamble, separator and postamble as well as prefixes must be included in the
character count!

uniVision Software 15
EN
To do this, adjust the character count under “IN2” in the function module “FB10 Process Data Device UDP”
on network 5 “Transform CHAR to STRING to INT”.

The sample program also includes direct conversion of the characters into an integer (DINT) for the first
string. The number of characters or data type for the first integer can be changed as desired.

16 TIA Sample Program


Compile the sample program, load it onto the control system and connect it online.

The “DB11 Process Data Device UDP” data block receives the process data sent by the UDP device. The
data is received as individual characters (Char).

For the first string, conversion to another data type is shown on the DINT for example purposes.

uniVision Software 17
EN
4.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Answers
LIMA commands can be sent via the TCP/IP interface. In the sample program, a trigger command is sent to
the uniVision product, which triggers an image or profile recording. Details on the commands available can
be found in the LIMA interface protocol. It is available in the download area of the uniVision product detail
page (https://www.wenglor.com/product/DNNF020).

The LIMA command must be entered with individual characters under “DB6 LIMA command via TCP/IP”.
<T/> must be sent for the trigger command.

The TIA sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
LIMA commands are sent via port 32001.

18 TIA Sample Program


If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly.
To do this, open the function module “FB1 LIMA command via TCP/IP” and click on “Start Configuration” on
network 2 “Send LIMA commands (e.g. trigger commands)”.

uniVision Software 19
EN
Enter the IP address and port 32001 under “Partner”.

Similarly, click on “Start Configuration” on network 4 “Receive LIMA command answer” and enter the IP ad-
dress and port 32001 again. In addition, the character count of the LIMA answers must be entered on network
4 under “LEN”. The trigger command answer contains 6 characters (<TOk/>).

20 TIA Sample Program


Compile the sample program, load it onto the control system and connect it online.

To send the LIMA command, first establish the connection to the uniVision product. To do this, open the
function module “FB1 LIMA command via TCP/IP” and set “Send LIMA commands (e.g. trigger commands)”
CONT to 1 on network 2.

NOTE!
The connection can only be established if port 32001 is available for the control system.
Depending on the product or operating mode of the uniVision software, port 32001 is also
required by the uniVision software (e.g. in editing mode). In this case, the uniVision software
must disconnect so that the connection can be established via the control system.

uniVision Software 21
EN
The LIMA command is sent to the uniVision device by setting REQ to 1.

NOTE!
The LIMA command is reset in the sample program immediately after sending so that only
one image or profile is taken from the uniVision product. The associated results for the trig-
ger can be received via the process data. For example, the execution counter can be used
to check when the results are available.

22 TIA Sample Program


The LIMA answer can be received in the data block “DB8 LIMA answer via TCP/IP”. For the trigger command,
<TOk/> is sent by the uniVision product in response to a successful execution of the trigger command.

uniVision Software 23
EN
5. TwinCAT3 Sample Programs
The TwinCAT3 sample programs for UDP and TCP include the following use cases:
• Receiving process data from the TCP device (in the TCP sample program)
• Receiving process data from the UDP device (in the UDP sample program)
• Sending LIMA commands (e.g. trigger commands) via TCP/IP and receiving LIMA response
(in the TCP sample program)

In the example, the following network configuration is used:


• PC with TwinCAT3:
– IP address: 192.168.100.181
– Subnet mask: 255.255.255.0
• uniVision product:
– IP address: 192.168.100.1
– Subnet mask: 255.255.255.0

NOTE!
To do this, the latest TwinCAT3 version must be installed, including the TF6310 TC3 TCP/IP
module. For details, please contact Beckhoff support.

24 TwinCAT3 Sample Programs


5.1 Receiving Process Data from TCP Device
The sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
The TCP process data is sent via port 32002 by default.

If a different network setting or another port is used on the uniVision product, the sample program must be
adapted accordingly.
To do this, enter the IP address of the uniVision product under “sRemoteHost” and the port under “nRemote-
Port” in the MAIN of TCP_Communication under fbClient_ProcessData.

Insert TCP1 image

uniVision Software 25
EN
The sample program also includes direct conversion of the first eight characters into an integer (DINT) for the
first string. The number of characters or data type can be changed as desired.

Enable the sample program, log in and start it. The process data sent by the TCP device appears under the
variables “sProcessDataTCP”. The data for the first DINT appears under “nDINT”.

26 TwinCAT3 Sample Programs


5.2 Receiving Process Data from UDP Device

The sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0

UDP process data is sent via port 32002.


If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly.
To do this, enter the IP address of the uniVision product in the MAIN of UDP_Communication under the vari-
ables “sRemoteHost”.

uniVision Software 27
EN
The sample program also includes direct conversion of the first eight characters into an integer (DINT) for the
first string. The number of characters or data type can be changed as desired.

Enable the sample program, log in and start it. The process data sent by the UDP device appears under the
variables “stReceivedFrom” -> “sMessage”. The data for the first DINT appears under “nDINT”.

28 TwinCAT3 Sample Programs


5.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Answers
LIMA commands can be sent via the TCP/IP interface. In the sample program, a trigger command is sent to
the uniVision product, which triggers an image or profile recording. Details on the commands available can
be found in the LIMA interface protocol. It is available in the download area of the uniVision product detail
page (https://www.wenglor.com/product/DNNF020).

The LIMA command must be entered in the MAIN of TCP_Communication under “sLIMA_Command”. <T/>
must be sent for the trigger command.

uniVision Software 29
EN
The sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
LIMA commands are sent via port 32001.
If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly.
To do this, enter the IP address of the uniVision product under “sRemoteHost” in fbClient_LIMA.

Enable the sample program, log in and start it.

NOTE!
Connection from the control unit to the uniVision product can only be established if port
32001 is available for the control system. Depending on the product or operating mode of
the uniVision software, port 32001 is also required by the uniVision software (e.g. in editing
mode). In this case, the uniVision software must disconnect so that the connection can be
established via the control system.

The LIMA command is sent to the uniVision product by setting “bSend_LIMA_Command” to TRUE. The
command may only be sent once, not sent constantly, so that only one image or profile is recorded. A new
command must not be sent until the LIMA answer to the previous command has been received.

30 TwinCAT3 Sample Programs


The LIMA answer is contained in “sLIMA Answer”. For the trigger command, <TOk/> is sent by the uniVision
product in response to a successful execution of the trigger command. In addition, after data recording and
evaluation, the new process data is also available via TCP under “sProcessDataTCP”. The execution counter
can be used, for example, to check when new results are available.

uniVision Software 31
EN
6. Rockwell Sample Programs
The Rockwell sample programs for process data and LIMA include the following application cases:
• Receiving process data from the TCP device (in the sample program Example_Rockwell_ProcessData.ACD)
• Receiving process data from the UDP device (in the sample program Example_Rockwell_ProcessData.ACD)
• Sending LIMA commands (e.g., trigger commands) via TCP/IP and receiving the LIMA response
(in the sample program Example_Rockwell_LIMA.ACD)

In the example, the following network configuration is used:


• PLC:
– IP address: 192.168.100.70
– Subnet mask: 255.255.255.0
• uniVision product:
– IP adress: 192.168.100.1
– Subnet mask: 255.255.255.0

NOTE!
The sample program is created with an Allen-Bradley 1769-L18ERM-BB1B PLC using Studio
5000 Logix Designer V32.

6.1 Receiving Process Data from the TCP Device


The sample program Example_Rockwell_ProcessData.ACD is created with the following network setting for
the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
The TCP process data are sent via port 32002 by default.

If a different network setting or another port is used on the uniVision product, the sample program must be
adapted accordingly. To do so, open the controller tags and enter the IP address and the port under SKT_
DATA_Client.Connect_Source.DestAddr.

Transfer the sample program to the controller and go online.

32 Rockwell Sample Programs


The TCP connection is established by activating the value Enable_Process_Data_Client under Parameters
and Local Tags. The process data sent by the TCP device appear under the Client_Buffer_Process_Data_
Read.

uniVision Software 33
EN
6.2 Receiving Process Data from the UDP Device
The sample program Example_Rockwell_ProcessData.ACD is created with the following network setting for
the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0

The UDP process data are sent via port 32002.


If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly. To do so, open the controller tags and enter the IP address under SKT_DATA_UDP.Connect_Source.
DestAddr.

Transfer the sample program to the controller and go online.

34 Rockwell Sample Programs


To receive the UDP process data, activate the value Enable_UDP under Parameters and Local Tags. The
process data sent by the UDP device appear under UDP_Buffer_Process_Data_Read.

uniVision Software 35
EN
6.3 Sending LIMA Commands via TCP/IP and Receiving LIMA Responses
LIMA commands can be sent via the TCP/IP interface. In the sample program Example_Rockwell_LIMA.ACD,
a trigger command is sent to the uniVision product, which triggers an image or profile recording. Details on
the commands available can be found in the LIMA interface protocol. It is available in the download area of
the uniVision product detail page (https://www.wenglor.com/product/DNNF020).

The LIMA command must be entered under Client_Buffer_LIMA_Write under Parameters and Local Tags.
<T/> must be sent for the trigger command.

The sample program is created with the following network setting for the uniVision product:
• IP address: 192.168.100.1
• Subnet mask: 255.255.255.0
LIMA commands are sent via port 32001.

36 Rockwell Sample Programs


If a different network setting is used on the uniVision product, the sample program must be adapted accord-
ingly. To do so, open the controller tags and enter the IP address under SKT_DATA_Client_LIMA.Connect_
Source.DestAddr.

Transfer the sample program to the controller and go online.

NOTE!
A connection from the controller to the uniVision product can be established only if port
32001 is available for the controller. Depending on the product or the mode of operation
of the uniVision software, port 32001 may also be required by the uniVision software (e.g.,
in editing mode). In this case, the connection via the uniVision software may have to be
disconnected so that the connection can be established via the controller.

uniVision Software 37
EN
The TCP connection is established by activating the value Enable_LIMA_Client under Parameters and Local
Tags.

The LIMA command is sent to the uniVision product by activating Write_Data_LIMA_Client. The command
may be sent once only and must not be permanently set so that only one image or profile is recorded. A new
command must not be sent until the LIMA response to the previous command has been received.

The LIMA response is contained under Client_Buffer_LIMA_Read. For the trigger command, <TOk/> is sent
by the uniVision product in response to a successful execution of the trigger command.

In addition, after data recording and evaluation, the new process data are also available via TCP (see the
sample program Example_Rockwell_ProcessData.ACD). The run counter can be used, for example, to check
if new results are available.

38 Rockwell Sample Programs


uniVision Software 39

You might also like