Sysmac Libraries offer a great way to reuse custom function blocks and various data structures within Sysmac Studio. These are stored under the file extension .slr. In this article, we'll go through the process of creating these libraries.
1. Creating a Library Project
First create a Sysmac Library Project:
1.5. Creating Function Blocks
To create a function block right click Function Blocks in the multiview explorer, click add and select either Ladder or Structured Text depending on what you wish to write the function block in.
To declare variables that are inputs and outputs to the function block click variables and then In/Out
2. Edit Library Settings
Once you have created the Function Blocks and Data in your library you can edit the properties of the library here:
You will see the following window pop up:
- Name of the Library you are creating
- Name of the Company you are from (Optional but useful for identification)
- The the current revision number of your library
- Your name or Name of the Author
- When ticked this will stop the source code in your function block from being viewed
- You can choose which programs and Function Blocks are included in the Library
Note
There is no way to view or edit programs from an imported library. It is recommended you use library files for Function Blocks only.
Programs are useful for debugging and testing within the library project itself however when imported over may cause issues such as conflicting names of programs. It is recommended that you either delete or untick all programs that are unnecessary in your library.
3. Create and Export Library
Clicking create library will compile and take you to a screen to select the destination for your compiled .slr file.