What are Data Blocks?? How to use them? How they are diffrent from Memory blocks
WHAT ARE DATA BLOCKS??? A data block is an area of memory that can be freely setup for any type of data you like. This can be bits, bytes, words, ints, reals or even your own data types. Size of the data block depends on the PLC. Consult the manual for that PLC. Generally, 1024 bytes is safe for all S7 300 and 400. Most are capable of more. Function of the data block is to allow you to setup the memory area in a convenient manner for your program. As a secondary function, it allows you to set aside memory for the FB type of function. This type of function retains its memory between calls, therefore needs a place to store the "instance" of the function block. You can save your data into markers (example MW20) but they are very limited in numbers so with them you can not work with a lot of data. A function block (FB) is automatically assigned with a data block (DB). In this DB the status of the FB his 'in', 'out', 'in/out', and 'st...