Tuto Communication Anglais

and a simulation software, Factory IO, via an OPC server provided by Cogent DataHub. ... "Network connections", "Ethernet", "Network and sharing center". .... The software Cogent DataHub allows us, in this project, to transfer the data between ...
3MB taille 216 téléchargements 482 vues
Tutorial to do a communication between a PLC programmed with PC WORX and Factory IO via Cogent DataHub Students in Bachelor's Degree in Supervision of Automations and Networks:

Tutors:

Vincent DELANEAU Pascal VRIGNAT Florent DUCULTY

Gaël COUTANT Héctor RAMIREZ-DORANTES

Contents 1.

Introduction ..................................................................................................................................... 2

2.

Network configuration .................................................................................................................... 5

3.

Configuration and program in PCWORX ......................................................................................... 7

4.

OPC Configurator........................................................................................................................... 17

5.

Cogent DataHub ............................................................................................................................ 18

6.

Factory IO ...................................................................................................................................... 21

7.

Result ............................................................................................................................................. 25

8.

Table of illustrations ...................................................................................................................... 26

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

1

1. Introduction This tutorial allows to teach to do a communication between a PLC programmed with PC WORX and a simulation software, Factory IO, via an OPC server provided by Cogent DataHub. For this, the goal will be to blink 8 LEDs with a start button and a stop button. These buttons and LEDs will be located directly on the board and virtually in the Factory IO software.

Required software: 

PC WORX version 6.30.1668 (Paid License)

PC WORX is a programming software that allows you to program Phoenix Contact PLCs. 

OPC Configurator version 3.0 (Supply with PC WORX)

OPC Configurator is software provided in the Phoenix Contact software package. It retrieves the "OPC" values configured in the programming software to be transferred to Cogent DataHub. 

Cogent DataHub version 7.3.5.242 (Paid License)

This software allows, in this project, to have an OPC server, to retrieve the PC WORX variables. 

Factory IO version 2.2.2 (Paid License)

Factory IO is a software for 3D design and simulation of automated industrial systems.

Used computers: 

Windows 10 Professional



Processor Intel® Core™ i5-7500 CPU @ 3.40 GHz



Installed memory (RAM): 16,0 Go



Operating system 64 bits, processor x64

Automatism part: The connector board, supplied by Phoenix Contact, is an AXC Trainer 1050 PN (figure 1). A switch is also necessary. The one supplied by the manufacturer is a FL Switch SMCS 8TX PNBoard.

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

2

Figure 1: Connector board AXC Trainer 1050 PN + Switch

The upper part of the board contains, from left to right, a power supply with the cable to connect it electrically, a controller that has two Ethernet ports. Then, there is a module that can hold up to 16 logical type inputs followed by a second logic type output module. To finish on the upper part, there is a PROFINET bus coupler with an input / output module with two analog inputs and two analog outputs. On the bottom of the deck, there is a module that simulates buttons and another with a potentiometer.

Module

Reference

PLC

AXC 1050 2700988

Input module

2688310

Output module

2688349

Profinet bus coupler

BK PN 2701815

Profinet input/output module

2702072

Switch

2989103

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

3

Synoptic system operation: The hardware configuration of the model is shown in figure 2

Figure 2: Synoptic system operation

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

4

2. Network configuration

Before configuring the network, first connect the board and the Switch correctly. The power cable must be connected to the top left of the board. The X2 ports of both modules must be connected together with a standard RJ45 Ethernet cable already supplied (figure 3).

Figure 3: PLC Board

Port X1 of the AXC 1050 controller must be connected to the Switch board (figure 4). The client computer and the development computer must be connected to the Switch in order to communicate. The Switch board, like the PLC board, must be electrically powered.

Figure 4: Switch Board

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

5

To communicate with the PLC, it is necessary to work in local network with an IP address which must be in the same class of address as that of the PLC. To access the network configuration of the PC, right click on the Windows icon

, then

"Network connections", "Ethernet", "Network and sharing center". In "Connections", click on "Ethernet" then "Properties", select "Internet protocol version 4 (TCP/IPv4)" and to finish "Properties" (figures 5 and 6).

Network configuration of the development PC:

Figure 5: Network configuration of the development PC

Network configuration of the client PC:

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

6

Figure 6: Network configuration of the client PC

To check the communication between the PLC and the computers, we can do a test " Ping ". Right click on the Windows icon

, then click on " command prompt ". You must then enter the

following function, in the command prompt, that tests the communication between the computer and the PLC: " ping 192.168.0.11 ". We obtain the following result (figure 7):

Figure 7: Test of the communication

3. Configuration and program in PCWORX Now you have to switch to PCWORX programming software. This is the PLC language programming software provided by Phoenix Contact. For assigning IP addresses to the hardware and downloading the program to the PLC, it will be necessary to power it and turn it on. This is the homepage of PCWORX with the different areas of the software (figure 8).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

7

Figure 8: PC WORX homepage



The area 1 corresponds to the programming zone



The area 2 correspond à l'arborescence du projet



The area 3 corresponds to the message box



The area 4 corresponds to the location of the different programming blocks

