Need help to structured text

This is the code:
Code:
if r1_rls then
   if as_rbr then
      r1_rls := 0;
   else    
      r1_rls := 1;
   endif
else
   if as_lbr then
      r1_rls := 1;
   else
      r1_rls := 0;
   endif
endif
To know what it does you have to know what r1_rls, as_rbr and as_lbr are.
Otherwise the code does what it says it does.

Search for "if then else" statement on the net if you don't know how it works.
It works the same in all computer languages.
 
Last edited:
Code:
[FONT=Lucida Console]
   r1_rls      as_rbr     r1_rls
+---] [---------]/[----+---( )--
[/FONT][FONT=Lucida Console][FONT=Lucida Console]|[/FONT]                      |
[/FONT][FONT=Lucida Console][FONT=Lucida Console]|[/FONT]  r1_rls      as_lbr  |
+---]/[---------] [----+[/FONT]
Nice work Steve.
It shows how verbose structured text can become when doing logic with it.
 
Last edited:
Reminds me of a training course I went to on Steeplechase software many years ago. Steeplechase was flow charting software touted as an alternative to ladder logic. The pitch was that ladder logic required "specialized knowledge" to understand whereas flow charting was more intuitive. The first lab exercise was to do a simple start/stop seal-in circuit using a flowchart. It took a couple of pages to write it and the end result was pretty ugly. I made the mistake of pointing out that it was a clear case where ladder logic was a better tool for the application. The instructor gave me a dirty look and refused to deviate from the company line that relay ladder logic was dying as an automation programming language and that anyone still using it had better wake up to that fact before they found themselves out of a job. That was 25 years ago.
I'm not saying there is no place for structured text. There are many applications where it is a better fit. This just wasn't one of them.
 
this structured text is for one of steps of the initializing setup .
the program is running very well so far, since i am not the programmer who programs it. it gives me some confusion.after I read some more rest of the programs, now I understand a little better.
thanks to everyone to help me!
 

Similar Topics

Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
7
Views
76
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
47
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
308
Hello, I am programming in S7-1500, V17. I have some blocks from a drive manufacturer that are not compiling and giving me an error "Invalid...
Replies
2
Views
299
Back
Top Bottom