Hello,
Couple of quick questions regarding use of data blocks when programming Siemens PLCs with TIA Portal in LAD/FBD:
1) When I was taught to program Siemens PLC's, I was told to avoid using memory bits and only use data blocks with no explanation. What are the advantages of using data blocks over using memory bits/bytes/words? From what I can tell, I cannot define certain data types using memory bits (structs, arrays, etc.) and there seems to be no way to set an initial value for memory bits in the tag table. These would be a couple disadvantages of memory. Are there any others?
2) A nice thing (it seems) about TIA portal is that when you use data block bits with symbolic addressing in the program and you add a bit in the data block before the program bit, the program continues to associate the bit used in the program with its symbolic name, and not with the absolute address. This way, the bit doesn't change even when the address changes when the data block is recompiled (I think I remember in older versions having to go through and change every bit address that came after the modified bit).
Is there a way to symbolically address a byte, say absolute address DB6.DBB8, symbolically called "Machine Mode", and use the bits individually without using absolute addressing?
An example I was playing around with, was transferring a byte into the data block byte "Machine Mode", where each of the 8 bits represents a different mode, and then using those bits symbolically individually later in the program. Is there a way to symbolically name each of the bits within a byte, as well as the byte itself, so that both can be used in the program? Or just a way to use a single bit within the byte symbolically rather than with the absolute address?
I'm not necessarily interested in finding a solution to the specific application mentioned, just more curious if data block bits can be used in this way.
Thanks!
Couple of quick questions regarding use of data blocks when programming Siemens PLCs with TIA Portal in LAD/FBD:
1) When I was taught to program Siemens PLC's, I was told to avoid using memory bits and only use data blocks with no explanation. What are the advantages of using data blocks over using memory bits/bytes/words? From what I can tell, I cannot define certain data types using memory bits (structs, arrays, etc.) and there seems to be no way to set an initial value for memory bits in the tag table. These would be a couple disadvantages of memory. Are there any others?
2) A nice thing (it seems) about TIA portal is that when you use data block bits with symbolic addressing in the program and you add a bit in the data block before the program bit, the program continues to associate the bit used in the program with its symbolic name, and not with the absolute address. This way, the bit doesn't change even when the address changes when the data block is recompiled (I think I remember in older versions having to go through and change every bit address that came after the modified bit).
Is there a way to symbolically address a byte, say absolute address DB6.DBB8, symbolically called "Machine Mode", and use the bits individually without using absolute addressing?
An example I was playing around with, was transferring a byte into the data block byte "Machine Mode", where each of the 8 bits represents a different mode, and then using those bits symbolically individually later in the program. Is there a way to symbolically name each of the bits within a byte, as well as the byte itself, so that both can be used in the program? Or just a way to use a single bit within the byte symbolically rather than with the absolute address?
I'm not necessarily interested in finding a solution to the specific application mentioned, just more curious if data block bits can be used in this way.
Thanks!