Deep dive Β· expands Platform Β· ch.2

Libraries & Reuse

Write a function block once, version it, and ship it to every machine you build. A Sysmac library is how good code stops being copy-pasted and starts being maintained β€” across a whole fleet, from one source.

πŸ“¦ versioned librariesnamespaces
01 Β· Versioning

One library, growing over time

A library carries a version. Bump it and you add features without breaking machines pinned to the old one. Step through MyConveyorLib's releases β€” new FBs light up as they're introduced.

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 β€” no accidental collision when two libraries pick the same name.

πŸ“₯ 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, publish v2.0.1, and every machine that references it upgrades on its next build β€” instead of editing 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?