plc_library
Manage PLC library references and repositories in TwinCAT projects. Add, remove, or update library placeholders and resolutions via ITcPlcLibraryManager.
Instructions
PLC library references / placeholders / repositories via ITcPlcLibraryManager on the References node (TIPC^^ Project^References). referencesPath defaults to the first PLC under TIPC. READ (no side effects): list (References → name/kind library|placeholder/displayName/distributor/version), scan (ScanLibraries → installed libs name/version/distributor/displayName; pass filter to avoid the full catalogue dump), repos (Repositories → name/folder). WRITE — OFFLINE .plcproj edits, NO runtime impact (not confirm-gated): add_library (name, version?, company?), add_placeholder (name, defLib?/defVer?/defDist? — omit defLib for the name-only form), set_resolution (placeholder, lib, version?, dist?), freeze (name? — omit to freeze ALL), remove_reference (name = library or placeholder). Each accepts save:true to File.SaveAll after the edit. LANDMINE: a .plcproj library-reference edit (add/remove/repin a library or placeholder, set resolution) requires a full solution close+reopen in XAE before it takes effect; adding source files alone does not — the response surfaces this note. REPO ADMIN — GUARDED, mutates the machine-wide TwinCAT library store (no runtime change, but shared-machine state): install_library (repo, libPath, overwrite?), uninstall_library (repo, lib, version?, dist?), insert_repository (name, folder, index?), remove_repository (name), move_repository (name, index). These require confirm="ALLOW_PLC_LIBRARY_REPO". Nothing here targets the safety system (References live only under TIPC).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lib | No | ||
| dist | No | ||
| mode | No | DTE attach mode; default active | |
| name | No | ||
| repo | No | ||
| save | No | ||
| index | No | ||
| action | Yes | ||
| defLib | No | ||
| defVer | No | ||
| filter | No | scan: case-insensitive substring on library name; omit for the full installed list | |
| folder | No | ||
| company | No | ||
| confirm | No | ||
| defDist | No | ||
| libPath | No | ||
| version | No | ||
| overwrite | No | ||
| placeholder | No | ||
| referencesPath | No | References node path; default = first PLC under TIPC |