Article translated with the assistance of AI tools. Images and parts of the content will still be reviewed.
In this tutorial, you will learn the guidelines and procedures to simulate a simple logic and communicate
Components
Software: MasterTool IEC XE 3.34; FluidSIM 4.2.16.0
PLC: For this simulation, it is not necessary to have a physical PLC
Tutorial Sections
1. ARCHITECTURE
2. DEVELOPMENT
2.1 Creating a new project in Mastertool
2.2 Add GVL
2.3 Add device
2.4 OPC Configuration
2.5 FluidSIM Configuration
3. VIDEO
1. ARCHITECTURE
For this communication, only the MasterTool and FluidSim software are required. It is not necessary to have a physical PLC, as it will be executed in simulation mode. This simulation can be done with other components.
2. DEVELOPMENT
The simulation will be based on the simple logic of activating a piston
2.1. Creating a new project in Mastertool
Open MasterTool as administrator and create a new project by clicking on "New Project", enter the name and the folder path where you want to save it.
For this simulation with MasterTool and FluidSim, we will use the XP 340 and the programming language in LADDER; click next ensuring that 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. For this, you need to right-click on Application >> Add objects >> Variable list. Name the list with the name you want, without spaces or special characters, then click "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 below.
Two variables of type byte will be declared and for the simulation we will access their bits
In UserPrg we will make a simple logic to activate a coil. Select the first network (line) and place a normally open contact (1), then click on the white rectangle and the other components will be enabled again to be inserted. Do this and build the logic as shown on the side.
Then name the contacts and coils, accessing each bit of the input and output bytes declared in the GVL.
The variables should be, for example:
GVL_Name.INPUT.0 // Accessing bit zero of the INPUT variable
GVL_Name.OUTPUT.0 // Accessing bit zero of the OUTPUT variable
2.3 Add device
With the variables declared, add the Symbol Configuration object to 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, put MasterTool in simulation mode. Then download the project to the PC >> in Login click "yes" in the next conversation windows >> then set to run.
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
Open the FluidSim software as administrator; Add a sheet by clicking on the symbol in the upper left toolbar. If the sheet margins appear in the drawing, click on File >> Drawing Size and configure the sheet size.
After adding the sheet, click the Common Files tab and add the input and output modules found in EasyPort/OPC/DDE. Click one module at a time and drag it to the screen.
The 24V and 0V power supply will be added. Found in Electrical controls >> power Supply. Represented as shown in the image on the side.
All components are inserted by dragging them to the drawing screen
Next, two normally open buttons will be added and should be placed on the same input bit as in MasterTool (input.0 and input.1)
The normally closed button in MasterTool must physically be normally open, otherwise the coil will never be activated since electricity already starts passing through the normally closed contact, opening it.
And we will add a solenoid that must be positioned on the same output bit as in MasterTool. To add the connection lines just click on one of the points (dot at the end of each component) and drag it to the other point of the component where the connection will be made.
A solenoid is an electrical component used to activate and deactivate pneumatic or hydraulic piston valves
To monitor the state change of a solenoid we will use a 3/2-way valve and a single-acting piston. The components are found as shown in the image on the side. To configure the exhaust (3) double-click on the "dot" and a window will open where you will select the type of exhaust.
For the piston and valve to work, it is necessary to add a pneumatic station and the compressor.
It is necessary to configure the valve. To do this, double-click on it and the window shown on the side will appear. Select the option Spring-returned and in the option electrivally select the rectangular symbol. Then click OK
After configuring the valve, double-click the "dot" on the solenoid symbol and name it, after that click OK
Next, double-click on the solenoid that is connected to the module and name it with the same label given to the solenoid on the valve, then click OK.
2.5 FluidSIM Configuration
In options >> click on EasyPort/OPC/DDE connection >> change to OPC mode and click OK
Double-click the input module and then click Browser. Select the option CoDeSys.OPC.DA and click OK
After selecting CoDeSys.OPC.DA in Browse. In the Item line, we will select the Tag. In Root >> PLC >> Application >> click on GVL and select the input tag. Click OK and close both windows.
Finally, do the same configuration sequence for the module below changing only the tag to OUTPUT.
To run the project just click the arrow in the upper corner of the taskbar or press the F9 key on the keyboard. A message will appear, click OK and split the screen between MasterTool and the FluidSim drawing screen to monitor the simulation.
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.