A taskbar (figure 9) and tabs are also provided to the user.

Figure 9: Taskbar

Do " New Project " (figure 10):

Figure 10: New project

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

8

Choose the PLC reference (figure 11). In our case, it is an AXC 1050. Then click on " OK ".

Figure 11: Choice of the PLC under PC WORX

Click on

, the icon " Workspace FDT ", to implement the hardware.

Enter in the window " Device Catalog " the reference of the Profinet module " 2701815 ". It must then be selected and dragged to the section " Profinet " in the window "Bus structure " (figure 12).

Figure 12: Profinet module implementation

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

9

Enter in the window " Device Catalog " the reference of the digital input module " 2688310 ". It must then be selected and dragged to the section " # Axioline " in the window "Bus structure ". It is necessary to repeat the operation for the digital output module, which has as reference " 2688349 " (figure 13).

Figure 13: Implementation of the input/output module

Enter in the window " Device Catalog " the reference of the analog input / output module " 2702072 ". It must then be selected and dragged to the section " #0 Axioline " of the Profinet module in the window " Bus structure " (figure 14).

Figure 14: Implementing the Profinet input/output module

Go to the tab " Tools ", then " PROFINET Configuration ". Select the available Ethernet network card on the computer (figure 15).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

10

Figure 15: Choice of the network card

Select the PLC " AXC 1050 " in " Bus structure " then replace the IP address of the PLC module with the desired one. The IP address of the PLC module must be in the address class " 192.168.0.X " and be different from the IP addresses already used (figure 16).

Figure 16: Implementing the IP address of the controller

Select the Profinet module " AXL F BK PN " in " Bus Structure " then replace the IP address of the module with the desired one. The IP address of the Profinet module must be in the address class " 192.168.0.X " and be different from the IP addresses already used (figure 17).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

11

Figure 17: Implementing the IP address of the Profinet module

Check the IP addresses of the 2 modules in the tab " IP Attribution " (figure 18).

Figure 18: Verification of IP addresses

Click on

, the icon " Programming workspace CEI ", to program.

To implement the library " Moving Light " which contains a new block to the software, it is necessary to save the compressed file " Bibliothek_Moving_Light.zip " available on the supplied CD-ROM on the C-disk of the development computer. It is then necessary to extract this file towards the path: "C:\Users\Public\Documents\PC WORX\Libraries ". Then you have to right click on " Libraries " puis " Insert " to choose " Library chosen by the user ". Select the library Moving Light at its location on disk C (figure 19).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

12

Figure 19: Implementing a library

Drag the unit " Moving Light " from the Libraries to the programming window (figure 20).

Figure 20: Unit Moving Light

Double-click on the connector of " CyclicTime " and create the variable " Time_Parameter " with the following characteristics (figure 21):

Figure 21: Creating the variable Time_Parameter

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

13

Create the buttons and LEDs by following the settings below (figure 22). The virtual buttons represent the commands available from Factory IO. They do not have I/O addresses. The address ranges are, for the inputs, %IX0.0 at %IX1.4 and for the outputs, %QX2.0 at %QX3.4.

Figure 22: Creation of LEDs

Click on

, the icon " Assign Process Data workspace ", to assign program variables to process

signals. By dragging the input signals to the variables in " Default " in the left window, assign the input signals to the buttons as follows (Figure 23).

Figure 23: Assigning signals to inputs

By dragging the input signals to the variables in " Default " in the left window, assign the input signals to the buttons as follows (Figure 23). Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

14

Figure 24: Assigning signals to outputs

Compile the program

( figure 25).

Figure 25: Compilation of the program

We obtain at the end this table of global variables (figure 26):

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

15

Figure 26: Table of global variables

Then assign the addresses to the physical inputs and outputs in the program variable table " Main " (figure 27). You have to check in " OPC " the outputs and virtual buttons found in the Factory IO software.

Figure 27: Table of program variables

Enable debug mode.

Objects in red represent objects in state 1 (figure 28).

Figure 28: Debug mode

Click on the project control dialog.

Then, press " Reset " and " Download " and finally we have

to press " Hot " (figure 29).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

16

Figure 29: Debug mode + Project control dialog

4. OPC Configurator Start the OPC Configurator software. A welcome window will appear (figure 30):

Figure 30: OPC Configurator homepage

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

17

The OPC Configurator Software allows us to configure an IP address of the PLC to make a bridge between this one, PC WORX and Factory IO. If it is necessary to change the IP address, go to " Settings " to change it (figure 31).

Figure 31: OPC Configurator settings

5. Cogent DataHub The software Cogent DataHub allows us, in this project, to transfer the data between PC WORX and Factory IO. The home page of this software is as follows (figure 32):

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

18

Figure 32: Cogent DataHub homepage

To add a new server, it’s necessary to go to the " OPC " tab, then click in " Add ": To define a new OPC server, choose the new name for the server in " OPC Server Name ". In this case the name will be " AUTOMATIONWORX OPC-Server 3.0 ". Then, click " OK " (figure 33).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

19

Figure 33: Creation of an OPC server

