日本語 English

Sysmac Studio namespaces

What Is a Namespace?

A mechanism for grouping and managing function names, FB names, structure names, union names and enumeration names
For example, there are towns called Springfield in many states, but writing Springfield, Illinois or Springfield, Missouri distinguishes them
In the same way, if a project must use both a "CalcArea" function made by Taro that calculates the area of a triangle and a "CalcArea" function made by Ichiro that calculates the area of a rectangle, giving them the namespaces "Taro" and "Ichiro" lets them be treated as different functions, "Taro\CalcArea" and "Ichiro\CalcArea"

Why Namespaces Are Needed

When you install several libraries, Functions and FBs with the same name may exist. Using namespaces prevents name conflicts.

Namespace usage example

Here we look at MonitorCylinderMeasure (operation time measurement) in the device operation monitoring library provided in the Sysmac Library
Example of a standard library with namespaces

The function block name is "\\omronLib\BC_DeviceMonitor\MonitorCylinder_Measure", and the namespace is as shown below
Namespace\\omronLib\BC_DeviceMonitor
FB nameMonitorCylinder_Measure

Comments