Converting from S5 to S7 Help

magdy580

Member
Join Date
Oct 2007
Location
Cairo
Posts
5
Hello Guys,
I am converting a project from S5 to S7. The program mostly is composed of binary logic, which is converted without trouble.
The problem is that OB 251 is called within the program. I cannot open OB 251, it seems to be missing or not included in the library.

OB 251 is a PID controller, which is supposed to be replaced with FB 41 - 43 . Is there anything I can do solve the problem in S5 ?

The program structure shows the calling of the blocks with question marks beside OB 251 .

Another question, to what extent do I need to revise the non binary operations ? And do I have to do anything with the DO FW command ? the program is small and I do not have to optimize the memory .

Thanks
 
take care that the parameters in s5 are differnt from s7 and u have to convert the data , there was a document about that in siemens site , i will post it to u if i find it
 
OB251 is an integrated block in S5, it is also protected.
If my memory serves me right it uses parameters in DB1 as the PID etc.
You should use Fb41.
The do fw command is a way of indirect addressing i.e.
L Kf102
T Fw200 (set pointer to 102)
C DB10
DO FW200 (process the instruction i.e. point to dw102 of DB10)
L DW0 (loads DW102 of DB10).
any value 0-255 in a flagword will point to the equivilent word in any DB, Timer Flag etc (on 150-155 CPus 20 bit addressing is sometimes used as DB's can be greater than 255 words).
you have to use the pointer instruction in S7.
siemens tended to use Flags/Flagwords 200 to 255 as scratchpad areas so if using certain standard siemens blocks you should not use these flags throughout the scan.
only used for temporary memory areas.
example: Transfer DB10 DW1 to 200 to DB11 DW1-200)
l kf1 (set pointer to DW1)
T FW200
Back: C DB10 (note jump)
DO FW200
L DW0 (load DWx of DB10)
C db11 (Call DB11)
DO FW200
T DW0 (Transfer the contents of DB10 DWx to DB11 DWx)
L fw200
ADD Bn+1
T Fw200 (Increment the pointer to next word)
L KF+200 (max number of words to transfer)
>F
JC=Skip (Then Skip) (could be BEC instead if you want block to end)
JU=Back (else go back)
Skip:
BE
This cycles 200 times to copy the words in DB10 to DB11
 

Similar Topics

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
318
Hi! I am working on a project were we will be replacing an 300 CPU with a 1500 CPU and we are working on migrating / converting code. There is a...
Replies
9
Views
1,076
Hi! I need help converting an old MicroLogix 1100 project to Micro 820. Project Details I have an old MicroLogix 1100 program that has been in...
Replies
0
Views
473
Hope someone is really bored this late on Memorial day!!! I have spent the last 5 hours researching this and trying everything I could find on...
Replies
9
Views
3,276
I am needing to convert the low DWORD of a timestamp into a LREAL. The DWORD is a 32bit unsigned number. In TwinCat2, I keep getting a negative...
Replies
3
Views
1,683
Back
Top Bottom