4.1 1 1 1 1 1 1 1 1 1 1 Rating 4.10 (5 Votes)

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

In this article I'll describe how to create your own library with know-how protect feature using Codesys version 2.3. Maybe most of you already know how to do it, but recently I've been involved into this need and did not find any source that explain it pretty clearly... So here we are!

 

 

  1. File->new   First of all you need to create a standard Codesys project named as you prefer (In this sample I've called "MyLibrary")

  2. As Target select  "PLCWinNT" (or whatever target you prefer, it doesn't matter)

     

  3. Add a POU named as a function of your library (in this sample, I'll call "INCREASE" a simple function that increase each cycle the input value)

      ===>

  4. Edit you function code freely: I just made a simple function that add 1 to input (IN) parameter

     

  5. In order to define the know-how protect (void the source code visibility from the .lib file): Project-->Options..-->Password

  6. Save the project as Codesys Project (for future adjustement/adding)  File-->Save As--> Codesys Project (*.pro) I'll save as MyLibrary.pro

  7. Save the project as "Internal Library": File-->Save As--> Internal Library. I'll save as MyLibrary.lib

  8. Create a new Codesys project. I'll save as TestingPrj.pro

    1.  

  9. Copy MyLibrary.lib to the TestingPrj.pro's library directory. To know it, go to Project-->Options..--> Directories

  10. From Library manager add the brand new library MyLibrary.lib previously created

  11. The new imported libary do not permit to see the source code (know-how protect)

  12. Use the INCREASE function from MyLibrary.lib whereever into the TestingPrj.pro

  13. This is the TestingPrj.pro running (OUT=IN+1)