You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 5th, 2006, 08:10 AM   #1
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
S5 Functinoblock Question

Hello..

Right now im gonna convert my S5 Functionblocks to S7..
But I cant translate 2 words in the S5 FB declaration area.

IB = input byte
B = byte
IW = Input word

but hmm ?? IWI = ??
IBI = ??
  Reply With Quote
Old February 5th, 2006, 08:17 AM   #2
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
I dont get this at all. ?

M001: ?? what does it stand for


Quote:
;
NAME: LOADSH1
DECL: DBLS B
DECL: DBG1 B
DECL: G1KW IW
DECL: G1LS IBI
DECL: DBG2 B
DECL: G2KW IW
DECL: G2LS IBI
DECL: DBG3 B
DECL: G3KW IW
DECL: G3LS IBI
DECL: DBG4 B
DECL: G4KW IW
DECL: G4LS IBI


AN =G1LS
JC =M001
DO =DBG1
L =G1KW
DO =DBLS
T DW 1
T DW 11
L KF +1
T DW 16
JU =M002
M001: DO =DBG1
L =G1KW
DO =DBLS
T DW 1
L KF +0
T DW 11
T DW 16

M002: AN =G2LS
JC =M003
DO =DBG2
L =G2KW
DO =DBLS
T DW 2
T DW 12
L KF +1
T DW 17
JU =M004
M003: DO =DBG2
L =G2KW
DO =DBLS
T DW 2
L KF +0
T DW 12
T DW 17

M004: AN =G3LS
JC =M005
DO =DBG3
L =G3KW
DO =DBLS
T DW 3
T DW 13
L KF +1
T DW 18
JU =M006
M005: DO =DBG3
L =G3KW
DO =DBLS
T DW 3
L KF +0
T DW 13
T DW 18

M006: AN =G4LS
JC =M007
DO =DBG4
L =G4KW
DO =DBLS
T DW 4
T DW 14
L KF +1
T DW 19
JU =M008
M007: DO =DBG4
L =G4KW
DO =DBLS
T DW 4
L KF +0
T DW 14
T DW 19

M008: DO =DBLS
L DW 11
L DW 12
+F
T DW 21

L DW 13
L DW 14
+F
T DW 22

L DW 21
L DW 22
+F
T DW 23

L DW 16
L DW 17
+F
T DW 24
L DW 18
L DW 19
+F
T DW 25
L DW 24
L DW 25
+F
T DW 26

A(
L DW 26
L KF +0
>F
)
JC =M009

L KF +1
T DW 26


M009: JU FB 243
NAME: DIV:16
Z1 : DW 23
Z2 : DW 26
OV : F 0.3
FEH : F 0.3
Z3=0: F 0.3
Z4=0: F 0.3
Z3 : DW 27
Z4 : DW 30

BE

Last edited by JIMCON; February 5th, 2006 at 08:20 AM.
  Reply With Quote
Old February 5th, 2006, 08:20 AM   #3
jvdcande
Member
Belgium

jvdcande is offline
 
jvdcande's Avatar
 
Join Date: Apr 2002
Location: Menen
Posts: 2,176
JIMCON

If you're declaring inputs and outputs for your function block you also have to declare the size: BI for bit, BY for byte, W for word and, if using a 135 or higher D for double. So, IBI in fact is I BI or Input Byte and IW is I W or Input Word.

M001 is a label. You can let the program execution jump to a label with the instructions JC <label> (conditional) or JU <label> (unconditional).

The jump to FB243 can be translated to S7 by a simple integer division ( /I ), so you don't have to translate FB243 at all. That would even be impossible, because that's a propietary routine from Siemens embedded in the operating system ROM of the S5 PLC.

Kind regards,
__________________
Jean Pierre Vandecandelaere
Professional expert industry
VDAB Hoofdbestuur
Gasthuisstraat 31 - 10e verd
B-1000 Brussel
Belgium

Last edited by jvdcande; February 5th, 2006 at 08:26 AM.
  Reply With Quote
Old February 5th, 2006, 08:54 AM   #4
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
Unhappy

Thanx alot jvdcande.

I guess i have to spend the rest of the week understand how these FBs works in S5 contra S7..

Aaah Headache I dont like S5 at all lol ...
If u got some good links to pages with some help pdfs just post it up

Last edited by JIMCON; February 5th, 2006 at 08:57 AM.
  Reply With Quote
Old February 6th, 2006, 03:00 AM   #5
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
Are you using the S5->S7 translator provided in Simatic Manager ? This will give you the S7 equivalent of S5 where possible. Any areas that will not translate will be highlighted and will give you a further list of queries.
  Reply With Quote
Old February 6th, 2006, 07:26 AM   #6
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
It only work on basic instructions. It dont work on the code above.
Speaking about the S5 code above. I now atleast know that "DO" means Indirect adressing.

Last edited by JIMCON; February 6th, 2006 at 07:28 AM.
  Reply With Quote
Old February 6th, 2006, 07:46 AM   #7
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
This is waht i have understod of the code above.. But cant find the way to translate t to S7..



Quote:


