Best Practices for Organizing Programs in TIA Portal

Hello everyone,

I am currently structuring my program in TIA Portal and I would like to get your opinions and advice on a few specific points, based on the attached screenshots:

  1. Calling Functions (A vs B): In your opinion, what is the best method for calling functions from the program tree in the Main (OB1)? Which approach is more correct between A and B? Are there any best practices I should follow when organizing these calls?
  2. Using DB Memory vs M0.X Bits (C vs D): I often read that it is recommended to use DB memory instead of bit memory (M0.X). Which approach is more correct between C and D? Could you explain the advantages of using DB memory and the risks or downsides of using M0.X?
  3. Organizing Data Blocks (Capture E): Is it advisable to split a Data Block into multiple distinct blocks, for example, creating a dedicated Data Block for each function or subprogram found in the program tree? Would this approach result in clearer organization and better data structure?

Your feedback and recommendations would be greatly appreciated to help me optimize the clarity and efficiency of my program. Thank you in advance for your advice!

https://preview.redd.it/jqm6xfjngc7e1.jpg?width=1136&format=pjpg&auto=webp&s=dd42722d7800a6db0e177de20453f0ea679377ce

https://preview.redd.it/s08ygbdogc7e1.jpg?width=1150&format=pjpg&auto=webp&s=cf1efe2476cac641d2ea484342175a9b44f01612

https://preview.redd.it/crrxeg2pgc7e1.jpg?width=1266&format=pjpg&auto=webp&s=7bfc55e4622b3e5ce75b5b99d01ab0fb4d5966f7

https://preview.redd.it/e3bk6ytpgc7e1.jpg?width=1373&format=pjpg&auto=webp&s=7b36ce4c132657928438654467f1151b17cb26cd

https://preview.redd.it/jxtcnjjqgc7e1.jpg?width=1325&format=pjpg&auto=webp&s=982d09d49eb2969142e387bd4129653950c4f8c7