TIA Portal, creating FB's / DB's?

russg

Member
Join Date
Aug 2012
Location
UK
Posts
275
Hi,

If I were to create an INT for my FB / DB, will this use up a whole DINT every time I use one or will is just use an INT's worth of memory each time?

Thanks,

Russ
 
The smallest slice of memory that can be set aside in S7 is 2 bytes, so an INT will use up 2 Bytes, a single BOOL will use up 2 bytes, but several consecutive BOOLs will only also use up 2 Bytes. A DINT will use up 4 Bytes.
If you create your program for an S7-1500 and chose "optimised block access". Then TIA will sort the data so that it is packed optimally, no matter which order you declare it. On the other hand, you lose the ability to adress the data absolutely.

But dont worry about the memory usage when using FBs. It was in the olden days that you had 23 and a ½ Byte memory and every instruction took several milliseconds to execute.
Today you can concentrate on creating the code that is the easiest to understand and maintain, practically without thinking about memory usage and and execution speed. Also it is perfectly OK to not select the "optimised block access". Memeory usage and speed will still be OK.
 
Optimised access DBs in TIA is the way to write code, unless you really need absolute addressing for something. It just makes everything work, and you don't need to worry about accidentally overwriting other variables.

Just start worrying when you make multi-dimension arrays. Multi-dimension arrays can murder modern PCs if your not careful with how big they get, let alone PLCs. An array of 10*10*10 ints is 1 kB, 2 kB for reals and 4 kB for Long Reals. Seriously long reals (64 bit) are available in TIA portal for the S7-1200. Why? No idea.

Worrying about memory because your using too much in modern PLCs is really an indication you need a more powerful system, or a dedicated database to store the data you are recording.
 
Great, thanks guys. That helps a lot. Where is the option for optimised block access?
 

Similar Topics

Hello, As a person who is not that experienced in plcs i am new to a lot of things in this environment. Today my problem includes the alarms...
Replies
3
Views
1,368
Hello everyone, As you can see in the screenshot below i have some values that are retentive. Now i want to create a specific value for specific...
Replies
5
Views
1,501
Hi Experts, I have created a face plate and to make the objects on it visible and invisible for this i created a tag Bool called Show hide Face...
Replies
2
Views
2,379
Hello I'm looking for a way to do the following but i don't know if it's possible.. I use Wincc TIA V15 comfort panel i use the recipes as...
Replies
2
Views
3,563
I am using CPU 315-2 PN/DP which doesnt allow to assign the variables to the created UDT , meaning the created UDT"PLC Data type" doesnt show in...
Replies
8
Views
2,816
Back
Top Bottom