I used a really simple db deleting block in STL using SFC21 SFC24, Unfortunately siemens removed the stl support with s7-1200 and also there is no FILL_BLK using any pointer.
So, anyway i'm trying to make an SCL program with input of DB number and a byte which is used to fill the db with.
S7-1200 Fill db with 0
-
- Posts: 104
- Joined: Sat Jun 13, 2009 12:25 pm
- Location: Europe
Re: S7-1200 Fill db with 0
Hello,
you can find below an exemple.
Best regard
you can find below an exemple.
Code: Select all
// DB number INT TO DINT
#Num_DB := INT_TO_DINT(#DB_NR);
// Write 16#0 for each byte of DB
FOR #i := #Start_Byte TO #Start_Byte + #Byte_Count BY 1 DO
POKE(area:=16#84, dbNumber:=#Num_DB, byteOffset:=#i,value:=16#0);
END_FOR;