Sign in to follow this  
Followers 0
Stupidav

Understanding / Learning S5 Logic

15 posts in this topic

I am looking at a Print out and I am trying to understand what is happinging and after quite a bit of reading there is still a lot I a am lost at. Segment 2 : UN M 36.0 SPB FB 181 NAME E DB 11 *** Segment 3 : SPA PB 1 *** What is the UN. The M 36.0 is just Memory Bit 0 of Byte 36. I know that the SP* is to call a different areas of code. but what is the difference between A and B in this example. I am not sure what the Name does or the E does. DB 11 is just full of Hex Values (KH 0000 and stuff like that).

Share this post


Link to post
Share on other sites
I think I discovered part of the issue. Ot looks like this printout was done with an aftermarket software. So I have some of this Figured out but here is an other example of a few things that I am trying to get upto speed on: Segment 1 of 5 Lib = Name :E DB 11 :*** Segment 2 of 5 : :L KF 30 :G DB 11 :*** Segment 3 of 5 :C DB 11 :L KT 0350.0 :T DW 7 :L KT 0240.0 :T DW 8 :L KT 0060.0 :T DW 9 :L KT 0000.0 :T DW 11 :L KT 0010.1 :T DW 12 :L KT 0030.1 :T DW 13 :L KT 0000.0 :T DW 14 :L KT 0050.1 :T DW 15 : :L KT 0100.1 :T DW 16 :L KT 0000.0 :T DW 17 :L KT 0000.0 :T DW 18 :L KT 0000.0 :T DW 19 :L KT 0000.0 :T DW 20 : :*** Segment 4 of 5 : :L KT 0000.1 :T DW 21 :L KT 0040.1 :T DW 22 :L KT 0030.0 :T DW 23 :L KT 0005.0 :T DW 24 :L KT 0030.1 :T DW 25 : :L KT 0000.0 :T DW 26 :L KT 0000.0 :T DW 27 :L KT 0000.0 :T DW 28 :L KT 0000.0 :T DW 29 :L KT 0000.0 :T DW 30 :*** Segment 5 of 5 :AN F 36.0 :S F 36.0 : :BE Not sure what the "Name :E DB 11" is. If I understand the Segment 2 We are basically creating DB11 and it will contain 30 words Correct? Segment 3, we are opening DB11, then setting DW7 to = Time Constant = 350.0 ? Segment 5, If Flag 36.0 = 1 then Set Flag 36.0 = 1........... Correct?

Share this post


Link to post
Share on other sites
Segment 5, If Flag 36.0 = 1 then Set Flag 36.0 = 1........... Correct? Wrong, If F36.0 = 0 the set flag F36.0 AN = AND NOT Edited by Moggie

Share this post


Link to post
Share on other sites
Thank You Moogie! What is the Time base for Timers on the S5? Would KT 100.0 = 1 Second?

Share this post


Link to post
Share on other sites
The Time value is made up as follows, KT 100.0 = 100 * 0.01 = 1second. KT 100.1 = 100 * 0.1 = 10seconds KT 100.2 = 100 * 1 = 100 seconds KT 100.3 = 100 * 10 = 1000seconds. Max value for KT = 999 (BCD Format) S5 have the following timers; SD On delay SF Off delay SP Pulse Timer SE Extended Pulse Timer SS Stored On delay

Share this post


Link to post
Share on other sites
Thanks again! Just so I am for sure, 999 would be 999 * 0.01 = 9.99 Seconds Thinking of Timers SP Pulse Timer in the book is described as: Start timer (stored in ACCU 1-L) as pulse (start timer with continuous enable). Does this just give Q a single one time TRUE once the timer Times out? so if KT 999.0....Would mean every 9.99 seconds Q is True for one scan, and as long as it is enabled will it pulse again after another 9.99 Seconds, or does it have to lose the enable to reset it? The last thing, here is teh code from my print out: :L KT 0999.0 :SP T 4 :NOP 0 :NOP 0 :LD T 4 :T FW 54 :NOP 0 A different program (S5 S7 for Windows calls it DEZ) but what is the ":T FW 54" in the timer.... I know that it is moving the value to of DEZ to Word 54, but would that be the time as it is counting value / Accumulative value of the timer?

