Hello. 1
In this video we are going to learn how to use a st language in delta plcs. 2
I will create a new project and controller type will be AS and the plc type will be AS332T say 3
OK in the project tree we will see program section in the program section already. 4
We are always creating our programs with the ladder language but now we will select structure text 5
language and say OK and we will see complete interface of program is changed than you see now. 6
There is no networks and also the lines. 7
Now we have an editor like C programming or another high level languages programming areas but now 8
we can write our code to here. 9
I will define two variable first variable will be start motor and type will be bool and the second variable 10
will be motor turning forward type will be bool and I will use it in our a still language programming 11
page. 12
If start motor 13
what will happen. 14
Motor turning forward will be 15
and if this is our very basic very similar code. 16
And I will create a device monitor table also to see what will happen in here I will let my identifiers 17
from program 0 motor turning forward then also in here I will select start motor in here also program 18
0 in program section I will go here I will send these codes to our plc now it will send it and transfer 19
it is transferring and transfer is finished I will say run plc start motor what will happen if I say 20
start motor. 21
Now you see it is green now motor turning forward is activated stop motorist high motor turning forward 22
is high start motorist set off but motor turning is still forward. 23
Why. 24
Because it is similar in the if loop it reads start motor then motor turning became through and then 25
start motor is gone. 26
But what will happen. 27
We didn't put anything else. 28
Let us put something else in here else if not start motor means motor turning 29
forward will be false. 30
So let's take a look again and say okay in here I made a mistake. 31
Now go on line 32
and yes it is transferring this project and project is transferred to simulator. 33
Now you see motor turning is false because of here start motor and motors turning forward and somebody 34
released push button start motor and motor turning forward this false and now I will open my online 35
it area and use timer if if not start motor 36
so I can write the here 37
let's run our timer 3 second and else t 0 will be 0 and if so what will happen now. 38
Let's take a look. 39
I will send this to missing error. 40
command that else because of why?should I use this. 41
Let's take a look now. 42
Yes I forgot it then update is completed now. 43
So it is 30 because of motors start this of I Will Run motor start set on you say it is zero. 44
Motorist turning forward and forward and forward then look this timer if start motor is goes off timer 45
is counting counting and counting and now our time worries on so I will go I do it again in here according 46
to timer 47
We will get system error 48
message how it will work if t 0 then I will create a two more or one more variable in here but now 49
we are at on line it at mode so it is not possible so I will say go off line and I will say no if timer 50
done then time timer coming. 51
Start motor then start motor is off so motor is stopping we will create these variable motor stop and 52
type will be bool and say OK motor 53
will be true else motor stopped falls end_if, send changes to our simulator or in the reality 54
plc doesn't matter. 55
Yes I want to download the execution code now it's transferring our code to plc. 56
It is sended and you see timer started to count that it's okay time is high and time high. 57
Motor stop this high. 58
You see now Motorstop. 59
And if I say start motor now you see motor stopped is still true and we need to see why it is not stopped. 60
This is another one question but in here start motor is okay motor is turning forward. 61
If not start motor so stop motor is coming timer 62
Didn't came(high) but in here we set timer is timer0 is should be zero but the timers contact is not 63
not reset. 64
So we need to reset this timer but this is another one point for a moment. 65
Doesn't matter. 66
If timer contact is goes off that moment they will say motor stop will be false. 67
That's all but these are if loops and in here we have if repeat and while and for and case loops for example 68
I can create in here just briefly and other one thing. 69
How can I say for example steps. 70
And this will be word and I can use it. 71
Case steps of like this. 72
And then for example 10 I can say start. 73
Will be true 74
case. 75
So what will happen. 76
I will go online again and I will send these things to the case because integer expressions so I need 77
to change it to integer it s okay and go on line again. 78
And yes right. 79
This project to my plc and it's downloading 80
yes. 81
So now you see our steps as integer is 0. 82
So I will say change present value to 10. 83
What will happen now. 84
Let's focus to here. 85
You see now motor is 2 because a step ten is activated and now it is to say 9. 86
And you see it is still true because we didn't reset it . 87
So what will happen if start motor set of timer will count and etc. our motors stop falls or true 88
commands an etc.. 89
But my idea my goal in this video to show you how to create and a step programs and how to write is 90
the language programming and how is the structure of a still language. 91
This is there is still language you can add in here if and case and repeat file and for loops and they 92
can continue to write our projects or programs I'm using for st languages to met instructions but 93
in the detail st videos and the in advance st commands and the usage of st commands we will 94
will look them all in the one by one in the next videos for this video I'm finished here. 95
This one's the just for the show to you st basics. 96
So we already learned how to create st program and have to add variables in st languages 97
and how to use it and how to set on and set off of ,true and false and the cases and the loops. 98
So I'm finished for this video. 99
See you in the next video.