Network Project
Network Project
SANA'A UNIVERSITY
FACULTY OF ENGINEERING
Done by:
Group (2)
System (General)
Supervised by:
Dr. Farouq Al-Fahidi
Eng. Mohammed Alzghir
ABSTRACT
The objective of this project is to develop a communication framework that
facilitates seamless data exchange between three software programs,
LabVIEW, TIA Portal, and Factory IO, and a hardware device, ESP32. The
system leverages the OPC (Open Platform Communications) protocol and
Modbus protocol to establish efficient and reliable communication
channels.
The project focuses on creating an integrated platform that enables these
software programs and hardware to interact and share information
seamlessly. The communication framework acts as a central hub, enabling
real-time data transfer, status updates, and control commands between
LabVIEW, TIA Portal, Factory IO, and the ESP32 device.
The implementation involves setting up OPC servers to facilitate
standardized communication interfaces and configuring Modbus devices
for efficient data exchange. The OPC protocol ensures interoperability and
compatibility among the software programs and hardware, enabling
smooth integration and synchronized operation.
With the combined capabilities of LabVIEW, TIA Portal, Factory IO, and
the ESP32 device, the project offers enhanced control, monitoring, and
automation possibilities. It enables users to harness the strengths of these
software programs and hardware in a unified environment, promoting
collaboration and improving system performance.
The communication framework, based on OPC and Modbus protocols, not
only facilitates efficient data exchange but also provides a foundation for
scalability and future expansions. The system can be extended to
incorporate additional software programs or hardware devices, offering
flexibility and adaptability for evolving automation requirements.
In conclusion, this project aims to develop a communication framework
utilizing OPC and Modbus protocols to enable seamless data exchange
between LabVIEW, TIA Portal, Factory IO, and the ESP32 hardware
device. The framework enhances collaboration, control, and automation
capabilities, paving the way for efficient industrial automation and
monitoring systems.
Content of Headline
Introduction: .................................................................................. 1
The whole project:.......................................................................... 3
Student (1): .................................................................................... 3
Equipments:................................................................................... 3
Procedures:.................................................................................... 8
LABVIEW: .................................................................................... 14
ESP32: ......................................................................................... 15
Factory I\O: ................................................................................. 17
Issues & Solution: ......................................................................... 17
Student (2): .................................................................................. 19
Equipments:................................................................................. 19
Procedures:.................................................................................. 23
LABVIEW: .................................................................................... 32
Factory I\O: ................................................................................. 33
Issues & Solution: ......................................................................... 33
Student (3): .................................................................................. 35
Equipments:................................................................................. 35
Procedures:.................................................................................. 35
Issues & Solution: ......................................................................... 51
Student (4): .................................................................................. 52
Equipments:................................................................................. 52
Procedures:.................................................................................. 55
LABVIEW: .................................................................................... 63
Factory I\O: ................................................................................. 64
Issues & Solution: ......................................................................... 65
Discussion & conclusion: .............................................................. 66
References: .................................................................................. 66
Content of Figures
Figure 1 Industrial Network ..................................................................... 1
Figure 2 The whole project ....................................................................... 3
Figure 3 Push button ................................................................................ 3
Figure 4 Round Led .................................................................................. 3
Figure 5 Numeric inductor........................................................................ 4
Figure 6 Dial ............................................................................................. 4
Figure 7 Waveform Chart ......................................................................... 4
Figure 8 Thermometer ............................................................................. 4
Figure 9 Diffuse sensors ........................................................................... 5
Figure 10 Belt conveyors .......................................................................... 5
Figure 11 Emitter ..................................................................................... 5
Figure 12 Remover ................................................................................... 5
Figure 13 Push Buttons ............................................................................ 6
Figure 14 Potentiometer........................................................................... 6
Figure 15 Digital Display .......................................................................... 6
Figure 16 Capacitive Sensor ...................................................................... 6
Figure 17 Light Array (Emitter and Receiver) ........................................... 7
Figure 18 Electric Switchboard ................................................................. 7
Figure 19 Chain transfer ........................................................................... 7
Figure 20 Column ..................................................................................... 7
Figure 21 S7-PLCSIM Advanced ................................................................ 8
Figure 22 Create channel and device ......................................................... 8
Figure 23 Tags in TIA PORTAL .................................................................. 9
Figure 24 Tags in OPC srver configuration .............................................. 10
Figure 25 quick client ............................................................................. 11
Figure 26 Create I/O server .................................................................... 11
Figure 27 National Instruments.NIOPCServers.V5 ................................... 11
Figure 28 Create bound variables ........................................................... 12
Figure 29 FACTORY IO Drivers ............................................................... 12
Figure 30 FACTORY IO Configurtion ....................................................... 13
Figure 31 Fornt Panel ............................................................................. 14
Figure 32 Block diagram ......................................................................... 15
Figure 33 ESP32 hardware ..................................................................... 15
Figure 34 ESP32 Code............................................................................. 16
Figure 35 Result Factory io ..................................................................... 17
Figure 36 First issue ............................................................................... 17
Figure 37 Solution for first issue ............................................................. 17
Figure 38 Second issue ........................................................................... 18
Figure 39 Solution for second issue......................................................... 18
Figure 40 Push button ............................................................................ 19
Figure 41 Round Led .............................................................................. 19
Figure 42 Numeric inductor.................................................................... 19
Figure 43 Dial ......................................................................................... 19
Figure 44 Meter ...................................................................................... 19
Figure 45 PLC_1 [CPU 1515-2 PN]........................................................... 20
Figure 46 Diffuse sensors ....................................................................... 20
Figure 47 Belt conveyors ........................................................................ 20
Figure 48 Emitter ................................................................................... 21
Figure 49 Two-Axis Pick & Place ............................................................. 21
Figure 50 Remover ................................................................................. 21
Figure 51 Push Buttons .......................................................................... 21
Figure 52 Potentiometer......................................................................... 22
Figure 53 Digital Display ........................................................................ 22
Figure 54 Chain transfer ......................................................................... 22
Figure 55 Electric Switchboard ............................................................... 22
Figure 56 Column ................................................................................... 23
Figure 57 S7-PLCSIM Advanced .............................................................. 23
Figure 58 Create channel and device ....................................................... 23
Figure 59 Tags in TIA PORTAL ................................................................ 24
Figure 60 Tags in OPC srver configuration .............................................. 24
Figure 61 quick client ............................................................................. 25
Figure 62 Create I/O server .................................................................... 25
Figure 63 National Instruments.NIOPCServers.V5 ................................... 25
Figure 64 Create bound variables ........................................................... 26
Figure 65 Sent_Coil ................................................................................. 26
Figure 66 Sent_HoldingReg ..................................................................... 27
Figure 67 Received_Input ....................................................................... 27
Figure 68 Received_InputReg ................................................................. 28
Figure 69 MB_CLient_1 ........................................................................... 29
Figure 70 MB_Client_Data_1 .................................................................... 30
Figure 71 FACTORY IO Drivers ............................................................... 30
Figure 72 FACTORY IO Configurtion ....................................................... 31
Figure 73 Fornt Panel ............................................................................. 32
Figure 74 Block diagram ......................................................................... 32
Figure 75 Result Factory io ..................................................................... 33
Figure 76 First Error .............................................................................. 33
Figure 77 Solution for first error ............................................................. 33
Figure 78 Second Error ........................................................................... 34
Figure 79 Solution for second error ........................................................ 34
Figure 80 PLC_main [CPU 1515-2 PN] ..................................................... 35
Figure 81 S7-PLCSIM Advanced .............................................................. 35
Figure 82 Create channel and device ....................................................... 36
Figure 83 quick client ............................................................................. 37
Figure 84 Sent_Coil ................................................................................. 37
Figure 85 Sent_HoldingReg ..................................................................... 38
Figure 86 Received_Input ....................................................................... 38
Figure 87 Received_InputReg ................................................................. 39
Figure 88 MB_Client_main ...................................................................... 40
Figure 89 MB_Client_Data_main .............................................................. 40
Figure 90 Sent ........................................................................................ 41
Figure 91 Received ................................................................................. 41
Figure 92 MB_Client_PLC1 ...................................................................... 42
Figure 93 MB_Client_PLC1_DATA_SENT .................................................. 42
Figure 94 MB_Client_PLC1_DATA_RECEIVED .......................................... 43
Figure 95 Sent ........................................................................................ 43
Figure 96 Received ................................................................................. 44
Figure 97 MB_server_PLC1 ..................................................................... 44
Figure 98 MB_server_PLC1_DATA_SENT ................................................. 45
Figure 99 MB_server_PLC1_DATA_RECEIVED ......................................... 45
Figure 100 Sent ...................................................................................... 46
Figure 101 Received ............................................................................... 46
Figure 102 MB_Client_PLC2 .................................................................... 47
Figure 103 MB_Client_PLC2_DATA_SENT ................................................ 47
Figure 104 MB_Client_PLC2_DATA_RECEIVED ........................................ 48
Figure 105 Sent ...................................................................................... 48
Figure 106 Received ............................................................................... 49
Figure 107 MB_server_PLC2 ................................................................... 49
Figure 108 MB_server_PLC2_DATA_SENT ............................................... 50
Figure 109 MB_server_PLC2_DATA_RECEIVED ....................................... 50
Figure 110 First Error ............................................................................ 51
Figure 111 Solution for first error ........................................................... 51
Figure 112 Second issue ......................................................................... 51
Figure 113 Solution for second issue....................................................... 51
Figure 114 Push button .......................................................................... 52
Figure 115 Round Led ............................................................................ 52
Figure 116 Dial ....................................................................................... 52
Figure 117 Meter .................................................................................... 52
Figure 118 Tank ..................................................................................... 52
Figure 119 PLC_2 [CPU 1515-2 PN]......................................................... 53
Figure 120 Tank ..................................................................................... 53
Figure 121 Push Buttons ........................................................................ 53
Figure 122 Potentiometer....................................................................... 54
Figure 123 Digital Display ...................................................................... 54
Figure 124 Electric Switchboard ............................................................. 54
Figure 125 Column ................................................................................. 54
Figure 126 S7-PLCSIM Advanced ............................................................ 55
Figure 127 Create channel and device ..................................................... 55
Figure 128 Tags in TIA PORTAL .............................................................. 55
Figure 129 Tags in OPC srver configuration ............................................ 56
Figure 130 quick client ........................................................................... 56
Figure 131 Create I/O server .................................................................. 56
Figure 132 National Instruments.NIOPCServers.V5 ................................. 57
Figure 133 Create bound variables ......................................................... 57
Figure 134 Sent_Coil ............................................................................... 58
Figure 135 Sent_HoldingReg ................................................................... 58
Figure 136 Received_Input ..................................................................... 59
Figure 137 Received_InputReg ............................................................... 59
Figure 138 MB_CLient_2 ......................................................................... 60
Figure 139 MB_Client_Data_2 .................................................................. 61
Figure 140 FACTORY IO Drivers ............................................................. 61
Figure 141 FACTORY IO Configurtion ..................................................... 62
Figure 142 Fornt Panel ........................................................................... 63
Figure 143 Block diagram ....................................................................... 63
Figure 144 Result Factory io ................................................................... 64
Figure 145 First issue ............................................................................. 65
Figure 146 Solution for first issue ........................................................... 65
Figure 147 Second issue ......................................................................... 65
Figure 148 Solution for seconed issue ..................................................... 65
Industrial Network Project Report
Introduction:
In today's interconnected world, efficient communication and data
exchange between software programs and hardware devices play a crucial
role in various industries, including automation and control systems. This
project focuses on developing a robust communication framework that
facilitates seamless data exchange between three software programs,
LabVIEW, TIA Portal, and Factory IO, and a hardware device, ESP32. The
communication framework leverages the power of OPC (Open Platform
Communications) protocol and Modbus protocol to establish reliable and
efficient communication channels.
LabVIEW, TIA Portal, and Factory IO are widely used software programs
that offer unique capabilities for control, automation, and simulation.
However, integrating these programs with a hardware device like ESP32
requires a standardized communication approach to ensure seamless
interoperability and data exchange. OPC protocol provides a widely
accepted standard for industrial communication, allowing different
software programs and hardware devices to communicate in a unified
manner. Additionally, the Modbus protocol, a widely used serial
communication protocol, enables efficient data transmission between the
programs and the hardware.
1
Industrial Network Project Report
Objectives:
• Understanding of how to communicate between LABVIEW, TIA
PORTAL, FACTORY IO, and ESP32 using OPC and Modbus
protocol.
• Understanding the concept of OPC and Modbus protocol.
• Understanding of how to create OPC and Modbus server or client.
• Be aware of the LABVIEW, TIA PORTAL, FACTORY IO
programs.
• Implementing the OPC and Modbus protocol.
• Enabling real-time monitoring and control.
• Ensuring reliability and scalability.
2
Industrial Network Project Report
Student (1):
Equipments:
• HMI (LABVIEW):
1. Push button: (2)
3
Industrial Network Project Report
4. Dial: (3)
Figure 6 Dial
6. Thermometer: (1)
Figure 8 Thermometer
4
Industrial Network Project Report
3. Emitter: (1)
Figure 11 Emitter
4. Remover: (2)
Figure 12 Remover
5
Industrial Network Project Report
6. Potentiometer: (3)
Figure 14 Potentiometer
6
Industrial Network Project Report
12.Column: (1)
Figure 20 Column
7
Industrial Network Project Report
Procedures:
• Communication between LABVIEW & TIA PORTAL using OPC
protocol:
a) Open S7-PLCSIM Advanced & and start virtual Eth. Adapter.
8
Industrial Network Project Report
c) Put all the tags you need from TIA PORTAL in the OPC server
configuration.
9
Industrial Network Project Report
d) Press quick client in OPC server configuration & make sure that
quality is good.
10
Industrial Network Project Report
11
Industrial Network Project Report
12
Industrial Network Project Report
13
Industrial Network Project Report
LABVIEW:
• Result of the project
14
Industrial Network Project Report
ESP32:
Result of the project:
15
Industrial Network Project Report
Code:
16
Industrial Network Project Report
Factory I\O:
• Result of the project:
Solution:
Put update rate 100 or 10:
17
Industrial Network Project Report
Solution:
Open the FACTORY IO as administrator:
18
Industrial Network Project Report
Student (2):
Equipments:
• HMI (LABVIEW):
1. Push button: (5)
4. Dial: (2)
Figure 43 Dial
5. Meter: (2)
Figure 44 Meter
19
Industrial Network Project Report
20
Industrial Network Project Report
3. Emitter: (1)
Figure 48 Emitter
5. Remover: (1)
Figure 50 Remover
21
Industrial Network Project Report
7. Potentiometer: (2)
Figure 52 Potentiometer
22
Industrial Network Project Report
11.Column: (1)
Figure 56 Column
Procedures:
• Communication between LABVIEW & TIA PORTAL using OPC
protocol:
a) Open S7-PLCSIM Advanced & and start virtual Eth. Adapter.
23
Industrial Network Project Report
c) Put all the tags you need from TIA PORTAL in the OPC server
configuration.
24
Industrial Network Project Report
d) Press quick client in OPC server configuration & make sure that
quality is good.
25
Industrial Network Project Report
Figure 65 Sent_Coil
26
Industrial Network Project Report
2) Sent_HoldingReg:
Figure 66 Sent_HoldingReg
3) Received_Input:
Figure 67 Received_Input
27
Industrial Network Project Report
4) Received_InputReg:
Figure 68 Received_InputReg
28
Industrial Network Project Report
Figure 69 MB_CLient_1
29
Industrial Network Project Report
Figure 70 MB_Client_Data_1
30
Industrial Network Project Report
31
Industrial Network Project Report
LABVIEW:
• Result of the project:
32
Industrial Network Project Report
Factory I\O:
• Result of the project:
Solution:
Put show devices with same addresses:
33
Industrial Network Project Report
Solution:
Change the ip from the ip network to plc ip:
34
Industrial Network Project Report
Student (3):
Equipments:
• PLC_main (TIA PORTAL):
1. PLC_main [CPU 1515-2 PN]:
Procedures:
• Communication between LABVIEW & TIA PORTAL using OPC
protocol:
a) Open S7-PLCSIM Advanced & and start virtual Eth. Adapter.
35
Industrial Network Project Report
c) Press quick client in OPC server configuration & make sure that
quality is good.
PLC_1:
PLC_2:
36
Industrial Network Project Report
PLC_main:
Figure 84 Sent_Coil
37
Industrial Network Project Report
2) Sent_HoldingReg:
Figure 85 Sent_HoldingReg
3) Received_Input:
Figure 86 Received_Input
38
Industrial Network Project Report
4) Received_InputReg:
Figure 87 Received_InputReg
39
Industrial Network Project Report
Figure 88 MB_Client_main
Figure 89 MB_Client_Data_main
40
Industrial Network Project Report
Figure 90 Sent
2) Received:
Figure 91 Received
41
Industrial Network Project Report
Figure 92 MB_Client_PLC1
Figure 93 MB_Client_PLC1_DATA_SENT
42
Industrial Network Project Report
Figure 94 MB_Client_PLC1_DATA_RECEIVED
Figure 95 Sent
43
Industrial Network Project Report
2) Received:
Figure 96 Received
Figure 97 MB_server_PLC1
44
Industrial Network Project Report
Figure 98 MB_server_PLC1_DATA_SENT
Figure 99 MB_server_PLC1_DATA_RECEIVED
45
Industrial Network Project Report
2) Received:
46
Industrial Network Project Report
47
Industrial Network Project Report
48
Industrial Network Project Report
2) Received:
49
Industrial Network Project Report
50
Industrial Network Project Report
Solution:
Put Clock_5Hz in the disconnect pin of the mb_client:
51
Industrial Network Project Report
Student (4):
Equipments:
• HMI (LABVIEW):
1. Push button: (1)
3. Dial: (3)
4. Meter: (1)
5. Tank: (2)
52
Industrial Network Project Report
53
Industrial Network Project Report
3. Potentiometer: (3)
6. Column: (1)
54
Industrial Network Project Report
Procedures:
• Communication between LABVIEW & TIA PORTAL using OPC
protocol:
d) Open S7-PLCSIM Advanced & and start virtual Eth. Adapter.
f) Put all the tags you need from TIA PORTAL in the OPC server
configuration.
55
Industrial Network Project Report
g) Press quick client in OPC server configuration & make sure that
quality is good.
56
Industrial Network Project Report
57
Industrial Network Project Report
2) Sent_HoldingReg:
58
Industrial Network Project Report
3) Received_Input:
4) Received_InputReg:
59
Industrial Network Project Report
60
Industrial Network Project Report
61
Industrial Network Project Report
62
Industrial Network Project Report
LABVIEW:
• Result of the project:
63
Industrial Network Project Report
Factory I\O:
• Result of the project:
64
Industrial Network Project Report
Solution:
Put the NORM_X block and SCALE_X in TIA PORTAL:
Solution:
Make sure that you run the PLCSIM advanced and do reinitialized:
65
Industrial Network Project Report
References:
Next-Gen PLC Training - Factory I/O (factoryio.com)
Totally Integrated Automation Portal - Automation Software - Global
(siemens.com)
ni.com/en/support/downloads/software-products/download.labview.html
66