Share this post


Link to post
Share on other sites
Sorry for all the "Dumb Questions" but I am almost up to speed. Here is one area of the program that I am getting lost in. Segment 1 of 4 Lib = Name :HILFSGDO :*** Segment 2 of 4 :AN F 60.1 :JC =M001 :L FW 54 :T FW 48 M001 :*** Segment 3 of 4 :JU FB 240 Name :COD:B4 BCD : FW 48 SBCD : F 60.2 DUAL : FW 50 :L KM 00000011 11100111 :L FW 50 :-F :T FW 52 :JU FB 241 Name :COD:16 DUAL : FW 52 SBCD : F 60.2 BCD2 : FY 61 BCD1 : FW 18 :JU FB 5 Name :GROBDOS. ANGR : FW 24 ZD+ : F 8.2 ZD- : F 8.3 FRUE : F 7.0 WAAK : I 1.5 ENTL : Q 9.2 KLS : Q 10.1 :*** Segment 4 of 4 :BE If I still don't know what the Name thing is but of I understand Segment 2 it means: If Not F60.1 Then Jump to the next M001 / End of this segment (in this case). Segment 3 First we are jumping to FB240 then I get lost quick, in all the manuals that I have, I can't seem to find any thing on the SBCD or DUAL. Now in FB240 here is the little bit of code, if it helps. Segment 1 of 1 Lib = Name :COD:B4 Decl :BCD I/Q/D/B/T/C: I BI/BY/W/D: W Decl :SBCD I/Q/D/B/T/C: I BI/BY/W/D: BI Decl :DUAL I/Q/D/B/T/C: Q BI/BY/W/D: W :BE ANY help is greatly appreciated!!!

Share this post


Link to post
Share on other sites
Its moving the BCD value of the timer into FW54.

Share this post


Link to post
Share on other sites
I believe NAME = the name of the block you are in. FB240 and FB241 are standard FB's for BCD conversion. Download the manual at the following web address and go to page 374. Siemens Manual I believe you have german symbols, the manual has english, therefore BCD = BCD SBCD = SBCD DUAL = BINARY FB241 is there as well. Your jump to M001 assumption is correct.

Share this post


Link to post
Share on other sites
Not a problem, happy to help.

Share this post


Link to post
Share on other sites
Sorry for the long delay on the Thanks Guys, but Thanks Very Much! So it is the "Current Time" that is refered to on page 216 of the Manual, correct?

Share this post


Link to post
Share on other sites
Back to where I got Lost..... I think I am on track, BCD : FW 48 SBCD : F 60.2 DUAL : FW 50 :L KM 00000011 11100111 :L FW 50 :-F :T FW 52 This is Taking FW48 and F60.2 Converting them to FW50? Then subtracting FW50 from 999 (in binary) placing the result in FW52, Correct? Then :JU FB 241 Name :COD:16 DUAL : FW 52 SBCD : F 60.2 BCD2 : FY 61 BCD1 : FW 18 This is just converting the answer back to BCD, Correct? Then :JU FB 5 Name :GROBDOS. ANGR : FW 24 ZD+ : F 8.2 ZD- : F 8.3 FRUE : F 7.0 WAAK : I 1.5 ENTL : Q 9.2 KLS : Q 10.1 This is Jumping to FB 5 Which uses the next stuff, but the next stuff I don't have a clue. Just incase I am attaching the Print out of the program if that helps. Buehler.pdf

Share this post


Link to post
Share on other sites
I can post the S5 Files if that Helps

Share this post


Link to post
Share on other sites
Yes, please post the program. Look at FB5 (page 37 in your pdf), where ever you see ANGR it actually uses FW 24 ZD+ uses F8.1 ZD- uses F8.2 etc.

Share this post


Link to post
Share on other sites
Here are the Files NONAMEST.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0