Documentation Home Page ◇ eHS Toolbox Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
How to use the eHS Export to Protected Block
General Concept
This feature allows to build standalone libraries from eHS over Schematic Editor to protect your IP.
Usage
There are 2 ways to use the eHS export Protected Block feature. The first is simply to use the UI, and the second is more automation oriented, using scripts.
eHS export Protected Block feature in the User Interface
Right click in the eHS block, and select 'eHS' > 'export Protected Block'
It will create the protected block in the current model.
eHS export Protected Block feature as a script
Description
To facilitate the automation of the eHS export Protected Block feature, the Matlab Function that generates the protected block can be called manually inside a script to create a locked library file containing multiple different eHS Protected Blocks. Within the eFPGASIM product, this function is called: generateProtectedBlock.
The generateProtectedBlock function takes in input the Original eHS Block to export and the location where to output the resulting eHS Protected Block. The generateProtectedBlock function can be called multiple times, pointing to the same output file path, in order to create a library of many eHS Protected Blocks.
Input arguments
generateProtectedBlock(originalModelPath, originalBlockPath, protectedModelPath, protectedBlockName)
Matlab Function takes 4 inputs:
The file path of the Simulink Model in which the Original Block to be exported is located
The Block Path of the eHS Block to be exported
The output file path in which the eHS Protected Block is to be created
The name of the eHS Protected Block to be created
Behavior
If the output library does not exist, the script will automatically create it.
If the output library exists,
If the block already exists, it will be overwritten.
If the block does not exist, it will be added and properly positioned into the library after the last one.
Example
Take this model for example, an eHS Block situated on the desktop:
We want to create a library block called machineLibrary
in which this eHS Block will be exported as a eHS Protected Block. The generateProtectedBlock
function should be called with the following parameters:
>> generateProtectedBlock('C:\Users\admin\Desktop\originalModel', ...
'untitled/eHS SE SFunction Drivers', ...
'C:\Users\admin\Desktop\machinesLibrary', ...
'My PMSM Protected Block');
IMPORTANT: Use backslashes ( '\' ) for the file path and forward slashes ( '/' ) for the block path.
The resulting eHS Protected Block will be saved in a new Simulink Locked Library file. The function can be called again to add eHS Protected Blocks to the new library like so (using the same source block here for example purposes)
>> generateProtectedBlock('C:\Users\admin\Desktop\originalModel', ...
'untitled/eHS SE SFunction Drivers', ...
'C:\Users\admin\Desktop\machinesLibrary', ...
'My Other PMSM Protected Block');
Now machinesLibrary.slx will contain two eHS Protected Blocks: "My PMSM Protected Block" and "My Other PMSM Protected Block" for the user to use.
User Interface
Protected block are using an embedded UI in order to be used standalone.
The block may come with multiple setups (Hardware/firmware choice).
This way, you can choose the appropriate one for your own usage. The protected block creator is responsible to describe each setup to its client using the protected model.
In the previous example, Setup 1 matches its name in the Schematic Editor
The block can be loaded for any setup and will provide its associated build report in the dedicated tab section.
Limitations
The protected block is associated with the eFPGASIM version that has been used to generate it. This means that the protected block can only be used with an eFPGASIM installer that has the same major and minor number and a patch that is higher or equal to the one used for the generation. If it doesn’t, you won’t be able to build your model, and the following error message will be displayed :
To continue to use the protected block with the new version, it needs to be regenerated with the correct eFPGASIM version.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter