Deep dive Β· expands Platform Β· ch.2

Libraries & reuse

Write a function block once, give it a version, and ship it to every machine you build. Put it in a Sysmac library and good code is no longer copy-pasted from project to project: it is maintained in one source and shared across a whole fleet.

πŸ“¦ versioned librariesnamespaces
01 Β· Versioning

One library, growing over time

Every library carries a version. Bump it when you add features, and the machines pinned to the old version keep working as they did. Step through MyConveyorLib's releases and watch each new FB light up in the release that introduced it.

02 Β· Namespaces

Two FBs, same name, no clash

// your project's own block
belt : FB_Conveyor;

// the library's block β€” qualified
belt2 : MyConveyorLib\FB_Conveyor;

The \ namespace prefix tells Sysmac exactly which FB_Conveyor you mean, so two libraries can pick the same name without an accidental collision.

πŸ“₯ Repository β†’ reference. You install a library into the repository once, then reference a specific version from each project. Update the reference to roll a machine forward.

🚒 One source, whole fleet. Fix a bug in the library and publish v2.0.1. Every machine whose reference you move to v2.0.1 gets the fix on its next build, and nobody has to edit 40 copies by hand.

03 Β· Check yourself

One quick question

Two libraries both define a block called FB_Timer. How do you use the one you mean without a clash?