rajsiyer Posted May 11, 2015 Report Posted May 11, 2015 Hi guys, I am a little new to TIA portal. My question is whether it is possible to create structures of data (UDTs) and use them without addresses in the program? Or is it absolutely necessary to assign base addresses to all variables? thanks for looking in & will greatly appreciate any help Raj S. Iyer Quote
Bryll Posted May 12, 2015 Report Posted May 12, 2015 You can create UDT's under the tab "PLC data types". I attached a small picture to make it a bit clear what I mean. Quote
rajsiyer Posted May 23, 2015 Author Report Posted May 23, 2015 Hi Bryll, Thanks a lot for your prompt reply. I know about creating data types... Now my question is whether the instances of these data can be used without the assignment of address? So far I haven't been able to create any variable - elementary or User-defined without assigning addresses; in the PLC tag tables that is. However, in OB1, I have been able to create private variables starting with "#" Such as #int1 which is local to OB1, which implies that it could be global. Same rule applies to structured variables or user data types. And Bryll, I would like to understand data-blocks. If you create a structure and instantiate it, does it become an instance data-block. Quote
Bryll Posted May 26, 2015 Report Posted May 26, 2015 If you create a FB and connects a DB to it, then you will have an instance DB. If you create a DB to store variables in, then you will have a DB with addresses for each tag/byte/word. You access them in your program by dragging them to the position or write the address directly like: DB100.DBX0.5 If you create an UDT, then you can access them by the label or drag and drop (no addresses). Might be wrong, since I'm just a beginner myself Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.