To make sure everything is in place, click in " View Data ". Then, open the " default " to get access to " TestResource " and finally " Main " (figure 34).

Figure 34: Preview of the variables in Cogent DataHub

If every one of the variables is visible, it means that the configuration is good. Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

20

6. Factory IO

Factory IO is a 3D conception Software for automated industrial systems (figure 35).

Figure 35: System in Factory IO

To create a new environment, click in “New” (figure 36).

Figure 36: Factory IO homepage

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

21

To start, the program will allow to test 8 LEDs in sequence, imitating a garland. Go to “Operators” (figure 37).

Figure 37: Operators library

There’s the possibility to install a button box in a pole (for mere aesthetic reasons). For that, press “V” button to elevate the button box from the ground, then drag the LEDs and the buttons there (figure 38).

Figure 38: Making of the operator panel

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

22

Finally, it is necessary to configure the drivers. Go to “File”, “Drivers” and choose “OPC Client Data Access” (figure 39).

Figure 39: Communication protocol choice

Click in “Connect”, then go to “Configuration” and click in “Explore objects” (figure 40).

Figure 40: Communication protocol settings

The INs and OUTs implemented in Factory IO are in the left and right of the screen, where the sensors and actuators are respectively. In the box in the middle, are the INs and OUTs created in PC WORX (figure 41).

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

23

Figure 41:: Link between the INs/OUTs of PC WORX and Factory IO

To make a connection between the 2, just drag the Factory IO variables to the variables in the box (figure 42).

Figure 42: Connection between INs/OUTs

For the last step, it is necessary to click on the “Play” button to run the simulation and on the “Start” button of the operator panel in the simulation for activate the moving light (figure 43).

Figure 43: Factory IO bar with differents options

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

24

7. Result At the end of this tutorial, the expected result is a virtual system representing flashing LEDs at a regular interval. This allows to test the I/O of the AXC1050 board. The system can be controlled via Factory IO or directly from the board. The value of the outputs can be followed at the same time on Factory IO and on the board (figure 44).

Figure 44: Representation under Factory IO

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

25

8. Table of illustrations Figure 1: Connector board AXC Trainer 1050 PN + Switch....................................................................... 3 Figure 2: Synoptic system operation.............................................................................................................. 4 Figure 3: PLC Board ............................................................................................................................................ 5 Figure 4: Switch Board ...................................................................................................................................... 5 Figure 5: Network configuration of the development PC .......................................................................... 6 Figure 6: Network configuration of the client PC ....................................................................................... 7 Figure 7: Test of the communication ............................................................................................................. 7 Figure 8: PC WORX homepage ......................................................................................................................... 8 Figure 9: Taskbar................................................................................................................................................ 8 Figure 10: New project ...................................................................................................................................... 8 Figure 11: Choice of the PLC under PC WORX.............................................................................................. 9 Figure 12: Profinet module implementation .................................................................................................. 9 Figure 13: Implementation of the input/output module .......................................................................... 10 Figure 14: Implementing the Profinet input/output module ................................................................... 10 Figure 15: Choice of the network card ......................................................................................................... 11 Figure 16: Implementing the IP address of the controller...................................................................... 11 Figure 17: Implementing the IP address of the Profinet module.......................................................... 12 Figure 18: Verification of IP addresses ...................................................................................................... 12 Figure 19: Implementing a library ................................................................................................................. 13 Figure 20: Unit Moving Light ......................................................................................................................... 13 Figure 21: Creating the variable Time_Parameter .................................................................................... 13 Figure 22: Creation of LEDs........................................................................................................................... 14 Figure 23: Assigning signals to inputs .......................................................................................................... 14 Figure 24: Assigning signals to outputs ....................................................................................................... 15 Figure 25: Compilation of the program ........................................................................................................ 15 Figure 26: Table of global variables ............................................................................................................. 16 Figure 27: Table of program variables ........................................................................................................ 16 Figure 28: Debug mode .................................................................................................................................... 16 Figure 29: Debug mode + Project control dialog........................................................................................ 17 Figure 30: OPC Configurator homepage....................................................................................................... 17 Figure 31: OPC Configurator settings .......................................................................................................... 18 Figure 32: Cogent DataHub homepage ......................................................................................................... 19 Figure 33: Creation of an OPC server ..........................................................................................................20 Figure 34: Preview of the variables in Cogent DataHub ..........................................................................20 Figure 35: System in Factory IO .................................................................................................................. 21 Figure 36: Factory IO homepage .................................................................................................................. 21 Figure 37: Operators library .........................................................................................................................22 Figure 38: Making of the operator panel ....................................................................................................22 Figure 39: Communication protocol choice ..................................................................................................23

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

26

Figure 40: Communication protocol settings ..............................................................................................23 Figure 41:: Link between the INs/OUTs of PC WORX and Factory IO ..............................................24 Figure 42: Connection between INs/OUTs ................................................................................................24 Figure 43: Factory IO bar with differents options .................................................................................24 Figure 44: Representation under Factory IO ............................................................................................25

Bachelor's Degree in Supervision of Automations and Networks IUT of Indre (Orleans University) Chateauroux, FRANCE

27