You are on page 1of 7

1/7/2021 DM-SIM Tema3

Project Path: C:\Users\Gabi\Desktop\temp\SASP\Lab_Tema3_DoMore\Tema3.dmd


Save Date: 01/07/21 22:58:25
Creation Date: 12/16/20 09:45:58
PLC Type: DM-SIM
Class ID: Do-more Simulator
Link Name:
Do-more Technology Version: 2.7
Description:
Version:
Company:
Department:
Programmer:

Page 1
1/7/2021 DM-SIM Tema3

--- System States Short Description ---


- State = 0 --> the system is stopped;
- State = 1 --> the box is taken to the filling point;
- State = 2 --> the box is being filled;
- State = 3 --> the box is taken to the exit point;
-------------------------------------------------------

$FirstScan
ST0 MOVE Move Value
1
Source 0x0
Destination State

--- Coil Reset ---


Reset the Ouput Coils when the System State has changed
coil_reset
C0 GOTO Go To Label
2
Label 1

Local S0:oPT0
$Off Light_RUN
ST2 Y0
3 OUT

Local S0:oPT1
Light_FILL
Y1
OUT

Local S0:oPT2
Light_FULL
Y2
OUT

Local S0:oPT3
Motor_ON
Y3
OUT

Local S0:oPT4
Valve_OPEN
Y4
OUT

$On coil_reset
ST1 C0
4 RST

Page 2 $Main
1/7/2021 DM-SIM Tema3

--- State Switch ---

LABEL Program Label


Label 1

State
V0 0x0 GOTO Go To Label
6
Label 2

State
V0 0x1 GOTO Go To Label
7
Label 3

State
V0 0x2 GOTO Go To Label
8
Label 4

State
V0 0x3 GOTO Go To Label
9
Label 5

$On error
ST1 C1
10 OUT

GOTO Go To Label
Label 0

--- State 0 ---


- all outputs are LOW;
- when Button_START is pressed, the current state of the system is checked and an
appropriate State value is chosen.

LABEL Program Label


Label 2

Page 3 $Main
1/7/2021 DM-SIM Tema3

Local S0:iPT0 Local S0:iPT2


Button_START Sensor_Prox MOVE Move Value
X0 X2
12
Source 0x1
Destination State

Local S0:iPT0 Local S0:iPT2 Local S0:iPT3


Button_START Sensor_Prox Sensor_Level MOVE Move Value
X0 X2 X3
13
Source 0x2
Destination State

Local S0:iPT0 Local S0:iPT2 Local S0:iPT3


Button_START Sensor_Prox Sensor_Level MOVE Move Value
X0 X2 X3
14
Source 0x3
Destination State

$On
ST1 GOTO Go To Label
15
Label 0

--- State 1 ---


- the conveyor belt is ON;
- Mode A, B: when the box reach the filling point: State = 2.

LABEL Program Label


Label 3

Local S0:oPT0
$On Light_RUN
ST1 Y0
17 OUT

Local S0:oPT3
Motor_ON
Y3
OUT

Page 4 $Main
1/7/2021 DM-SIM Tema3

Local S0:iPT2 Local S0:iPT4


Sensor_Prox Switch_ModeA MOVE Move Value
X2 X4
18
Source 0x2
Destination State

Local S0:iPT5
Switch_ModeB coil_reset
X5 C0
SET

$On
ST1 GOTO Go To Label
19
Label 0

--- State 2 ---


- the product valve is OPEN;
- Mode A: when the box is completely filled: State = 3.
- Mode B: when the box is completely filled and the Start_Button is pressed: State = 3;

LABEL Program Label


Label 4

Local S0:oPT0
$On Light_RUN
ST1 Y0
21 OUT

Local S0:iPT5 Local S0:oPT1


Switch_ModeB Light_FILL
X5 Y1
22 OUT

Local S0:iPT3 Local S0:oPT4


Sensor_Level Valve_OPEN
X3 Y4
OUT

Local S0:iPT3 Local S0:iPT5 Local S0:oPT2


Sensor_Level Switch_ModeB Light_FULL
X3 X5 Y2
23 OUT

Page 5 $Main
1/7/2021 DM-SIM Tema3

Local S0:iPT3 Local S0:iPT4


Sensor_Level Switch_ModeA MOVE Move Value
X3 X4
24
Source 0x3
Destination State

Local S0:iPT3 Local S0:iPT5 Local S0:iPT0


Sensor_Level Switch_ModeB Button_START coil_reset
X3 X5 X0 C0
SET

$On
ST1 GOTO Go To Label
25
Label 0

--- State 3 ---


- the conveyor belt is ON;
- when the box exits the system: State = 1.

LABEL Program Label


Label 5

Local S0:oPT0
$On Light_RUN
ST1 Y0
27 OUT

Local S0:oPT2
Light_FULL
Y2
OUT

Local S0:oPT3
Motor_ON
Y3
OUT

Page 6 $Main
1/7/2021 DM-SIM Tema3

Local S0:iPT2
Sensor_Prox MOVE Move Value
X2
28
Source 0x1
Destination State

coil_reset
C0
SET

$On
ST1 GOTO Go To Label
29
Label 0

--- Check Operator Inputs ---

LABEL Program Label


Label 0

Local S0:iPT1
Button_STOP MOVE Move Value
X1
31
Source 0x0
Destination State

coil_reset
C0
SET

32 NOP

Page 7 $Main

You might also like