Data Object inside of Library

I try to make a new Library for my personal use, this library has a Modbus RS485 communication, from what I learned to program a RS485 communication I need a Data Object, how can I include/insert Data Object into this new library? I tried dragging it but it won’t work

Hi,

a data object cannot be placed into a library.
When selecting a library in Logical View, only those types of files that are then visible in the Toolbox - Object Catalog can be placed inside the library, please see the example screenshot below.

But it’s at least possible in Logical View to place a user library outside of the standard Library folder in a own package - so I personally create packages to bundle my own libraries + data objects + sample task(s) + documentation, so everything I need to “transport” with the library itself. Maybe this would be also a suitable way for you to organize the code + needed additional stuff?

Best regards!

You could also create a Function/Function Block that would initialize a new data object created at runtime. The library already likely has a dependency on DatObj library so using it in your library doesn’t cause an additional dependency. You also don’t have to worry about making sure the data object has been assigned in the software configuration.

2 Likes