(read only)

This property returns the number of controls connected to this device. Use to determine valid range for index into Controller array.


% Create DSS object

DSSObject = actxserver('OpenDSSEngine.DSS')

if ~DSSObject.Start(0),

                    disp('Unable to start openDSS');



DSSText = DSSObject.Text;

DSSCircuit = DSSObject.ActiveCircuit;

DSSLines = DSSCircuit.Capacitors;

% Compile a model        

DSSText.Command = 'Compile C:\myPath\myModel.dss';

DSSActiveElement = DSSCircuit.ActiveCktElement;

% Sets the first line of the list as the active element

if DSSLines.First > 0,

    % Gets the number of controls tied to the active element

    myNControls = DSSActiveElement.NumControls;


    disp('It seems that you have no lines!');