EcoStruxure Machine Expert Logic Builder offers advanced functions for managing libraries, the so-called forward compatible libraries. They provide a convenient way to manage references and dependencies among libraries.
This functionality is also available via scripts and can be used on the
of the entire project or on a single application within the project. The following script shows how to check the libraries for forward compatibility and valid references. It automatically maps the references and explicitly sets library versions.proj = projects.primary
app = proj.active_application
libmgr = app.get_library_manager()
print("# Checking all libraries:")
for lib in libmgr.get_libraries():
print("- " + lib + " Is Forward Compatible Library? " + str(libmgr.is_library_forward_compatible(lib)))
if not libmgr.is_current_mapping_valid():
for lib in libmgr.get_invalid_library_mappings():
print("Library reference cannot be satisfied for: " + lib)
print("Trying to auto-map libraries to valid versions")
libmgr.make_auto_mapping()
else:
print("All mappings valid")
# set version using individual parameters
libmgr.set_new_library_version("PD_GlobalDiagnostics", "Schneider Electric", "1.0.1.0")
# set version using the library full name
libmgr.set_new_library_version("PD_AxisModule, 1.1.6.0 (Schneider Electric)", "1.2.4.0")
# set version to Legacy
libmgr.set_new_library_version("PD_Template", "Schneider Electric", None)