How to move DB's

jackhenkel

Member
Join Date
May 2012
Location
Grand Rapids
Posts
62
How can I change the name of a DB without having to go through every line of code and changing the inputs and outputs using that DB. EX: If I change DB101 to DB201 then every input that was connected to DB101 is no longer usable.
 
I don't have access to Step 7, so cannot be sure on the buttons.

For Symbolic programming, I believe you right click on the folder that contains the blocks and select properties. The last tab shows the programming priority selections, it will have 4 squares, each with a click point in, the default is the top left (address priority), I always change to the bottom right (symbolic priority).

Once you have done that, it means that when you regen, the addresses will follow the symbol.

So now you could go to the symbol table and change the DB address, but then you would have to re-gen (or go to every instance of the DB usage).

I'm not sure what the official name of the regen function is, I do know you get to it from the the top drop down menu's. Its a function that shows the code in its structure and highlights any errors in the blocks, within that there's the regen option, do the regen and the code will be updated.

Save and download.


Of course you woluld have to be carefull downloading, it would be better with the process stopped, as the code will download errors may occur in the PLC if running.


Hopefully someone else who knows what I am talking about here will read the thread and correct anything. Its useful to know this especially, if like me when coding in S7, you use a lot of UDT's.
 
I have never used the symbolic priority option so cannot comment, however, here is one method.

My example only contains OB1 that references DB101 but the principal remains the same.

db001.JPG
 
You have to enter an Object name for the source code - I've used the name "Code". Note that the source will be created in the sources folder.

db003.JPG
 
Click on OK and your blocks will appear on the Left hand side - select the blocks that reference the DB you wish change (or just select all OB, FB and FC's) and then click on the right arrow:

db004.JPG
 
Double click on the Code object in the right hand pane and the block editor will open showing the source code:

db008.jpg
 
Close down the editor and (discard the changes).
The blocks folder will now contain the re-compiled blocks with DB101 replaced by DB201.

Downside - if the blocks were created by the ladder editor they will now show as being created in STL. They will still be displayable in ladder.
 

Similar Topics

Hi everyone, I am working with micro850, a proximity sensor (FOTEK, PL-05P) and a 3DOF serial arm robot. I use MC_MoveRelative to control the...
Replies
1
Views
56
So I'm pretty green when it comes to troubleshooting in the field so bear with me. We have a Danfoss valve that opens/closes from an analog output...
Replies
23
Views
952
Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
203
hi, I got a plc S7-1200 with SEW movitrac **** and i need to program something ridiculous if my application reaches sensor 1 then my SEW has to...
Replies
0
Views
188
Afternoon, I have a DB in TIA Portal V16 that is optimised. I cannot change this. There is an array inside that block which consists of 3000...
Replies
9
Views
1,135
Back
Top Bottom