Introduction to the course
Codesys environment installation03:26
Discord support group01:05
What is Codesys and ST programming language04:08
Knowledge test
Homework assigment – OR logic gate and modify visu04:14
Variables
Memory units, variable and constant definition03:12
BOOL variable declaration in Codesys03:06
Integer variables – introduction02:52
Integer variables – exceeding the range07:52
Notation in number system05:10
Real variables01:54
Arrays04:58
Structured type04:45
Local and global variables04:21
Variables – Knowledge Test
Variables Homework04:31
Operators
Assignment operator06:15
Arithmetic operators06:29
Logical Operators06:01
Operator Priorities01:46
Operators – Knowledge Test
Program flow control instructions
IF statement05:25
IF, ELSIF, ELSE statement05:50
FOR loop06:15
Project: Three-position temperature controller in the control cabinet06:53
Quiz – IF, CASE, and FOR instructions
Project: Pump station project
Project description05:47
Pump Station Project Structure01:55
Function Block: Water Generator01:41
Function Block: Pump Operation10:10
Main program07:29
Visualization pattern03:48
Visualization project03:15
Alarm programming05:31
Pump Station Homework Assignment01:39
Project: Lights control for Smart Home
Monostable Button Light Control05:57
Light intensity control08:21
Homework assigment: Radio buttons02:45
Bonus module
Create budget PLC from RPi00:00
Download and install CODESYS runtime for RPi00:00
Configure GPIO of RPi (inputs/outputs)00:00
Communicate RPI via Modbus with external devices00:00
Create a web visualization with graphs00:00
Get a support on Discord channel with your RPi projects00:00
Function Block: Pump Control
// variables
VAR_INPUT
xEnable:BOOL; // decommissioning of control block
rCurrentLevel:REAL; // current liquid level in the tank
rActivationLevel_1:REAL:=2; // activation level for pump1
rDeactivationLevel_1:REAL:=1; // deactivation level for pump1
rActivationLevel_2:REAL:=4; // activation level for pump2
rDeactivationLevel_2:REAL:=3; // deactivation level for pump2
rActivationLevel_3:REAL:=5; // activation level for pump3
rDeactivationLevel_3:REAL:=4; // deactivation level for pump3
END_VAR
VAR_OUTPUT
xPumpStart_1:BOOL; // activate pump no.1
xPumpStart_2:BOOL; // activate pump no.2
xPumpStart_3:BOOL; // activate pump no.3
END_VAR
VAR
rLevelMeters:REAL; // Liquid level in meters
END_VAR
// code
// Converting water level to meters
rLevelMeters := rCurrentLevel / 100;
IF xEnable THEN
// Filling conditions in automatic mode
IF rLevelMeters >= rActivationLevel_1 THEN
xPumpStart_1 := TRUE;
ELSIF rLevelMeters < rDeactivationLevel_1 THEN
xPumpStart_1 := FALSE;
END_IF
IF rLevelMeters >= rActivationLevel_2 THEN
xPumpStart_2 := TRUE;
ELSIF rLevelMeters < rActivationLevel_2THEN
xPumpStart_2 := FALSE;
END_IF;
IF rLevelMeters >= rActivationLevel_3 THEN
xPumpStart_3 := TRUE;
ELSIF rLevelMeters < rDeactivationLevel_3 THEN
xPumpStart_3 :=FALSE;
END_IF;
ELSE
xPumpStart_1 := FALSE;
xPumpStart_2 := FALSE;
xPumpStart_3 := FALSE;
END_IF