Undefined variable with API-OPENDSS

3 views (last 30 days)
Affonso
Affonso on 11 Mar 2024
My Code:
clear all
clc
C_banco=0;
C_GD=0;
C_RT=0;
% addpath('C:\Users\andre\Downloads\dss_matlab_v0.13.4_win_x64\dss_matlab');
addpath('C:\Users\affon\Downloads\dss_matlab_v0.14.1_win_x64\dss_matlab');
DSS = DSS_MATLAB.IDSS;
% access useful objects from the modified grid structure
Text = DSS.Text; % Text interface
Circuit = DSS.ActiveCircuit; % Active circuit object
Solution = Circuit.Solution; % Solution object
Bus = Circuit.ActiveBus; % Active bus object
Loads = Circuit.Loads; % Loads object
Gen = Circuit.Generators; % Generators object
Lines=Circuit.Lines; % Lines object
Trafos =Circuit.Transformers;
Meters = Circuit.Meters;
Reduce = Circuit.ReduceCkt;
Capacitors=Circuit.Capacitors;
RegCtrls=Circuit.RegControls;
if C_RT==1
%Text.Command = 'redirect (C:\Users\andre\OneDrive\Simulacoes\Todos\VL_T1\sistema23b_diario_2.dss)';
Text.Command = 'redirect (C:\Users\affon\OneDrive\Área de Trabalho\OpenDSS\Material_Andrei\sistema23b_diario_2.dss)';
else
%Text.Command = 'redirect (C:\Users\andre\OneDrive\Simulacoes\Todos\VL_T1\sistema23b_diario.dss)';
Text.Command = 'redirect (C:\Users\affon\OneDrive\Área de Trabalho\OpenDSS\Material_Andrei\sistema23b_diario.dss)';
end
Text.Command = 'New Energymeter.M1 Line.L0 1';
Solution.MaxControlIterations=1000;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I'm using this API (https://github.com/dss-extensions/dss_matlab) to do the communication between MatLab and OpenDSS. The error that is shown:
Undefined variable "DSS_MATLAB" or function "DSS_MATLAB.IDSS".
Error in Dados_Base23b (line 12)
DSS = DSS_MATLAB.IDSS;
I don't know what can be wrong, because i've already set the correct path to this folder. I appreciate if there is somebody who knows what's going on.

Answers (0)

Products


Release

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!