SFC 24        Information about DB

Top  Previous  Next

 

With this system function you can find out the length of a DB while runtime. You specify the number of the DB with the parameter DB_NUMBER. The DB has to exist in the PLC, it will not be enough if it is only on the hard disk. The DB will be transfered into the PLC automatically if it is either opened in the editor once or if it is opened by the PLC program. The length (rounded up to the next even number) is given back by the parameter DB_LENGTH. The return value WRITE_PROT is, not like in a S7, always zero, because in TrySim DBs cannot be declared as write-protected.

 

The Out-parameter RET_VAL can have following values:

 

W#16#0000: no errors

W#16#80B1: the DB does not exist

 

The other realized error cases in a S7 are not realized.

 

You can also get to know the length of the currently opened DB or of the current instance DB with DBLG or DILG.

See also:

System Functions

 

S7-300 and S7-400 are registered trademarks of the Siemens AG.