My model builds up to the link step on the target and then fails. Validation, separation, C code generation and transfer all pass.
Setup
Target: OP5033XG2 (OPT910818), OPAL-RTLinux 3.8.1, licence activated, 1 RT core (demo licence)
RT-LAB: 2026.1 (build [confirm in Help > About])
MATLAB/Simulink: R2025a Update 1, Specialized Power Systems
ARTEMiS: 7.16.0.18
I/O: OP4815-IO with the OP5145 eHSx128 Gen5 Power Electronics bitstream (the .conf/.fsd/.ioconf/.pdi files are in the project)
Model: a Specialized Power Systems network with a Synchronous Machine pu Standard block and a Simscape Electrical SM AC8C exciter, inside the SM_Master subsystem. I/O blocks are OP4815-IO, with an SC_Console subsystem on the host.
powergui at the model root: Discrete, Tustin/Backward Euler (TBE), Ts = 50 µs
Error at link time on the target
g++: error: DSS_Utils.o: No such file or directory
g++: error: sfun_spssw_discc_DSS.o: No such file or directory
What I found
The generated makefile (_sm_master.mk) lists sfun_spssw_discc_DSS.c and DSS_Utils.c in MODULES.
Neither file appears in the “Transferring” section of the compile log, and neither exists in the project build folder.
Both exist on the host in C:\Program Files\MATLAB\R2025a\toolbox\physmod\powersys\powersys\ (DSS_Utils.c, DSS_Utils.h, sfun_spssw_discc_DSS.c).
The target’s file list references /usr/matlab/v23.2/toolbox/simscape/include/powersys/powersys/DSS_Utils.h, while the link line uses /usr/matlab/v25.1/rtw/c/libsrc/rtwlibr_redhawk64.a. I don’t know whether that mismatch matters.
I tried copying the three files into the project model folder and adding them on the model’s Files tab (mode ascii, Transfer Time “Before compilation”). The “Transferring user extra files:” section of the log stayed empty, the error did not change, and the Files tab later showed an empty list.
The first build failed validation because the powergui was inside SM_Master (“should be located at the top-level”). Moving it to the model root fixed that.
Questions
Is R2025a Update 1 supported with this RT-LAB release for Discrete powergui models? Where is the supported-release table?
How should the DSS source files (DSS_Utils.c, sfun_spssw_discc_DSS.c) reach the target for a Discrete powergui with TBE? Is there a setting or an install step I have missed?
Would plain Tustin instead of TBE avoid the DSS files? I have not tried it yet.
Does the Simscape Electrical SM AC8C block change the file list, or is the DSS dependency only from the powergui?
Any pointers are welcome. I can post the full compile log if useful.
Why the DSS Source Files Are Missing on the Target
In Simscape Electrical Specialized Power Systems (SPS), the Discrete Solver (DSS) is a compilation and runtime framework used to resolve nonlinear electrical device feedback loops in discrete-time simulations.
Root Cause of the Link Failure:
When DSS is engaged, SPS inserts sfun_spssw_discc_DSS.c and DSS_Utils.c into the generated makefile’s MODULES list (_sm_master.mk).
RT-LAB’s code generation and transfer engine (OpalControl/opMakeRTW) assumes runtime S-functions are either precompiled into target MATLAB archive libraries or generated in the model build folder; it does not automatically package and scp arbitrary C files from host paths like C:\Program Files\MATLAB\R2025a\toolbox\physmod\powersys\powersys.
The Files tab in RT-LAB transfers extra files into the target model directory, but adding them as raw ASCII files does not inject compilation rules into MODULES/USER_OBJS in the generated makefile.
Target Version Path Mismatch (v23.2 vs. v25.1):
The log referencing /usr/matlab/v23.2/… for headers while linking against /usr/matlab/v25.1/… libraries indicates that the target simulator (OPAL-RTLinux) has mixed environment definitions (e.g., MATLAB_ROOT or symbolic includes pointing to an R2023b runtime rather than R2025a).
Ensure the target node’s RT-LAB target configuration points strictly to /usr/matlab/v25.1/.
Avoiding DSS Files via Solver Settings (TBE vs. Plain Tustin)
Yes, you can bypass the DSS dependency by disabling the automatic discrete solver setting:
In powergui, DSS activation is controlled by the option:
“Automatically handle Discrete solver and Advanced tab solver settings of blocks” (AutomaticDiscreteSolvers)
In the SPS compilation logic (getPowerguiInfo.m), when this option is unchecked:
PowerguiInfo.AutomaticDiscreteSolvers = 0;
PowerguiInfo.WantDSS = 0;
When WantDSS = 0, SPS reverts to the standard discrete switch solver (sfun_spssw_discc.o) and standard linear state-space equivalent representations rather than the DSS nonlinear feedback solver (sfun_spssw_discc_DSS.o and DSS_Utils.o).
Selecting Tustin (or Tustin/Backward Euler) with “Automatically handle Discrete solver…” unchecked will prevent sfun_spssw_discc_DSS.c and DSS_Utils.c from entering the MODULES list.
Simscape Electrical SM AC8C Block vs. powergui
The DSS dependency is a joint condition between powergui and your circuit components:
Local Block Contribution: Nonlinear devices—such as the Synchronous Machine pu Standard and excitation control interfaces—register DSS metadata in SPS.DSS.block during initialization. If a model has zero nonlinear blocks, DSS is never invoked.
Global Coordination: powergui’s WantDSS setting decides whether SPS should resolve those nonlinear blocks via the DSS runtime engine or fall back to traditional SPS equivalent-circuit source-injection / feedback methods.
The SM AC8C block and Synchronous Machine make the model DSS-capable, but powergui’s automatic discrete solver flag is what triggers the inclusion of the DSS S-function files into the makefile.
Recommended Workaround / Next Steps
Quick Model Workaround: Open the top-level powergui block, go to solver options, uncheck “Automatically handle Discrete solver and Advanced tab solver settings of blocks”, select standard Tustin (or TBE), and re-compile.
Target Clean-Up: Verify that the target environment variables and /usr/matlab/ symlinks on the OP5033XG2 target are aligned to v25.1 to eliminate the header/library version discrepancy.