..........AN =G1LS <-- If not G1LS
..........JC =M001 <-- Jump M001
..........DO =DBG1 <-- Point at DBG1
..........L =G1KW <-- Load G1KW
..........DO =DBLS <-- Point at DBLS
..........T DW 1 <-- Transfer contents of ACCU1 to DW 1
..........T DW 11 <-- Transfer contents of ACCU1 to DW 11
..........L KF +1 <-- Load konstant +1 into ACCU1
..........T DW 16 <-- Transfer contenst of ACCU1 to DW16
..........JU =M002 <-- Jump to M002
....M001: DO =DBG1 <-- Point at DBG1
..........L =G1KW <-- Load G1KW to ACCU1
..........DO =DBLS <-- Point at DBLS
..........T DW 1 <-- Transfer contents of ACCU1 to DW 1
..........L KF +0 <-- Load constant +0 into ACCU1
..........T DW 11 <-- Transfer contents of ACCU1 to DW 11
..........T DW 16 <-- Transfer contents of ACCU1 to DW 16
  Reply With Quote
Old February 6th, 2006, 08:30 AM   #8
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
DO =DBG1 means process the block passed as a formal operand. In this example, DBG1 is a data block. To do the same in Step7, declare a parameter of type BLOCK_DB (e.g. DBG1) and then use OPN #DBG1
  Reply With Quote
Old February 6th, 2006, 12:04 PM   #9
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
Ok shall I declare it in TEMP as a Word then..?

U mean like this ?

AN #G1LS
JC M001
OPN DB [#DBG1]
L #G1KW
OPN DB [#DBLS]
T DBW 1
T DBW 11
L 1
T DBW 16
JU M002

Last edited by JIMCON; February 6th, 2006 at 12:16 PM.
  Reply With Quote
Old February 7th, 2006, 03:47 AM   #10
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
I put the following code through the S5 to S7 converter:
Code:
Name :BERT 
Decl :DBLS I/Q/D/B/T/C:B																								 
	 :																														 
	 :DO =DBLS																												
	 :L DW  1																											 
	 :BE
and here is what it produced with no errors:

Code:
 
FUNCTION FC 67 : VOID
  NAME: BERT
  VAR_INPUT
	DBLS	  :block_db;  // DBLS
  END_VAR
  BEGIN
  NETWORK
	   //;
	   OPN #DBLS ;
	   L   DBW 2;
  
  
END_FUNCTION
I strongly recommend you use the convertor and then resolve each conversion issue as reported.
  Reply With Quote
Old February 7th, 2006, 11:53 AM   #11
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
So it is possible to paste specific code into the S5 file converter. ??
I thought you only could convert whoe projects ?

Ahh uhhmm forget what i said... now i know how u did..

Last edited by JIMCON; February 7th, 2006 at 12:00 PM.
  Reply With Quote
Old February 7th, 2006, 12:18 PM   #12
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
But what happens when I declare a varialbe as BLOCK_DB ??
  Reply With Quote
Old February 7th, 2006, 02:55 PM   #13
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
When you call the block, the parameter you will enter will be a data block, DB25 for example.
  Reply With Quote
Old February 7th, 2006, 06:16 PM   #14
JIMCON
Member
Sweden

JIMCON is offline
 
Join Date: Sep 2005
Location: SWEDEN
Posts: 124
Quote:
When you call the block, the parameter you will enter will be a data block, DB25 for example.
Ok do I have to create this DB ? Or is it created..

Anyway I took your advice and used the konverted file.. And it worked as u said Thank u so much for that help. But now im facing another problem.
I now have the FB56 ready and inserted in my FC55, and i have tied all variables to it except the ones that are word "input and "output pins. The case is that in the blocks in S5 they have just entered (ex. DW 153) on an input pin. But when i want to do the same in S7 (ex. DBW 153) on an input pin, it doesnt accept this.??

Maybe i have to create a DB and declare all the DBWs ?? (ex. DB150.DBW153) or shall i use MW ?? is it the same ?

Hmm but then i have to open that DB every time i want to write to a DBW ..

Last edited by JIMCON; February 7th, 2006 at 06:28 PM.
  Reply With Quote
Old February 7th, 2006, 07:11 PM   #15
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
S5?

Yeah, it works... eventually, but only after a great deal of mental mind-f'ing... or rather, mind-bending.

But I've always had to wonder... what the hell were they smokin' when they came up with that particularly obtuse way of looking at logic, logical elements, and logical functions?

If you are switching to an S7-2XX then you will be mightly impressed with the difference. Once you shake the S5-think, you will find that you can think more rationally, and more easily... without all of the mind-.... bending.

However, if you are switching to an S7-3XX or -4XX... well, you won't be moving far from where you were. In that case... too bad for you.

It's a damned shame that Siemens is trying to down-play and, probably, eliminate the S7-2XX line. They stumbled onto the best development philosophy when they bought the TI line... and now they are running it into the ground... to ultimate elimination.

Are all Europeans this crazy? Or is it only the Germans?

My main process was designed and built by a German concern. After we ran it for a while according to their "think"... we had at it, in a practical sense. Control-wise, and maintenance-wise, they wouldn't recognize it now.

So... is it all Europeans, or is it just the Germans?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Quick S5 DW question Johnny T LIVE PLC Questions And Answers 5 August 2nd, 2005 03:38 AM
Question on S5 & S7 Conflict hagos LIVE PLC Questions And Answers 3 May 23rd, 2005 03:51 AM
Quick S5 DataBlock question Johnny T LIVE PLC Questions And Answers 4 April 24th, 2005 09:25 AM
Siemens S5 question Potter LIVE PLC Questions And Answers 8 February 8th, 2005 01:00 PM
S5 STL question on 95U Johnny T LIVE PLC Questions And Answers 7 October 21st, 2004 04:54 AM


All times are GMT -5. The time now is 09:25 AM.


.