Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Faculty of Information Technology

Department of Electrical Engineering and Computer Science

Laboratory work # 3
Configuration of Modicon M340 controller

Done by: Kurmangazy.G


Checked by: Samigulina Z.

Almaty, 2024
Purpose of a laboratory work:
1. Programming using the structured text.
2. Calculation of power consumption table.
3. Ethernet network tuning.
4. Create the visualization of a process.

Objectives:
Obtaining the skills in Modicon M340 controllers configuration and networking
configuration.

Practice tasks
Part 1. Calculation of power consumption of controller.
In first part of laboratory work, I created configuration of the system and calculated
power supply module. Modules that I chose are shown in figure 1.

Figure 1 – Power consumption of system.


1. Processor: BMX P34 2010. For 3.3V0 mA; 24V rack90mA; 24V sensor
0mA.
2. Discrete I/O: BMX DDM 3202K. For 3.3V150mA; 24V rack 0 mA; 24V
sensor  55 mA;
3. Analog I/O : BMX AMM 0600. For 3.3V  150mA; 24V rack  130 mA; 24V
sensor  0 mA;
4. Communication: BMX NOE 0110. For 3.3V  0mA; 24V rack  90mA; 24V
sensor  0 mA;
Total current: For 3.3V: (0+150+150+0)mA= 300 mA.
For 24V rack: (90+0+130+90)mA=310mA.
For 24V sensor: (0+55+0+0)mA = 55mA.
Total consumption voltage: (300*3.3)+(310*24)+(55*24)=1089+7440+1320=
9849mW.
Total power used: (9849/20000)*100= 49.245%.
In the program, in section Power Supply and IO budget shown used and available
power storage.

Figure 2 – Power supply.


Part 2.
In this part, it is necessary to create a configuration of Modicon M340 controller with
processor PLC BMX P34 2010. Then, I opened the configuration window in local
rack and chose modules such as Discrete I/O module (DDM 3202K), Analog I/O
module (AMM 0600) and communication module (NOE 0110).

In the discrete module I should to set following parameters:


1. Input processing task MAST.
2. Indication of power (Supply monitoring)should be active.
Figure 3 – Discrete module parameters.

Next step is setting parameters of processor.


1. The words of internal memory %Mwi in case of “cold” start disabled.
2. The number of internal bits %M–512.
3. The amount of internal memory words %MW-1024.
4. Word Count constants %KW–256
The processors setting shown below in figure 4.

Figure 4 – Parameters of processor.

So, then I should create a network configuration. In section communication, I created


logical network “Ethernet_1”
As a IP Address I took the IP of simulator. So, the IP Address is 127.0.01. Mask of
subnet is 255.255.255.0
The configuration of communication is shown in figure 5.
Figure 5 – Settings of network.

Part 3(Practical part)

In 3rd part, I had some practical exercises and tasks for individual job to learn and get
knowledge about program that written Structured Text programming language.

II Example of task solving usage the construction if ... then ... else
Task 1. You need to enable light, when the button is pressed. For solving this
problem use the RE function (setting the Rising Engine).

The program:
status_button:=button; (*overwrite operation to set edge*)
if RE(status_button) then light:=1; (*condition for turning on the indicator*)
else light:=0; (*condition for turning off the indicator*)
end_if;

Table 1 – variables for solve the problem (EDT)

N name type comments


1 Button ebool Button for pressing
the lamp
2 Status_button Ebool Buffer variable for
working with RE
function
3 light ebool Indicator
Unity Pro realization:
When I push the button, red indicator turning on and button got ‘1’ value. Otherwise,
button got ‘0’ value.

Figure 6 – Program of lamp turning on/off.

Task 2.
It is necessary to create a program in which when you press the button plus
"counter value will be increased on 1, when you click on the "minus", the count is
reduced by 1.
Figure 7 – Program of calculating by 1.

Table 2 – variables for solve problem

N name type comment


1 status_plus Ebool Buffer variable for
working with RE
function
2 status_minus ebool Buffer variable for
working with RE
function
3 plus Ebool Button for increase
counter value
4 minus Ebool Button for decrease
counter value
5 Counter Int Counter

Task 3
It is necessary to create two new counters, one counter will have a format
INT (integer),the second the TIME (time). Counters must increase the value to 1 in
the time interval of 1 second by using the system bit% S6.

Figure 8 – Program for counting time and counter.

Table 3 – Table for solve problem.


Practice task for students:
Task 1. Create a program with two counters. One integer counter, second time
format. It is necessary to program the capacity of counters 60 for the integer and 60
seconds to the counter, working with the format time. Extension counters must
occur in the time interval of 100 ms.
Starting work counters will be carried out after pressing the "START" button, the
counters stop working after pressing the "STOP" button. Create the visualization of
the program.

Figure 9 – Timer with start/stop buttons.

Table 4 – Variables to solve problem.

N name type comment


1 Button_start Ebool Button for turning
on counter and
timer
2 Button_stop Ebool Button for pause
counter and timer
3 Counter_int Int Integer format
counting
4 Counter_time Time Time format
counting
5 Sec1 Ebool variable for storing
the system bit% S6
data
6 Status_button_start Ebool Buffer variable for
working with RE
function
7 Status_button_stop ebool Buffer variable for
working with RE
function

Task 2. Given two indicators of different colors. After pressing the "START" lights
up the first indicator, the second indicator is activated after 5 seconds. Program this
sequence using the counters. Create the visualization screen in real time.

Figure 10 – Indicator of two different color (when red indicator on).


Figure 11 – Indicator of two different color (when green indicator on).

Table 5 – Variables to solve problem.

N name type Comment


1 Lamp_1 Ebool Indicator for green
light
2 Lamp_2 Ebool Indicator for red
light
3 Sec1 Ebool variable for storing
the system bit% S6
data
4 Start_button Ebool Button for turning
on an indicator and
timer
5 Status_start ebool Buffer variable for
working with RE
function
6 Counter_time time Time format
counter

Task 3. Given a counter whose value is incremented by 2 at intervals of1 second as


soon as the value of 100 is achieved, the counter stops. Running counter
operation by using the "START" button. Make visualization of the program.
Figure 12 – Program of counting by 2 until it reach 100.

Table 6 – Variables to solve problem.

N name type comment


1 Counter_int Int Integer format
counter
2 Sec1 Ebool variable for storing
the system bit% S6
data
3 Start_button Ebool Button for start a
timer
4 Status_start ebool Buffer variable for
working with RE
function

Task 4. Default value of the variable is 100. When you press the "START"
button starts the reverse counter report, as soon as the variable value reaches
5, the counter stops and the green color is light. Make visualization of the
program.
Figure 13 – Program of reverse counting with turning on green indicator.

Table 7 – Variables to solve problem.

N name type Comment


1 Counter_int int Integer format
indicator
2 Lamp_1 Ebool indicator
3 Sec1 Ebool variable for storing
the system bit% S6
data
4 Status_start Ebool Buffer variable for
working with RE
function
5 Start_button ebool Button for start a
timer

Conclusion
In this laboratory work, teams were assigned various tasks written in the ST
(Structured Text) programming language using Unity Pro XL software. The
tasks encompassed configuring settings of controller modules in the simulator,
starting from selecting the processor type to simulating the program's
execution. Additionally, participants learned how to calculate the power
consumption of the system using the Modicon M340 catalog.
Moreover, visualization of the process was developed by simulating the data
variables, enhancing understanding and representation of the system's
operation.

You might also like