CODESYS: IF-ELSEIF instruction in Structured text programming

  Рет қаралды 26,809

Tohid Alizadeh

Tohid Alizadeh

Күн бұрын

Пікірлер: 16
@jacobksqd
@jacobksqd 2 ай бұрын
Excellent tutorials. Thank you. I am doing all of them. For this tutorial I have 2 suggestions: 1. Use CounterPV within the IF/ELSIF statements instead of Counter01.PV (This way the operations of A, B, C change the preset value) 2. Use smaller PV values in the test of the logic so that you do not need to flip the switch so many times to validate the logic. (IE: 12, 14, 16 instead of 50, 175, 300) After the logic is proven to be correct, adjust the numbers back to the higher values as desired.
@endprg6477
@endprg6477 3 жыл бұрын
Спасибо. Всё наглядно.
@TohidAlizadeh
@TohidAlizadeh 2 жыл бұрын
🙏👍
@LearnSomethingHelpful
@LearnSomethingHelpful 3 жыл бұрын
Nice video Tohid
@darkaster134
@darkaster134 5 жыл бұрын
Hi, could it be possible to have more than one effect if entering the if? For example: IF (A ) THEN (B , C:=FALSE) or something like that
@TohidAlizadeh
@TohidAlizadeh 5 жыл бұрын
Yes, it is possible.
@akperera2663
@akperera2663 2 жыл бұрын
Hi Are you doing the ST programming training session online
@TohidAlizadeh
@TohidAlizadeh 2 жыл бұрын
No, I don't.
@victorponce1065
@victorponce1065 4 жыл бұрын
Hello, how can the functions be used in CFC?
@kalyanikadkol4006
@kalyanikadkol4006 5 жыл бұрын
Hello Tohid, Thanks very much for such an informative tutorial! However, in this case, the Full continues to become true when CV=10 although the PV of the counter gets updated in Counter01.PV depending on the selection between A, B and C. What should be done to update the code such that the CV now considers the new PV whenever the conditions are true and not the PV value initialized in the variable declaration? Your inputs are valuable! Many thanks, Kalyani
@TohidAlizadeh
@TohidAlizadeh 5 жыл бұрын
Thanks for your comment. I believe that you should not do anything and the counter should consider the new PV. I will have a second look at it and let you know if this is not the case.
@kalyanikadkol4006
@kalyanikadkol4006 5 жыл бұрын
Thanks very much for having responded to me! What I meant is if the PV is updated, the CV should consider and turn the counter's output with respect to the new PV, isn't that how it is supposed to work? What happens with the code is that the PV gets updated, but the CV continues to turn the output on for PV = 10. Can you please help me understand how the counter operates? Thanks again for your time!
@IsmailRosli
@IsmailRosli 5 жыл бұрын
@@kalyanikadkol4006 Same, encountered the same issue. Do you happen to find out how to fix it?
@KhairulBasarAbuAbdullah
@KhairulBasarAbuAbdullah Жыл бұрын
@@TohidAlizadeh Corrected: Counter01(CU:=LS1,Reset:=Reset,PV:=CounterPV); IF A THEN CounterPV:=5; ELSIF B THEN CounterPV:=3; ELSIF C THEN CounterPV:=2; END_IF Full:=Counter01.Q;
@elhassanemargoum7955
@elhassanemargoum7955 5 жыл бұрын
Hi Tohid Thank you for this videos I want to know how to program an if statement with multi conditions (if a:=1 & b:=1 then c:=1 else ...)
@TohidAlizadeh
@TohidAlizadeh 5 жыл бұрын
Hi there, I think you can use parentheses to do so: IF (a = 1 AND b = 1) THEN c := 1; ELSIF d=1 THEN . . .
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 676 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 36 МЛН
Codesys #19: Enumeration
16:09
Industrial Automation
Рет қаралды 3,6 М.
CodeSys Structured Text Case Construct 2021 | "Case Of" Example
16:13
PLC Basics: Structured Text
33:31
This is Automation
Рет қаралды 119 М.
Codesys #18 Structure
11:04
Industrial Automation
Рет қаралды 3,3 М.
Learning PLCs with Structured Text - EP5 - Timers and Triggers
13:15
SquishyBrained
Рет қаралды 71 М.
TIA Portal: "IF" "THEN" "ELSE" "ELSIF" Statement in SCL
19:26
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 676 М.