Unlinked DB's in S7

Borte

Member
Join Date
Feb 2004
Location
Norway
Posts
238
Hello guys!

I have another S7 question... (as always)

How do I use a unlinked DB? I'm trying to copy data to a unlinked DB using SFC20 as stated in the help file but it's only returning a unknown error code.

Have anyone in here used unlinked DB's?

Regards
Borte
 
you mean a multible DB that isn't assigned to a FB or something????
little more info would help i think
 
He means "unlinked", which is a property you can set for each DB:
In the Manager, open the properties for the DB and open the "General - Part 2" tab.
It means that the DB will exist in the Load memory and not the Work memory.
 
Hello JesperMP!


The error code SFC20 is giving is: -32476(dec) or FFFFFFFFFFFF8124(hex).

And that code is not in the documentation from Simens.

According to the help all I have to do to access it is use SFC20 but do I have to open or load this DB first?

Btw: I'm trying to both read and write to this DB

Cheers
Borte
 
Last edited:
It is downloaded and everything seems to be fine.

It just get this error when I'm trying to access it with SFC20.

What exactly does "range error when reading a parameter" mean? My address range is wrong?
 
I don't see where the error would be:

Here's the program (DB203 is in the work memory and 205 is in the load memory).

It's giving the same error on both calls.

CALL SFC 20
SRCBLK :=DB203
RET_VAL:=#RetVal
DSTBLK :=DB205
CALL SFC 20
SRCBLK :=DB205
RET_VAL:=#RetVal
DSTBLK :=P#DB203.DBX8.0 BYTE 5992
 
Hi Borte


I'm not convinced that you can write back to an unlinked DB in load memory using SFC20. I believe the intention was for these DBs to be used for holding, say, recipe values or process parameters etc and you would read them in to a working DB in work memory when required.

Depending on the CPU you're using however, the newer CPUs with the MMC micro memory cards have other SFCs (82, 83 and 84) which create, read and write DBs held on the MMC.

I've never tried using them, but it might be worth a quick test.

regards

Ken
 
Ken, you may be right.

From the online help on unlinked DB's:
Depending on the CPU, the contents of such a DB can only be transferred to the working memory by using SFC 20 BLKMOV or SFC 83 READ_DBL.
It sounds like the direction of the datatransfer is from load mem to work mem only.

edit:
Here is a quote from the online help for SFC20:
The source parameter can be a part of the data block in the load memory which is not relevant to program execution (DB compiled with the keyword UNLINKED).
This also seems to confirm that it goes in one direction only.
 
Last edited:
Hello guys!


I tried using the sfc84 "WRIT_DBL" which according to the help file would give write access to the load memory db's but it still gives me an error. The error is 2560 dec (A00 hex).

Here's the program

CALL SFC 84
REQ :=M200.0
SRCBLK :=DB203
RET_VAL:=#RetVal
BUSY :=#Busy
DSTBLK :=DB205
 
Hello guys;
Something nags at me when I read the following code:
CALL SFC 84
REQ :=M200.0
SRCBLK :=DB203
RET_VAL:=#RetVal
BUSY :=#Busy
DSTBLK :=DB205

Shouldn't SRCBLK and DESTBLK be ANY pointers; it seems to me that they should be written something like:
SRCBLK := P#DB203.DBX0.0 byte 200

If I am right, that might explain the Range error message borte recieves, no? What do you think? I hope this is relevant to the current problem.

Hope this helps,
Daniel Chartier
 
I'm about half an hour to late on this Thread, every time I read a post and think, "Oh, I think I know the answer to that" then goto the next post and find that Jesper or Ken has beaten me to it!
a020.gif


But finally I found something!

Btw: Reading in the help file of SFC84 i came across this:


Quote:

8092 Windows NT operating system has crashed (blue screen)

According to my German Helpfile for SFC84, 8092 means that the CPU has gone into STOP and this message is delivered after the CPU goes back into run.
 

Similar Topics

I have a programm in a Siemens S7 313C CPU that stores recipe-data in and extracts recipe-data from an unlinked datablok. With an unlinked...
Replies
0
Views
1,680
Back
Top Bottom