In this tutorial you will learn the guidelines and procedures to simulate a simple logic and communicate
Components
Software: MasterTool IEC XE 3.40; FactoryIO 2.5.2
PLC: For this simulation, it is not necessary to have a physical PLC
Tutorial Sections
1.0 ARCHITECTURE
There is no need for physical hardware, only a computer with the installed software
2. DEVELOPMENT
2.1 Creating a new project in Mastertool
2.2 Add GVL
2.3 Add device
2.4 OPC Configuration
2.5 FactoryIO Configuration
2.6 Tag Configuration
3. VIDEO
1. ARCHITECTURE
There is no need for physical hardware, only a computer with the installed software
2. DEVELOPMENT
The simulation will be based on the draining and filling of a tank
2.1. Creating a new project in Mastertool
Create a new project by clicking on "New Project", enter the name and the path of the folder where you want to save it.
For this simulation with mastertool and FactoryIO we will use the XP 340 and the programming language in LADDER; click next making sure all languages are set to ladder until "FINISH" appears and then the program will open.
2.2 Add GVL
We will start by creating a list of global variables. To do this, right-click on Application >> Add objects >> Variable list. Name the list as you wish, without spaces or special characters, then click on "Add".
When the list opens on your screen, change the declaration type to textual mode (1), then delete the parameter above VAR_GLOBAL (optional if you want to use the global variable list throughout the project without having to declare the list name). And declare the variables as shown in the image beside. We will use 4 boolean variables.
In UserPrg we will add some operators to make the logic more optimized. Select the toolbox, in Function blocks click and drag the SR block to the screen, drop the block on "start here" or on the arrow on the side.
Click on the output of the block and select the coil. With the coil inserted, select the line and press Ctrl+C and Ctrl+V to copy and paste the line. This way we will create logic to turn on and off the tank drain and fill valves.
After copying and pasting the line, name the blocks with different names, one will be responsible for filling the tank and the other for emptying. The names given to the blocks will appear as local variables.
The Reset contact of the FILL block and the Set contact of the EMPTY block will be negated contacts. To do this, click once on the contact, when it turns red, right-click and then select negation.
Next, name the contacts
2.3. Add device
With the variables declared, add the Symbol Configuration object in the project tree. To do this, right-click on Application >> add object >> Symbol Configuration, a window will appear, click add. Then click compile for the GVL we added to appear, select it and click compile again.
In communication, set MasterTool to simulation mode. Then download the project to the PC >> in Login click "yes" in the next windows >> then set to run
Then download the project to the PC >> in Login click "yes" in the next conversation windows >> then set to run.
2.4. OPC Configuration
Click again on Communication >> OPC Configuration. Make sure the active IP is the IP of your localhost 127.0.0.1 and change the device port to 11739
2.5. FactoryIO Configuration
Open the FactoryIO software as administrator; In the main menu click on Scenes and another screen will appear with the predefined scenes, select the scene 3-Filling tank.
In the upper left corner of the scene screen click on Files >> Drivers. When it opens, click on the arrow on the right side of the search bar and select OPC Client DA/UA. Then click on configuration in the upper right corner of the screen where the driver was selected.
When the configuration window opens, click on OPC Server on the arrow to select the CoDeSysOPC/DA. Click on >> Browser below Items and Nodes. Then click on the >> configuration arrow to return to the drivers menu and the tag names will appear
2.6. Tag Configuration
Then just link the variables to the tags that are predefined by the FactoryIO software, which are in English. Select the tag and drag it to the desired variable. Then click the arrow on the left side of the word DRIVER to return to the simulation screen.
Fill means to fill and Discharge means to empty, so the discharge tags are linked to the empty variables in MasterTool and the Fill tags are linked to the fill variables.
Finally, click Run and split the screen between FactoryIO and MasterTool to monitor the variables.
3. VIDEO
In these videos you can watch the same procedure.
You can also access the channel for more videos like this click here.
Comments
0 comments
Please sign in to leave a comment.