# Add component to Library Plecs Blockset

**URL:** <https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615>\
**Category:** PLECS\
**Tags:** plecs, plecs-blockset\
**Created:** [January 24, 2019, 7:19am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615 "2019-01-24T07:19:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![juledev](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@juledev](https://forum.plexim.com/u/juledev)\
**Post date:** [January 24, 2019, 7:19am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/1 "2019-01-24T07:19:15Z")

</div>

I’m trying to add a reusable component like in this tutorial: [https://www.plexim.com/de/support/videos/custom-component-part-2](https://www.plexim.com/de/support/videos/custom-component-part-2)

I accomplished that in Plecs Standalone but I cannot get it to work in the Blockset version. Can somebody explain how that works with the Simulink integration?

Regards

Julian

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [January 29, 2019, 1:17pm UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/2 "2019-01-29T13:17:03Z")

</div>

Hello Julian,

Have you reviewed the process in our User Manual? Here is the description below:

Creating a New Library in PLECS Blockset  
To create a new component library, open the PLECS Extras library (in the Simulink library navigator) and copy the PLECS Library block into a Simulink model or library. The Simulink model must be named (i.e. saved) before you can copy components from the component library.  
To add the new library to the library browser it has to be added to the list of user libraries in the PLECS Preferences window, which is accessed from the File menu when inside the PLECS Circuit block.

You will also need to create a MATLAB path link to the folder containing this library model file.

Please let us know if you are successful or have specific questions.

Thank you,

Kris

---

<div class="post-metadata">

**Author:** ![yanshaofei333](https://avatars.discourse-cdn.com/v4/letter/y/e5b9ba/32.png) [@yanshaofei333](https://forum.plexim.com/u/yanshaofei333)\
**Post date:** [January 30, 2019, 11:12am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/3 "2019-01-30T11:12:15Z")

</div>

Hello,

i have create a new library name “custom” in plecs library, now the problem is:

how can i add my model to that library, so that when i need it i can just drag one from library?

like i show in the picture.

thanks!

 ![fig_01.png](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/44b3a870f5d36136b36f3dc4cf162483fca9f5a9.png)

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [January 30, 2019, 1:14pm UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/4 "2019-01-30T13:14:44Z")

</div>

Hello,

You have placed your custom components in a standard PLECS Circuit block. But you need to use the PLECS Library Block in the PLECS Extras category, as shown in the attached image. Place this block into a Simulink model, add your custom components, and save it. Then link to this model in the PLECS Preferences and it should appear in your library browser so that you can then drag it into any other model. Let me know if you get this to work, thanks!

Kris

 ![Screen Shot 2019-01-30 at 9.43.09 AM.png](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/004ffe0ea1395fbc92ed3c6253b12422d01e4ad3.png)

---

<div class="post-metadata">

**Author:** ![yanshaofei333](https://avatars.discourse-cdn.com/v4/letter/y/e5b9ba/32.png) [@yanshaofei333](https://forum.plexim.com/u/yanshaofei333)\
**Post date:** [February 1, 2019, 5:10am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/5 "2019-02-01T05:10:54Z")

</div>

Hello Kris,

i do it exactly in the way you said. and it’s work.

but the only problem is, when i closed the model, the library disappear from the plecs library window. and it says: “one or more libraries were unloaded, click here to refresh browser”.

why is that, do you know?

fig\_01: when i open the model, the library appear.

fig\_02: when i close the model, the library disappear.

fig\_03: when i close the model, the message on the plecs library.

Shaofei

 ![fig_01.png](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/05a0f607add78f7cc893a80bc39a2c3d5ddaeca3.jpeg)

 ![fig_02.png](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/7d99d6c9aac49f3a23b33aad855a425db1e6c34a.png)

 ![fig_03.png](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/8d85185763f11dc6f91085cfee1c8ab682cc601d.png)

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [February 1, 2019, 11:27am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/6 "2019-02-01T11:27:03Z")

</div>

I believe the problem is that you don’t have a reference to the path directory containing your library model saved in MATLAB. You can either place the library model in the same folder as your current model and navigate to this as your present working directory in MATLAB, or save this path in the MATLAB list so there is a permanent link. The message is normal if you haven’t done this step and you just need to click on the library when that happens. But it won’t happen if you save the path permanently to the folder with your library model.

---

<div class="post-metadata">

**Author:** ![yanshaofei333](https://avatars.discourse-cdn.com/v4/letter/y/e5b9ba/32.png) [@yanshaofei333](https://forum.plexim.com/u/yanshaofei333)\
**Post date:** [February 4, 2019, 5:28am UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/7 "2019-02-04T05:28:28Z")

</div>

Hello Kris,

i’ve done exatly what you said and the problem has been solved !

Thank you a lot !

---

<div class="post-metadata">

**Author:** ![Manu\_Parimi](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/manu_parimi/32/6_2.png) [@Manu\_Parimi](https://forum.plexim.com/u/Manu_Parimi)\
**Post date:** [November 14, 2019, 3:59pm UTC](https://forum.plexim.com/t/add-component-to-library-plecs-blockset/615/8 "2019-11-14T15:59:51Z")

</div>

Hi,

I know this question has been resolved, but just for future reference, there is now a video explaining how to create a new user library component in PLECS Blockset – [https://youtu.be/jRE0j-7x-08](https://youtu.be/jRE0j-7x-08)

Regards,  
Manu
