Readying Your Custom Component
The Component Licensing Function
Calling the Component Licensing Function
Component licensing allows component designers to restrict the use of their custom components to specific PSCAD users, on a per certificate license basis. As such, a custom model can be freely distributed, perhaps even made available for public download, but the actual usage of that component in an EMTDC simulation is blocked, unless a specific user’s certificate license enables its use.
It is important to note that this feature simply restricts a component’s usage in an EMTDC simulation, via modifications to the corresponding source code. It is up to the component designer to ensure that this source code is still compiled into binary (i.e. *.lib or *.dll), to protect intellectual property before being sent off to the client.
In order to ready your component to use this feature, some minor modifications must first be made to the source code of each custom component you intend to license.
If your component is implemented in a semi-compiled library such as a *.lib or *.obj, then all that is required is to add the calls to the component licensing function in EMTDC.
If your component is implemented in a *.dll, then it will be necessary to include the component licensing library included with the PSCAD installation.
Once included in the build for the *.dll, the component licensing function call can be added to the *.dll source code to ensure the code will only run if licensed.
Once your custom component model has been readied for licensing, the final step in the process is to contact the PSCAD Sales Desk (sales@pscad.com) to request a modification to your client’s license certificate; following the modification, they will be able to use your model in their EMTDC simulations.
The functions that are used, to check whether a particular component is licensed for use in an EMTDC simulation, are Fortran and C-language functions called 'ENSURE_COMPONENT_LICENSE' and 'ENSURE_COMPONENT_LICENSE_C', which include four input arguments:
CALL ENSURE_COMPONENT_LICENSE(CHARACTER name, CHARACTER guid, CHARACTER key, INTEGER count)
void _cdecl ENSURE_COMPONENT_LICENSE_C(CHARACTER name, CHARACTER guid, CHARACTER key, INTEGER count)
The arguments are described as follows:
name: This is simply a name string, identifying the custom component.
guid: GUID stands for Globally Unique Identifier. This is an important character string input, as the longer and more random this character string is, the better. We recommend this website as an easy way to generated a GUID for your component: https://www.guidgenerator.com/.
key: The key is essentially a secret password used to verify to the component license. It can be any string. We recommend a strong key, containing capitals, numbers and off-characters. The size limit for this key is 30,000 characters. If you prefer, you can also use another auto generated GUID.
count: This is an integer argument that represents the interval in milliseconds (i.e. 1 = 1 ms real time), in which the licensing function is called during a simulation. Note that each call will momentarily slow the simulation, so we recommend perhaps a 10 second interval (count = 10,000) or greater.