Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02133// Views: AA-02133// Created: 2023-03-01 15:27:03// Last Updated: 2023-03-01 15:38:27
HowTo
How to Set the Development Node in RT-LAB Using the Python API

Note: this KB is only relevant to setups that have more than one simulator.


What is a Development Node?

In short, the development node is the simulator used by default to compile a model for a specific operating system.

As a recall, OPAL-RT has different Operating System (OS) available for its simulators. The newest OS is OPAL-RTLinux3 and is based on the Yocto Project from Linux. Legacy targets were based on Redhat.

Furthermore, it is possible to compile a model using one simulator (or VM) and load / execute on another simulator, as long as it is the same operating system. In the example above, it would be possible to compile on 'RedhatBased_Target' and load on 'RedhatBased2_Target'. It is not possible to load it on OPALRTLinux3_Target without recompiling.

Notice the little green R on the top right of the symbol. This is a decorator defining the development nodes.

The OS version of a target can be found by checking the Diagnostic tab.





How to Set the Development Node with Python?


The first step is nonetheless to open a project.


RtlabApi.OpenProject("Any Project")


To get the development node for a Redhat-based target, the command is:


RtlabApi.GetAttribute(RtlabApi.OP_RTLAB_OBJ, RtlabApi.ATT_DEVENVNODE_REDHAWK)


For the OPALRTLinux3-based targets, the command is almost identical:


RtlabApi.GetAttribute(RtlabApi.OP_RTLAB_OBJ, RtlabApi.ATT_DEVENVNODE_REDHAWK64)



The trick here is that it is not a parameter specific to a project / model, but rather to RT-LAB itself. The RT-LAB Object has only one identifier and it is RtlabApi.OP_RTLAB_OBJ.


To set the development node to a new target, then simply use the set command and the name of the target. For instance:


RtlabApi.SetAttribute(RtlabApi.OP_RTLAB_OBJ, RtlabApi.ATT_DEVENVNODE_REDHAWK, "NewTarget")