Main API (module DSS)

The dss function is the main function for passing commands to OpenDSS. You can pass multi-line commands with dss. You can also splice in Julia values with string interpolation. Here is an example of using dss:

using OpenDSSDirect
filename = "C:/OpenDSS/electricdss/IEEETestCases/8500-Node/Master.dss"
dss("""
    clear
    compile "$filename"
""")

Several functions are available for setting OpenDSS variables, getting values, and initiating commands. Each of these is in one of several modules. Here is an example to set the kW of the active load element:

Loads.kW(50.)

Here is an example setting some loads:

using OpenDSSDirect
filename = "C:/OpenDSS/electricdss/IEEETestCases/8500-Node/Master.dss"
dss("""
    clear
    compile "$filename"
""")
loadnumber = Loads.First()
while loadnumber > 0
    Loads.kW(50.)
    Loads.kvar(20.)
    loadnumber = Loads.Next()
end
println(Loads.Count())

To use this API, you can either use import OpenDSSDirect and prepend all calls with OpenDSSDirect, or you can run using OpenDSSDirect and use the functions within each module directly. The following two are equivalent:

import OpenDSSDirect
OpenDSSDirect.Circuit.TotalPower()

Importing the DSS module:

using OpenDSSDirect
Circuit.TotalPower()

Many of the functions that return arrays convert to complex numbers where appropriate. Here is an example session:

julia> using OpenDSSDirect

julia> filename = joinpath(Pkg.dir(), "OpenDSSDirect", "examples", "8500-Node", "Master.dss");

julia> dss("""
           clear
           compile "$filename"
       """)

julia> Solution.Solve();

julia> Circuit.Losses()
1.218242333223247e6 + 2.798391857088721e6im

julia> Circuit.TotalPower()
-12004.740450109337 - 1471.1749507157301im

julia> Circuit.SetActiveElement("Capacitor.CAPBank3")
6075

julia> CktElement.Voltages()
6-element Array{Complex{Float64},1}:
  5390.82-4652.32im
 -6856.89-2274.93im
  1284.62+7285.18im
      0.0+0.0im
      0.0+0.0im
      0.0+0.0im

To find the functions available in each module, use Julia's help for each module (initiated by hitting ?). See below for an example.

julia> using OpenDSSDirect

help?> Circuit
search: Circuit

  module Circuit – Functions for interfacing with the active OpenDSS circuit.

  Circuit.NumCktElements() – Number of CktElements in the circuit

  Circuit.NumBuses() – Total number of Buses in the circuit

  Circuit.NumNodes() – Total number of Nodes in the circuit

  Circuit.FirstPCElement() – Sets the first enabled Power Conversion (PC) element in the circuit to be active; if not successful returns a 0

  Circuit.NextPCElement() – Sets the next enabled Power Conversion (PC) element in the circuit to be active; if not successful returns a 0

  Circuit.FirstPDElement() – Sets the first enabled Power Delivery (PD) element in the circuit to be active; if not successful returns a 0

  Circuit.NextPDElement() – Sets the next enabled Power Delivery (PD) element in the circuit to be active; if not successful returns a 0

  {truncated...}

Besides that, the methods function can be helpful to list the alternatives. Besides the getter (no value arguments) and setter (when a value argument provided), most functions allow passing a dss::DSSContext argument. For example:

julia> using OpenDSSDirect

julia> methods(OpenDSSDirect.Loads.Name)
# 4 methods for generic function "Name":
[1] Name() in OpenDSSDirect.Loads at /home/user/.julia/packages/OpenDSSDirect/5wwHs/src/loads.jl:144
[2] Name(dss::DSSContext) in OpenDSSDirect.Loads at /home/user/.julia/packages/OpenDSSDirect/5wwHs/src/loads.jl:141
[3] Name(dss::DSSContext, Value::String) in OpenDSSDirect.Loads at /home/user/.julia/packages/OpenDSSDirect/5wwHs/src/loads.jl:147
[4] Name(Value::String) in OpenDSSDirect.Loads at /home/user/.julia/packages/OpenDSSDirect/5wwHs/src/loads.jl:150

For typical usage with a single circuit, users can use the variations without this argument. For using multiple DSS circuits and potentially multiple circuits, provide the context explicitly.

Here is a list of modules supported by this API. Each module has several functions.

Functions or modules that are not present in the official OpenDSS implementation are marked "(API Extension)".

dss

OpenDSSDirect.dssFunction
Command(dss::DSSContext) -> String

Input command string for the DSS. (Getter)

source
Command(dss::DSSContext, Value::String) -> String

Input command string for the DSS. (Setter)

source
Command(dss::DSSContext, Value::Vector{String})

Runs a list of commands all at once in the engine. Ignores potential intermediate output in the global result.

(API Extension)

source

ActiveClass

OpenDSSDirect.ActiveClass.FirstMethod
First(dss::DSSContext) -> Int64

Sets first element in the active class to be the active DSS object. If object is a CktElement, ActiveCktELment also points to this element. Returns 0 if none.

source
OpenDSSDirect.ActiveClass.NextMethod
Next(dss::DSSContext) -> Int64

Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.

source
OpenDSSDirect.ActiveClass.ToJSONMethod
ToJSON(dss::DSSContext, Flags::Int64) -> String

Returns the data (as a list) of all elements from the active class as a JSON-encoded string.

The options parameter contains bit-flags to toggle specific features. See Obj_ToJSON (C-API) for more.

Additionally, the ExcludeDisabled flag can be used to exclude disabled elements from the output.

(API Extension)

source

Basic

OpenDSSDirect.Basic.AllowChangeDirMethod
AllowChangeDir(dss::DSSContext, Value::Bool)

If disabled, the engine will not change the active working directory during execution. E.g. a "compile" command will not "chdir" to the file path.

If you have issues with long paths, enabling this might help in some scenarios.

Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API. This might change to False in future versions.

This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to disallow changing the active working directory.

(Setter) (API Extension)

source
OpenDSSDirect.Basic.AllowChangeDirMethod
AllowChangeDir(dss::DSSContext) -> Bool

If disabled, the engine will not change the active working directory during execution. E.g. a "compile" command will not "chdir" to the file path.

If you have issues with long paths, enabling this might help in some scenarios.

Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API. This might change to False in future versions.

This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to disallow changing the active working directory.

(Getter) (API Extension)

source
OpenDSSDirect.Basic.AllowDOScmdMethod
AllowDOScmd(dss::DSSContext, Value::Bool)

If enabled, the DOScmd command is allowed. Otherwise, an error is reported if the user tries to use it.

Defaults to False/0 (disabled state). Users should consider DOScmd deprecated on DSS Extensions.

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(Setter) (API Extension)

source
OpenDSSDirect.Basic.AllowDOScmdMethod
AllowDOScmd(dss::DSSContext) -> Bool

If enabled, the DOScmd command is allowed. Otherwise, an error is reported if the user tries to use it.

Defaults to False/0 (disabled state). Users should consider DOScmd deprecated on DSS Extensions.

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(Getter) (API Extension)

source
OpenDSSDirect.Basic.AllowEditorMethod
AllowEditor(dss::DSSContext, Value::Bool)

Gets/sets whether running the external editor for "Show" is allowed

AllowEditor controls whether the external editor is used in commands like "Show". If you set to 0 (false), the editor is not executed. Note that other side effects, such as the creation of files, are not affected.

(Setter) (API Extension)

source
OpenDSSDirect.Basic.AllowEditorMethod
AllowEditor(dss::DSSContext) -> Bool

Gets/sets whether running the external editor for "Show" is allowed

AllowEditor controls whether the external editor is used in commands like "Show". If you set to 0 (false), the editor is not executed. Note that other side effects, such as the creation of files, are not affected.

(Getter) (API Extension)

source
OpenDSSDirect.Basic.COMErrorResultsMethod
COMErrorResults(dss::DSSContext, Value::Bool)

If enabled, in case of errors or empty arrays, the API returns arrays with values compatible with the official OpenDSS COM interface.

For example, consider the function LoadsGetZIPV. If there is no active circuit or active load element:

  • In the disabled state (COMErrorResults=False), the function will return "[]", an array with 0 elements.
  • In the enabled state (COMErrorResults=True), the function will return "[0.0]" instead. This should be compatible with the return value of the official COM interface.

Defaults to True/1 (enabled state) in the v0.12.x series. This will change to false in future series.

This can also be set through the environment variable DSS_CAPI_COM_DEFAULTS. Setting it to 0 disables the legacy/COM behavior. The value can be toggled through the API at any time.

(Setter) (API Extension)

source
OpenDSSDirect.Basic.COMErrorResultsMethod
COMErrorResults(dss::DSSContext) -> Bool

If enabled, in case of errors or empty arrays, the API returns arrays with values compatible with the official OpenDSS COM interface.

For example, consider the function LoadsGetZIPV. If there is no active circuit or active load element:

  • In the disabled state (COMErrorResults=False), the function will return "[]", an array with 0 elements.
  • In the enabled state (COMErrorResults=True), the function will return "[0.0]" instead. This should be compatible with the return value of the official COM interface.

Defaults to True/1 (enabled state) in the v0.12.x series. This will change to false in future series.

This can also be set through the environment variable DSS_CAPI_COM_DEFAULTS. Setting it to 0 disables the legacy/COM behavior. The value can be toggled through the API at any time.

(Getter) (API Extension)

source
OpenDSSDirect.Basic.CompatFlagsMethod
CompatFlags(
    dss::DSSContext,
    Value::Union{UInt32, OpenDSSDirect.Lib.DSSCompatFlags}
)

Controls some compatibility flags introduced to toggle some behavior from the official OpenDSS. The current bit flags are:

- 0x1 (bit 0): If enabled, don't check for NaNs in the inner solution loop. This can lead to various errors.
    This flag is useful for legacy applications that don't handle OpenDSS API errors properly. Through the 
    development of DSS Extensions, we noticed this is actually a quite common issue.
- 0x2 (bit 1): Toggle worse precision for certain aspects of the engine. For example, the sequence-to-phase 
    (`As2p`) and sequence-to-phase (`Ap2s`) transform matrices. On DSS C-API, we fill the matrix explicitly
    using higher precision, while numerical inversion of an initially worse precision matrix is used in the 
    official OpenDSS. We will introduce better precision for other aspects of the engine in the future, 
    so this flag can be used to toggle the old/bad values where feasible.
- 0x4 (bit 2): Toggle some InvControl behavior introduced in OpenDSS 9.6.1.1. It could be a regression 
    but needs further investigation, so we added this flag in the time being.

These flags may change for each version of DSS C-API, but the same value will not be reused. That is, when we remove a compatibility flag, it will have no effect but will also not affect anything else besides raising an error if the user tries to toggle a flag that was available in a previous version.

We expect to keep a very limited number of flags. Since the flags are more transient than the other options/flags, it was preferred to add this generic function instead of a separate function per flag.

These flags are global, affecting any DSS context in the process.

Related enumeration: DSSCompatFlags

(API Extension)

source
OpenDSSDirect.Basic.LegacyModelsMethod
LegacyModels(dss::DSSContext, Value::Bool)

Gets/sets the state of the Legacy Models mechanism (Setter)

If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. WARNING: Changing the active value runs a "Clear" command, discarding the current circuit.

Defaults to false (disabled state).

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(API Extension)

source
OpenDSSDirect.Basic.LegacyModelsLegacyModelsMethod
LegacyModelsLegacyModels(dss::DSSContext) -> Bool

Gets/sets the state of the Legacy Models mechanism (Getter)

If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. WARNING: Changing the active value runs a "Clear" command, discarding the current circuit.

Defaults to false (disabled state).

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(API Extension)

source

Bus

OpenDSSDirect.Bus.LineListMethod
LineList(dss::DSSContext) -> Vector{String}

Array of strings: Full Names of LINE elements connected to the active bus.

source
OpenDSSDirect.Bus.LoadListMethod
LoadList(dss::DSSContext) -> Vector{String}

Array of strings: Full Names of LOAD elements connected to the active bus.

source
OpenDSSDirect.Bus.NodesMethod
Nodes(dss::DSSContext) -> Vector{Int64}

Integer Array of Node Numbers defined at the bus in same order as the voltages.

source
OpenDSSDirect.Bus.VLLMethod
VLL(dss::DSSContext) -> Vector{ComplexF64}

For 2- and 3-phase buses, returns array of complex numbers representing L-L voltages in volts. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only first 3.

source
OpenDSSDirect.Bus.VMagAngleMethod
VMagAngle(dss::DSSContext) -> Vector{Float64}

Variant Array of doubles containing voltages in Magnitude (VLN), angle (deg)

source
OpenDSSDirect.Bus.puVLLMethod
puVLL(dss::DSSContext) -> Vector{ComplexF64}

Returns Complex array of pu L-L voltages for 2- and 3-phase buses. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only 3 phases.

source

Capacitors

OpenDSSDirect.Capacitors.StatesMethod
States(dss::DSSContext) -> Vector{Int64}

Array of integer [0..numsteps-1] indicating state of each step. If value is -1 an error has occurred. (Getter)

source

CapControls

Circuit

OpenDSSDirect.Circuit.AllNodeDistancesByPhaseMethod
AllNodeDistancesByPhase(
    dss::DSSContext,
    Phase::Int64
) -> Vector{Float64}

Returns an array of doubles representing the distances to parent EnergyMeter. Sequence of array corresponds to other node ByPhase properties.

source
OpenDSSDirect.Circuit.AllNodeNamesMethod
AllNodeNames(dss::DSSContext) -> Vector{String}

Array of strings containing full name of each node in system in same order as returned by AllBusVolts, etc.

source
OpenDSSDirect.Circuit.AllNodeNamesByPhaseMethod
AllNodeNamesByPhase(
    dss::DSSContext,
    Phase::Int64
) -> Vector{String}

Return array of strings of the node names for the By Phase criteria. Sequence corresponds to other ByPhase properties.

source
OpenDSSDirect.Circuit.ElementLossesMethod
ElementLosses(dss::DSSContext, Idx::Vector{Int32})

Array of total losses (complex) in a selection of elements. Use the element indices (starting at 1) as parameter.

(API Extension)

source
OpenDSSDirect.Circuit.FromJSONMethod
FromJSON(dss::DSSContext, circ::String, options::Int32)

EXPERIMENTAL: Loads a full circuit from a JSON-encoded string. The data must be encoded using the proposed AltDSS Schema, see https://github.com/dss-extensions/altdss-schema/ and https://github.com/orgs/dss-extensions/discussions/ for links to docs and to provide feedback for future revisions.

The options argument is an integer bitset from the enum DSSJSONFlags.

(API Extension)

source
OpenDSSDirect.Circuit.ParentPDElementMethod
ParentPDElement(dss::DSSContext) -> Int64

Sets Parent PD element, if any, to be the active circuit element and returns index>0; Returns 0 if it fails or not applicable.

source
OpenDSSDirect.Circuit.SaveMethod
Save(
    dss::DSSContext,
    dirOrFilePath::String,
    saveFlags::Int32
) -> String

Equivalent of the "save circuit" DSS command, but allows customization through the saveFlags argument, which is a set of bit flags. See the DSSSaveFlags enumeration for available flags:

  • CalcVoltageBases: Include the command CalcVoltageBases.
  • SetVoltageBases: Include commands to set the voltage bases individually.
  • IncludeOptions: Include most of the options (from the Set/Get DSS commands).
  • IncludeDisabled: Include disabled circuit elements (and LoadShapes).
  • ExcludeDefault: Exclude default DSS items if they are not modified by the user.
  • SingleFile: Use a single file instead of a folder for output.
  • KeepOrder: Save the circuit elements in the order they were loaded in the active circuit. Guarantees better reproducibility, especially when the system is ill-conditioned. Requires "SingleFile" flag.
  • ExcludeMeterZones: Do not export meter zones (as "feeders") separately. Has no effect when using a single file.
  • IsOpen: Export commands to open terminals of elements.
  • ToString: to the result string. Requires "SingleFile" flag.

If SingleFile is enabled, the path name argument (dirOrFilePath) is the file path, otherwise it is the folder path. For string output, the argument is not used.

(API Extension)

source
OpenDSSDirect.Circuit.SystemYMethod
SystemY(dss::DSSContext) -> Matrix{ComplexF64}

System Y matrix (after a solution has been performed) Deprecated, consider using YMatrix.getYsparse() instead

source
OpenDSSDirect.Circuit.ToJSONMethod
ToJSON(dss::DSSContext, options::Int32) -> String

EXPERIMENTAL: Returns the general circuit data, including all DSS objects, as a JSON-encoded string. The data is encoded using the proposed AltDSS Schema, see https://github.com/dss-extensions/altdss-schema/ and https://github.com/orgs/dss-extensions/discussions/ for links to docs and to provide feedback for future revisions.

The options argument is an integer bitset from the enum DSSJSONFlags.

(API Extension)

source
OpenDSSDirect.Circuit.YCurrentsMethod
YCurrents(dss::DSSContext) -> Vector{ComplexF64}

Array of doubles containing complex injection currents for the present solution. Is is the "I" vector of I=YV

source

CktElement

OpenDSSDirect.CktElement.ControllerMethod
Controller(dss::DSSContext, idx::Int64) -> String

Full name of the i-th controller attached to this element. Ex: str = Controller(2). See NumControls to determine valid index range

source
OpenDSSDirect.CktElement.IsIsolatedMethod
IsIsolated(dss::DSSContext) -> Bool

Returns true if the current active element is isolated. Note that this only fetches the current value. See also the Topology interface.

source
OpenDSSDirect.CktElement.NodeOrderMethod
NodeOrder(dss::DSSContext) -> Vector{Int64}

Array of integer containing the node numbers (representing phases, for example) for each conductor of each terminal.

source

CNData

CtrlQueue

OpenDSSDirect.CtrlQueue.NumActionsMethod
NumActions(dss::DSSContext) -> Int64

Number of Actions on the current actionlist (that have been popped off the control queue by CheckControlActions)

source
OpenDSSDirect.CtrlQueue.PushMethod
Push(
    dss::DSSContext,
    Hour::Int32,
    Seconds::Float64,
    ActionCode::Union{Int32, OpenDSSDirect.Lib.ActionCodes},
    DeviceHandle::Int32
) -> Int64

Push a control action onto the DSS control queue by time, action code, and device handle (user defined). Returns Control Queue handle.

source

Element

OpenDSSDirect.Element.ToJSONMethod
ToJSON(dss::DSSContext, Flags::Int64) -> String

Returns the properties of the active DSS object as a JSON-encoded string.

The options parameter contains bit-flags to toggle specific features. See Obj_ToJSON (C-API) for more.

(API Extension)

source

Error

OpenDSSDirect.Error.EarlyAbortMethod
EarlyAbort(dss::DSSContext, Value::Bool)

EarlyAbort controls whether all errors halts the DSS script processing (Compile/Redirect), defaults to True. (Setter)

(API Extension)

source
OpenDSSDirect.Error.EarlyAbortMethod
EarlyAbort(dss::DSSContext) -> Bool

EarlyAbort controls whether all errors halts the DSS script processing (Compile/Redirect), defaults to True. (Getter)

(API Extension)

source
OpenDSSDirect.Error.ExtendedErrorsMethod
ExtendedErrors(dss::DSSContext, Value::Bool)

Get/set the state of the Legacy Models mechanism (Setter)

If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. WARNING: Changing the active value runs a "Clear" command, discarding the current circuit.

Defaults to false (disabled state).

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(API Extension)

source
OpenDSSDirect.Error.ExtendedErrorsMethod
ExtendedErrors(dss::DSSContext) -> Bool

Get/set the state of the Legacy Models mechanism (Getter)

If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. WARNING: Changing the active value runs a "Clear" command, discarding the current circuit.

Defaults to false (disabled state).

This can also be set through the environment variable DSS_CAPI_LEGACY_MODELS. Setting it to 1 enables the legacy components, using the old models from the start.

(API Extension)

source

Executive

Fuses

OpenDSSDirect.Fuses.DelayMethod
Delay(dss::DSSContext, Value::Float64)

A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0. (Setter)

source
OpenDSSDirect.Fuses.DelayMethod
Delay(dss::DSSContext) -> Float64

A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0. (Getter)

source
OpenDSSDirect.Fuses.IdxMethod
Idx(dss::DSSContext, Value::Int64)

Active fuse by index into the list of fuses. 1 indexed based. 1..count (Setter)

source
OpenDSSDirect.Fuses.IdxMethod
Idx(dss::DSSContext) -> Int64

Active fuse by index into the list of fuses. 1 indexed based. 1..count (Getter)

source
OpenDSSDirect.Fuses.NextMethod
Next(dss::DSSContext) -> Int64

Advance the active Fuse element pointer to the next fuse. Returns 0 if no more fuses.

source
OpenDSSDirect.Fuses.NormalStateMethod
NormalState(dss::DSSContext, Value::Array{String})

Array of strings ('open' or 'closed') indicating the normal state of each phase of the fuse. (Setter)

source
OpenDSSDirect.Fuses.NormalStateMethod
NormalState(dss::DSSContext) -> Vector{String}

Array of strings ('open' or 'closed') indicating the normal state of each phase of the fuse. (Getter)

source
OpenDSSDirect.Fuses.RatedCurrentMethod
RatedCurrent(dss::DSSContext, Value::Float64)

Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multipliy current values of TCC curve by this to get actual amps. Has to correspond to the Current axis of TCCcurve object. (Setter)

source
OpenDSSDirect.Fuses.RatedCurrentMethod
RatedCurrent(dss::DSSContext) -> Float64

Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multipliy current values of TCC curve by this to get actual amps. Has to correspond to the Current axis of TCCcurve object. (Getter)

source
OpenDSSDirect.Fuses.StateMethod
State(dss::DSSContext, Value::Array{String})

Array of strings ('open' or 'closed') indicating the state of each phase of the fuse. (Setter)

source
OpenDSSDirect.Fuses.StateMethod
State(dss::DSSContext) -> Vector{String}

Array of strings ('open' or 'closed') indicating the state of each phase of the fuse. (Getter)

source
OpenDSSDirect.Fuses.SwitchedObjMethod
SwitchedObj(dss::DSSContext, Value::String)

Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj. (Setter)

source
OpenDSSDirect.Fuses.SwitchedObjMethod
SwitchedObj(dss::DSSContext) -> String

Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj. (Getter)

source
OpenDSSDirect.Fuses.SwitchedTermMethod
SwitchedTerm(dss::DSSContext, Value::Int64)

Number of the terminal of the controlled element containing the switch controlled by the fuse. (Setter)

source
OpenDSSDirect.Fuses.SwitchedTermMethod
SwitchedTerm(dss::DSSContext) -> Int64

Number of the terminal of the controlled element containing the switch controlled by the fuse. (Getter)

source

Generators

OpenDSSDirect.Generators.Bus1Method
Bus1(dss::DSSContext, Value::String)

Bus to which the Generator is connected. May include specific node specification. (Setter)

(API Extension)

source
OpenDSSDirect.Generators.Bus1Method
Bus1(dss::DSSContext) -> String

Bus to which the Generator is connected. May include specific node specification. (Getter)

(API Extension)

source
OpenDSSDirect.Generators.ClassMethod
Class(dss::DSSContext, Value::Int64)

An arbitrary integer number representing the class of Generator so that Generator values may be segregated by class. (Setter)

(API Extension)

source
OpenDSSDirect.Generators.ClassMethod
Class(dss::DSSContext) -> Int64

An arbitrary integer number representing the class of Generator so that Generator values may be segregated by class. (Getter)

(API Extension)

source
OpenDSSDirect.Generators.StatusMethod
Status(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.GeneratorStatus}
)

Response to dispatch multipliers Fixed=1 (dispatch multipliers do not apply), Variable=0 (follows curves). (Setter)

Related enumeration: GeneratorStatus

(API Extension)

source
OpenDSSDirect.Generators.StatusMethod
Status(dss::DSSContext)

Response to dispatch multipliers Fixed=1 (dispatch multipliers do not apply), Variable=0 (follows curves). (Getter)

Related enumeration: GeneratorStatus

(API Extension)

source
OpenDSSDirect.Generators.kWMethod
kW(dss::DSSContext, Value::Float64)

kW output for the active generator. kvar is updated for current power factor. (Setter)

source
OpenDSSDirect.Generators.kvaMethod
kva(dss::DSSContext, Value::Float64)

kVA rating of electrical machine. Applied to machine or inverter definition for Dynamics mode solutions. (Setter)

(API Extension)

source
OpenDSSDirect.Generators.kvaMethod
kva(dss::DSSContext) -> Float64

kVA rating of electrical machine. Applied to machine or inverter definition for Dynamics mode solutions. (Getter)

(API Extension)

source
OpenDSSDirect.Generators.kvarMethod
kvar(dss::DSSContext, Value::Float64)

kvar output for the active generator. Updates power factor based on present kW value. (Setter)

source

GICSources

Isource

LineCodes

LineGeometries

OpenDSSDirect.LineGeometries.ZmatrixMethod
Zmatrix(
    dss::DSSContext,
    Frequency::Float64,
    Length::Float64,
    Units::Union{Int32, OpenDSSDirect.Lib.LineUnits}
) -> Vector{ComplexF64}

Complex impedance matrix, ohms

source

Lines

OpenDSSDirect.Lines.C1Method
C1(dss::DSSContext, Value::Float64)

Positive Sequence capacitance, nanofarads per unit length. (Setter)

source
OpenDSSDirect.Lines.FirstMethod
First(dss::DSSContext) -> Int64

Invoking this property sets the first element active. Returns 0 if no lines. Otherwise, index of the line element.

source
OpenDSSDirect.Lines.IsSwitchMethod
IsSwitch(dss::DSSContext, Value::Bool)

Sets/gets the Line element switch status. Setting it has side-effects to the line parameters. (Setter)

source
OpenDSSDirect.Lines.IsSwitchMethod
IsSwitch(dss::DSSContext) -> Bool

Sets/gets the Line element switch status. Setting it has side-effects to the line parameters. (Getter)

source
OpenDSSDirect.Lines.LengthMethod
Length(dss::DSSContext, Value::Float64)

Length of line section in units compatible with the LineCode definition. (Setter)

source
OpenDSSDirect.Lines.NextMethod
Next(dss::DSSContext) -> Int64

Invoking this property advances to the next Line element active. Returns 0 if no more lines. Otherwise, index of the line element.

source
OpenDSSDirect.Lines.ParentMethod
Parent(dss::DSSContext) -> Int64

Sets Parent of the active Line to be the active line. Returns 0 if no parent or action fails.

source
OpenDSSDirect.Lines.RMatrixMethod
RMatrix(dss::DSSContext, Value::Vector{Float64})

Resistance matrix (full), ohms per unit length. Vector of doubles. (Setter)

source
OpenDSSDirect.Lines.RgMethod
Rg(dss::DSSContext, Value::Float64)

Earth return resistance value used to compute line impedances at power frequency (Setter)

source
OpenDSSDirect.Lines.RgMethod
Rg(dss::DSSContext) -> Float64

Earth return resistance value used to compute line impedances at power frequency (Getter)

source
OpenDSSDirect.Lines.XgMethod
Xg(dss::DSSContext, Value::Float64)

Earth return reactance value used to compute line impedances at power frequency (Setter)

source
OpenDSSDirect.Lines.XgMethod
Xg(dss::DSSContext) -> Float64

Earth return reactance value used to compute line impedances at power frequency (Getter)

source

LineSpacings

Loads

OpenDSSDirect.Loads.CFactorMethod
CFactor(dss::DSSContext, Value::Float64)

Factor relates average to peak kw. Used for allocation with kwh and kwhdays/ (Setter)

source
OpenDSSDirect.Loads.CFactorMethod
CFactor(dss::DSSContext) -> Float64

Factor relates average to peak kw. Used for allocation with kwh and kwhdays/ (Getter)

source
OpenDSSDirect.Loads.CVRCurveMethod
CVRCurve(dss::DSSContext, Value::String)

Name of a loadshape with both Mult and Qmult, for CVR factors as a function of time. (Setter)

source
OpenDSSDirect.Loads.CVRCurveMethod
CVRCurve(dss::DSSContext) -> String

Name of a loadshape with both Mult and Qmult, for CVR factors as a function of time. (Getter)

source
OpenDSSDirect.Loads.CVRvarsMethod
CVRvars(dss::DSSContext, Value::Float64)

Percent reduction in Q for percent reduction in V. Must be used with dssLoadModelCVR. (Setter)

source
OpenDSSDirect.Loads.CVRvarsMethod
CVRvars(dss::DSSContext) -> Float64

Percent reduction in Q for percent reduction in V. Must be used with dssLoadModelCVR. (Getter)

source
OpenDSSDirect.Loads.CVRwattsMethod
CVRwatts(dss::DSSContext, Value::Float64)

Percent reduction in P for percent reduction in V. Must be used with dssLoadModelCVR. (Setter)

source
OpenDSSDirect.Loads.CVRwattsMethod
CVRwatts(dss::DSSContext) -> Float64

Percent reduction in P for percent reduction in V. Must be used with dssLoadModelCVR. (Getter)

source
OpenDSSDirect.Loads.ModelMethod
Model(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.LoadModels}
)

The Load Model defines variation of P and Q with voltage. (Setter)

source
OpenDSSDirect.Loads.ModelMethod
Model(dss::DSSContext) -> OpenDSSDirect.Lib.LoadModels

The Load Model defines variation of P and Q with voltage. (Getter)

source
OpenDSSDirect.Loads.NextMethod
Next(dss::DSSContext) -> Int64

Sets next Load element to be active; returns 0 of none else index of active load.

source
OpenDSSDirect.Loads.PFMethod
PF(dss::DSSContext, Value::Float64)

Power Factor for Active Load. Specify leading PF as negative. Updates kvar based on present value of kW value (Setter)

source
OpenDSSDirect.Loads.PFMethod
PF(dss::DSSContext) -> Float64

Power Factor for Active Load. Specify leading PF as negative. Updates kvar based on present value of kW value (Getter)

source
OpenDSSDirect.Loads.PctMeanMethod
PctMean(dss::DSSContext, Value::Float64)

Average percent of nominal load in Monte Carlo studies; only if no loadshape defined for this load. (Setter)

source
OpenDSSDirect.Loads.PctMeanMethod
PctMean(dss::DSSContext) -> Float64

Average percent of nominal load in Monte Carlo studies; only if no loadshape defined for this load. (Getter)

source
OpenDSSDirect.Loads.PctStdDevMethod
PctStdDev(dss::DSSContext, Value::Float64)

Percent standard deviation for Monte Carlo load studies; if there is no loadshape assigned to this load. (Setter)

source
OpenDSSDirect.Loads.PctStdDevMethod
PctStdDev(dss::DSSContext) -> Float64

Percent standard deviation for Monte Carlo load studies; if there is no loadshape assigned to this load. (Getter)

source
OpenDSSDirect.Loads.StatusMethod
Status(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.LoadStatus}
)

Response to load multipliers: Fixed (growth only), Exempt (no LD curve), Variable (all). (Setter)

source
OpenDSSDirect.Loads.StatusMethod
Status(dss::DSSContext) -> OpenDSSDirect.Lib.LoadStatus

Response to load multipliers: Fixed (growth only), Exempt (no LD curve), Variable (all). (Getter)

source
OpenDSSDirect.Loads.VmaxpuMethod
Vmaxpu(dss::DSSContext, Value::Float64)

Maximum per-unit voltage to use the load model. Above this, constant Z applies. (Setter)

source
OpenDSSDirect.Loads.VmaxpuMethod
Vmaxpu(dss::DSSContext) -> Float64

Maximum per-unit voltage to use the load model. Above this, constant Z applies. (Getter)

source
OpenDSSDirect.Loads.VminpuMethod
Vminpu(dss::DSSContext, Value::Float64)

Minimum voltage to apply the load model. Below this, constant Z is used. (Setter)

source
OpenDSSDirect.Loads.XfkVAMethod
XfkVA(dss::DSSContext, Value::Float64)

Rated service transformer kVA for load allocation, using AllocationFactor. Affects kW, kvar, and pf. (Setter)

source
OpenDSSDirect.Loads.XfkVAMethod
XfkVA(dss::DSSContext) -> Float64

Rated service transformer kVA for load allocation, using AllocationFactor. Affects kW, kvar, and pf. (Getter)

source
OpenDSSDirect.Loads.ZipVMethod
ZipV(dss::DSSContext, Value::Vector{Float64})

Array of 7 doubles with values for ZIPV property of the LOAD object (Setter)

source
OpenDSSDirect.Loads.ZipVMethod
ZipV(dss::DSSContext) -> Vector{Float64}

Array of 7 doubles with values for ZIPV property of the LOAD object (Getter)

source
OpenDSSDirect.Loads.kVMethod
kV(dss::DSSContext, Value::Float64)

Set kV rating for active Load. For 2 or more phases set Line-Line kV. Else actual kV across terminals. (Setter)

source
OpenDSSDirect.Loads.kVMethod
kV(dss::DSSContext) -> Float64

Set kV rating for active Load. For 2 or more phases set Line-Line kV. Else actual kV across terminals. (Getter)

source
OpenDSSDirect.Loads.kVABaseMethod
kVABase(dss::DSSContext, Value::Float64)

Base load kva. Also defined kw and kvar or pf input, or load allocation by kwh or xfkva. (Setter)

source
OpenDSSDirect.Loads.kVABaseMethod
kVABase(dss::DSSContext) -> Float64

Base load kva. Also defined kw and kvar or pf input, or load allocation by kwh or xfkva. (Getter)

source
OpenDSSDirect.Loads.kWMethod
kW(dss::DSSContext, Value::Float64)

Set kW for active Load. Updates kvar based on present PF. (Setter)

source
OpenDSSDirect.Loads.kWhMethod
kWh(dss::DSSContext, Value::Float64)

kwh billed for this period. Can be used with Cfactor for load allocation. (Setter)

source
OpenDSSDirect.Loads.kWhMethod
kWh(dss::DSSContext) -> Float64

kwh billed for this period. Can be used with Cfactor for load allocation. (Getter)

source
OpenDSSDirect.Loads.kWhDaysMethod
kWhDays(dss::DSSContext, Value::Float64)

Length of kwh billing period for average demand calculation. Default 30. (Setter)

source

LoadShape

OpenDSSDirect.LoadShape.UseActualMethod
UseActual(dss::DSSContext, Value::Bool)

T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier. (Setter)

source
OpenDSSDirect.LoadShape.UseActualMethod
UseActual(dss::DSSContext) -> Bool

T/F flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier. (Getter)

source
OpenDSSDirect.LoadShape.UseFloat32Method
UseFloat32(dss::DSSContext)

Converts the current LoadShape data to float32/single precision. If there is no data or the data is already represented using float32, nothing is done.

(API Extension)

source
OpenDSSDirect.LoadShape.UseFloat64Method
UseFloat64(dss::DSSContext)

Converts the current LoadShape data to float64/double precision. If there is no data or the data is already represented using float64, nothing is done.

(API Extension)

source

Meters

OpenDSSDirect.Meters.CalcCurrentMethod
CalcCurrent(dss::DSSContext, Value::Vector{Float64})

Set the magnitude of the real part of the Calculated Current (normally determined by solution) for the Meter to force some behavior on Load Allocation

source
OpenDSSDirect.Meters.CalcCurrentMethod
CalcCurrent(dss::DSSContext) -> Vector{Float64}

Set the magnitude of the real part of the Calculated Current (normally determined by solution) for the Meter to force some behavior on Load Allocation

source
OpenDSSDirect.Meters.NameMethod
Name(dss::DSSContext, Value::String)

(read) Get/Set the active meter name. (write) Set a meter to be active by name.

source
OpenDSSDirect.Meters.SequenceListMethod
SequenceList(dss::DSSContext, Value::Int64)

Get/set Index into Meter's SequenceList that contains branch pointers in lexical order. Earlier index guaranteed to be upline from later index. Sets PDelement active.

source
OpenDSSDirect.Meters.SequenceListMethod
SequenceList(dss::DSSContext) -> Int64

Get/set Index into Meter's SequenceList that contains branch pointers in lexical order. Earlier index guaranteed to be upline from later index. Sets PDelement active.

source

Monitors

OpenDSSDirect.Monitors.ByteStreamMethod
ByteStream(dss::DSSContext) -> Vector{Int8}

(read-only) Byte Array containing monitor stream values. Make sure a "save" is done first (standard solution modes do this automatically)

source
OpenDSSDirect.Monitors.ChannelMethod
Channel(dss::DSSContext, Index::Int64) -> Vector{Float64}

Array of doubles for the specified channel (usage: MyArray = DSSMonitor.Channel(i)) A Save or SaveAll should be executed first. Done automatically by most standard solution modes.

source
OpenDSSDirect.Monitors.DblFreqMethod
DblFreq(dss::DSSContext) -> Vector{Float64}

(read-only) Array of doubles containing frequency values for harmonics mode solutions; Empty for time mode solutions (use dblHour)

source
OpenDSSDirect.Monitors.DblHourMethod
DblHour(dss::DSSContext) -> Vector{Float64}

(read-only) Array of doubles containing time value in hours for time-sampled monitor values; Empty if frequency-sampled values for harmonics solution (see dblFreq)

source
OpenDSSDirect.Monitors.ModeMethod
Mode(
    dss::DSSContext,
    Value::Union{Int64, UInt32, OpenDSSDirect.Lib.MonitorModes}
)

Set Monitor mode (bitmask integer - see DSS Help)

source

Parallel

Parser

OpenDSSDirect.Parser.AutoIncrementMethod
AutoIncrement(dss::DSSContext, Value::Bool)

Default is FALSE. If TRUE parser automatically advances to next token after DblValue, IntValue, or StrValue. Simpler when you don't need to check for parameter names.

source
OpenDSSDirect.Parser.AutoIncrementMethod
AutoIncrement(dss::DSSContext) -> Bool

Default is FALSE. If TRUE parser automatically advances to next token after DblValue, IntValue, or StrValue. Simpler when you don't need to check for parameter names.

source
OpenDSSDirect.Parser.BeginQuoteMethod
BeginQuote(dss::DSSContext, Value::String)

String containing the the characters for Quoting in OpenDSS scripts. Matching pairs defined in EndQuote. Default is "'([{.

source
OpenDSSDirect.Parser.BeginQuoteMethod
BeginQuote(dss::DSSContext) -> String

String containing the the characters for Quoting in OpenDSS scripts. Matching pairs defined in EndQuote. Default is "'([{.

source
OpenDSSDirect.Parser.CmdStringMethod
CmdString(dss::DSSContext, Value::String)

String to be parsed. Loading this string resets the Parser to the beginning of the line. Then parse off the tokens in sequence.

source
OpenDSSDirect.Parser.CmdStringMethod
CmdString(dss::DSSContext) -> String

String to be parsed. Loading this string resets the Parser to the beginning of the line. Then parse off the tokens in sequence.

source
OpenDSSDirect.Parser.DelimitersMethod
Delimiters(dss::DSSContext, Value::String)

String defining hard delimiters used to separate token on the command string. Default is , and =. The = separates token name from token value. These override whitesspace to separate tokens.

source
OpenDSSDirect.Parser.DelimitersMethod
Delimiters(dss::DSSContext) -> String

String defining hard delimiters used to separate token on the command string. Default is , and =. The = separates token name from token value. These override whitesspace to separate tokens.

source
OpenDSSDirect.Parser.EndQuoteMethod
EndQuote(dss::DSSContext, Value::String)

String containing characters, in order, that match the beginning quote characters in BeginQuote. Default is "')]} (Setter)

source
OpenDSSDirect.Parser.EndQuoteMethod
EndQuote(dss::DSSContext) -> String

String containing characters, in order, that match the beginning quote characters in BeginQuote. Default is "')]} (Getter)

source
OpenDSSDirect.Parser.MatrixMethod
Matrix(dss::DSSContext, ExpectedOrder)

Use this property to parse a Matrix token in OpenDSS format. Returns square matrix of order specified. Order same as default Fortran order: column by column.

source
OpenDSSDirect.Parser.SymMatrixMethod
SymMatrix(dss::DSSContext, ExpectedOrder)

Use this property to parse a matrix token specified in lower triangle form. Symmetry is forced.

source

PDElements

OpenDSSDirect.PDElements.AllMaxCurrentsFunction
AllMaxCurrents(dss::DSSContext) -> Vector{Float64}
AllMaxCurrents(
    dss::DSSContext,
    AllNodes::Bool
) -> Vector{Float64}

Array of doubles with the maximum current across the conductors, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the "export capacity" command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

source
OpenDSSDirect.PDElements.AllPctEmergFunction
AllPctEmerg(dss::DSSContext) -> Vector{Float64}
AllPctEmerg(
    dss::DSSContext,
    AllNodes::Bool
) -> Vector{Float64}

Array of doubles with the maximum current across the conductors as a percentage of the Emergency Ampere Rating, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the "export capacity" command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

source
OpenDSSDirect.PDElements.AllPctNormFunction
AllPctNorm(dss::DSSContext) -> Vector{Float64}
AllPctNorm(
    dss::DSSContext,
    AllNodes::Bool
) -> Vector{Float64}

Array of doubles with the maximum current across the conductors as a percentage of the Normal Ampere Rating, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the "export capacity" command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

source
OpenDSSDirect.PDElements.IsShuntMethod
IsShunt(dss::DSSContext) -> Bool

Variant boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.

source
OpenDSSDirect.PDElements.NameMethod
Name(dss::DSSContext, Value::String)

Name of active PD Element. Returns null string if active element is not PDElement type. (Setter)

source
OpenDSSDirect.PDElements.NextMethod
Next(dss::DSSContext) -> Int64

Advance to the next PD element in the circuit. Enabled elements only. Returns 0 when no more elements.

source
OpenDSSDirect.PDElements.PctPermanentMethod
PctPermanent(dss::DSSContext, Value::Float64)

Get/Set percent of faults that are permanent (require repair). Otherwise, fault is assumed to be transient/temporary. (Setter)

source
OpenDSSDirect.PDElements.PctPermanentMethod
PctPermanent(dss::DSSContext) -> Float64

Get/Set percent of faults that are permanent (require repair). Otherwise, fault is assumed to be transient/temporary. (Getter)

source

Progress

Properties

OpenDSSDirect.Properties._setCurrentPropertyMethod
_setCurrentProperty(dss::DSSContext, argIndex::Int64)

Sets the current DSS property based on a 1-based integer (or integer as a string) as an property index, or a string as a property name.

source

PVsystems

OpenDSSDirect.PVsystems.IrradianceNowMethod
IrradianceNow(dss::DSSContext) -> Float64

Returns the current irradiance value for the active PVSystem. Use it to know what's the current irradiance value for the PV during a simulation.

source
OpenDSSDirect.PVsystems.TDutyMethod
TDuty(dss::DSSContext, Value::String)

Name of the emperature shape to use for duty cycle dispatch simulations such as for solar ramp rate studies. (Setter)

source
OpenDSSDirect.PVsystems.TDutyMethod
TDuty(dss::DSSContext) -> String

Name of the temperature shape to use for duty cycle dispatch simulations such as for solar ramp rate studies. (Getter)

source
OpenDSSDirect.PVsystems.yearlyMethod
yearly(dss::DSSContext, Value::String)

Dispatch shape to use for yearly simulations. Must be previously defined as a Loadshape object. If this is not specified, the Daily dispatch shape, if any, is repeated during Yearly solution modes. In the default dispatch mode, the PVSystem element uses this loadshape to trigger State changes. (Setter)

source
OpenDSSDirect.PVsystems.yearlyMethod
yearly(dss::DSSContext) -> String

Dispatch shape to use for yearly simulations. Must be previously defined as a Loadshape object. If this is not specified, the Daily dispatch shape, if any, is repeated during Yearly solution modes. In the default dispatch mode, the PVSystem element uses this loadshape to trigger State changes. (Getter)

source

Reactors

OpenDSSDirect.Reactors.Bus1Method
Bus1(dss::DSSContext, Value::String)

Name of first bus. Bus2 property will default to this bus, node 0, unless previously specified. Only Bus1 need be specified for a Yg shunt reactor. (Setter)

source
OpenDSSDirect.Reactors.Bus1Method
Bus1(dss::DSSContext) -> String

Name of first bus. Bus2 property will default to this bus, node 0, unless previously specified. Only Bus1 need be specified for a Yg shunt reactor. (Getter)

source
OpenDSSDirect.Reactors.Bus2Method
Bus2(dss::DSSContext, Value::String)

Name of 2nd bus. Defaults to all phases connected to first bus, node 0, (Shunt Wye Connection) except when Bus2 is specifically defined. Not necessary to specify for delta (LL) connection (Setter)

source
OpenDSSDirect.Reactors.Bus2Method
Bus2(dss::DSSContext) -> String

Name of 2nd bus. Defaults to all phases connected to first bus, node 0, (Shunt Wye Connection) except when Bus2 is specifically defined. Not necessary to specify for delta (LL) connection (Getter)

source
OpenDSSDirect.Reactors.LCurveMethod
LCurve(dss::DSSContext, Value::Float64)

Name of XYCurve object, previously defined, describing per-unit variation of phase inductance, L=X/w, vs. frequency. Applies to reactance specified by X, LmH, Z, or kvar property. L generally decreases somewhat with frequency above the base frequency, approaching a limit at a few kHz. (Setter)

source
OpenDSSDirect.Reactors.LCurveMethod
LCurve(dss::DSSContext)

Name of XYCurve object, previously defined, describing per-unit variation of phase inductance, L=X/w, vs. frequency. Applies to reactance specified by X, LmH, Z, or kvar property. L generally decreases somewhat with frequency above the base frequency, approaching a limit at a few kHz. (Getter)

source
OpenDSSDirect.Reactors.RMethod
R(dss::DSSContext, Value::Float64)

Resistance (in series with reactance), each phase, ohms. This property applies to REACTOR specified by either kvar or X. See also help on Z. (Setter)

source
OpenDSSDirect.Reactors.RMethod
R(dss::DSSContext) -> Float64

Resistance (in series with reactance), each phase, ohms. This property applies to REACTOR specified by either kvar or X. See also help on Z. (Getter)

source
OpenDSSDirect.Reactors.RCurveMethod
RCurve(dss::DSSContext, Value::String)

Name of XYCurve object, previously defined, describing per-unit variation of phase resistance, R, vs. frequency. Applies to resistance specified by R or Z property. If actual values are not known, R often increases by approximately the square root of frequency. (Setter)

source
OpenDSSDirect.Reactors.RCurveMethod
RCurve(dss::DSSContext) -> String

Name of XYCurve object, previously defined, describing per-unit variation of phase resistance, R, vs. frequency. Applies to resistance specified by R or Z property. If actual values are not known, R often increases by approximately the square root of frequency. (Getter)

source
OpenDSSDirect.Reactors.RmatrixMethod
Rmatrix(dss::DSSContext, Value::Array{Float64})

Resistance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X. (Setter)

source
OpenDSSDirect.Reactors.RmatrixMethod
Rmatrix(dss::DSSContext) -> Vector{Float64}

Resistance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X. (Getter)

source
OpenDSSDirect.Reactors.RpMethod
Rp(dss::DSSContext, Value::Float64)

Resistance in parallel with R and X (the entire branch). Assumed infinite if not specified. (Setter)

source
OpenDSSDirect.Reactors.RpMethod
Rp(dss::DSSContext) -> Float64

Resistance in parallel with R and X (the entire branch). Assumed infinite if not specified. (Getter)

source
OpenDSSDirect.Reactors.SpecTypeMethod
SpecType(dss::DSSContext) -> Int64

How the reactor data was provided: 1=kvar, 2=R+jX, 3=R and X matrices, 4=sym components. Depending on this value, only some properties are filled or make sense in the context.

source
OpenDSSDirect.Reactors.XMethod
X(dss::DSSContext, Value::Float64)

Reactance, each phase, ohms at base frequency. See also help on Z and LmH properties. (Setter)

source
OpenDSSDirect.Reactors.XMethod
X(dss::DSSContext) -> Float64

Reactance, each phase, ohms at base frequency. See also help on Z and LmH properties. (Getter)

source
OpenDSSDirect.Reactors.XmatrixMethod
Xmatrix(dss::DSSContext, Value::Array{Float64})

Reactance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X. (Setter)

source
OpenDSSDirect.Reactors.XmatrixMethod
Xmatrix(dss::DSSContext) -> Vector{Float64}

Reactance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X. (Getter)

source
OpenDSSDirect.Reactors.Z0Method
Z0(dss::DSSContext, Value::ComplexF64)

Zero-sequence impedance, ohms. Used to define the impedance matrix of the REACTOR if Z1 is also specified. Note: Z0 defaults to Z1 if it is not specifically defined. (Setter)

source
OpenDSSDirect.Reactors.Z0Method
Z0(dss::DSSContext) -> ComplexF64

Zero-sequence impedance, ohms. Used to define the impedance matrix of the REACTOR if Z1 is also specified. Note: Z0 defaults to Z1 if it is not specifically defined. (Getter)

source
OpenDSSDirect.Reactors.Z1Method
Z1(dss::DSSContext, Value::ComplexF64)

Positive-sequence impedance, ohms. If defined, Z1, Z2, and Z0 are used to define the impedance matrix of the REACTOR. Z1 MUST BE DEFINED TO USE THIS OPTION FOR DEFINING THE MATRIX. Side Effect: Sets Z2 and Z0 to same values unless they were previously defined. (Setter)

source
OpenDSSDirect.Reactors.Z1Method
Z1(dss::DSSContext) -> ComplexF64

Positive-sequence impedance, ohms. If defined, Z1, Z2, and Z0 are used to define the impedance matrix of the REACTOR. Z1 MUST BE DEFINED TO USE THIS OPTION FOR DEFINING THE MATRIX. Side Effect: Sets Z2 and Z0 to same values unless they were previously defined. (Getter)

source
OpenDSSDirect.Reactors.Z2Method
Z2(dss::DSSContext, Value::ComplexF64)

Negative-sequence impedance, ohms. Used to define the impedance matrix of the REACTOR if Z1 is also specified. Note: Z2 defaults to Z1 if it is not specifically defined. If Z2 is not equal to Z1, the impedance matrix is asymmetrical. (Setter)

source
OpenDSSDirect.Reactors.Z2Method
Z2(dss::DSSContext) -> ComplexF64

Negative-sequence impedance, ohms. Used to define the impedance matrix of the REACTOR if Z1 is also specified. Note: Z2 defaults to Z1 if it is not specifically defined. If Z2 is not equal to Z1, the impedance matrix is asymmetrical. (Getter)

source
OpenDSSDirect.Reactors.kVMethod
kV(dss::DSSContext, Value::Float64)

For 2, 3-phase, kV phase-phase. Otherwise specify actual coil rating. (Setter)

source
OpenDSSDirect.Reactors.kvarMethod
kvar(dss::DSSContext, Value::Float64)

Total kvar, all phases. Evenly divided among phases. Only determines X. Specify R separately (Setter)

source
OpenDSSDirect.Reactors.kvarMethod
kvar(dss::DSSContext) -> Float64

Total kvar, all phases. Evenly divided among phases. Only determines X. Specify R separately (Getter)

source

Reclosers

OpenDSSDirect.Reclosers.ResetMethod
Reset(dss::DSSContext)

Reset recloser to normal state. If open, lock out the recloser. If closed, resets recloser to first operation.

source
OpenDSSDirect.Reclosers.StateMethod
State(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.ActionCodes}
)

Present state of recloser. If set to open, open recloser's controlled element and lock out the recloser. If set to close, close recloser's controlled element and resets recloser to first operation. (Setter)

source
OpenDSSDirect.Reclosers.StateMethod
State(dss::DSSContext) -> OpenDSSDirect.Lib.ActionCodes

Present state of recloser. If set to open, open recloser's controlled element and lock out the recloser. If set to close, close recloser's controlled element and resets recloser to first operation. (Getter)

source

ReduceCkt

RegControls

OpenDSSDirect.RegControls.DelayMethod
Delay(dss::DSSContext, Value::Float64)

Time delay [s] after arming before the first tap change. Control may reset before actually changing taps. (Setter)

source
OpenDSSDirect.RegControls.DelayMethod
Delay(dss::DSSContext) -> Float64

Time delay [s] after arming before the first tap change. Control may reset before actually changing taps. (Getter)

source
OpenDSSDirect.RegControls.IsReversibleMethod
IsReversible(dss::DSSContext, Value::Bool)

Regulator can use different settings in the reverse direction. Usually not applicable to substation transformers. (Setter)

source
OpenDSSDirect.RegControls.MaxTapChangeMethod
MaxTapChange(dss::DSSContext, Value::Float64)

Maximum tap change per iteration in STATIC solution mode. 1 is more realistic, 16 is the default for a faster solution. (Setter)

source
OpenDSSDirect.RegControls.MaxTapChangeMethod
MaxTapChange(dss::DSSContext) -> Float64

Maximum tap change per iteration in STATIC solution mode. 1 is more realistic, 16 is the default for a faster solution. (Getter)

source
OpenDSSDirect.RegControls.TapDelayMethod
TapDelay(dss::DSSContext, Value::Float64)

Time delay [s] for subsequent tap changes in a set. Control may reset before actually changing taps. (Setter)

source

Relays

OpenDSSDirect.Relays.ResetMethod
Reset(dss::DSSContext)

Reset relay to normal state. If open, lock out the relay. If closed, resets relay to first operation.

source
OpenDSSDirect.Relays.StateMethod
State(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.ActionCodes}
)

Get/Set present state of relay. (Setter) If set to open (ActionCodes.Open = 1), open relay's controlled element and lock out the relay. If set to close (ActionCodes.Close = 2), close relay's controlled element and resets relay to first operation.

source
OpenDSSDirect.Relays.StateMethod
State(dss::DSSContext) -> OpenDSSDirect.Lib.ActionCodes

Get/Set present state of relay. (Getter) If set to open (ActionCodes.Open = 1), open relay's controlled element and lock out the relay. If set to close (ActionCodes.Close = 2), close relay's controlled element and resets relay to first operation.

source

Sensors

OpenDSSDirect.Sensors.CurrentsMethod
Currents(dss::DSSContext, Value::Vector{Float64})

Array of doubles for the line current measurements; don't use with kW and kVAR. (Setter)

source
OpenDSSDirect.Sensors.CurrentsMethod
Currents(dss::DSSContext) -> Vector{Float64}

Array of doubles for the line current measurements; don't use with kW and kVAR. (Getter)

source
OpenDSSDirect.Sensors.WeightMethod
Weight(dss::DSSContext, Value::Float64)

Weighting factor for this Sensor measurement with respect to other Sensors. Default is 1. (Setter)

source
OpenDSSDirect.Sensors.WeightMethod
Weight(dss::DSSContext) -> Float64

Weighting factor for this Sensor measurement with respect to other Sensors. Default is 1. (Getter)

source
OpenDSSDirect.Sensors.kVBaseMethod
kVBase(dss::DSSContext, Value::Float64)

Voltage base for the sensor measurements. LL for 2 and 3-phase sensors, LN for 1-phase sensors. (Setter)

source
OpenDSSDirect.Sensors.kVBaseMethod
kVBase(dss::DSSContext) -> Float64

Voltage base for the sensor measurements. LL for 2 and 3-phase sensors, LN for 1-phase sensors. (Getter)

source
OpenDSSDirect.Sensors.kVSMethod
kVS(dss::DSSContext, Value::Vector{Float64})

Array of doubles for the LL or LN (depending on Delta connection) voltage measurements. (Setter)

source
OpenDSSDirect.Sensors.kVSMethod
kVS(dss::DSSContext) -> Vector{Float64}

Array of doubles for the LL or LN (depending on Delta connection) voltage measurements. (Getter)

source
OpenDSSDirect.Sensors.kWMethod
kW(dss::DSSContext, Value::Vector{Float64})

Array of doubles for P measurements. Overwrites Currents with a new estimate using kVAR. (Setter)

source
OpenDSSDirect.Sensors.kWMethod
kW(dss::DSSContext) -> Vector{Float64}

Array of doubles for P measurements. Overwrites Currents with a new estimate using kVAR. (Getter)

source
OpenDSSDirect.Sensors.kvarMethod
kvar(dss::DSSContext, Value::Vector{Float64})

Array of doubles for Q measurements. Overwrites Currents with a new estimate using kW. (Setter)

source
OpenDSSDirect.Sensors.kvarMethod
kvar(dss::DSSContext) -> Vector{Float64}

Array of doubles for Q measurements. Overwrites Currents with a new estimate using kW. (Getter)

source

Settings

OpenDSSDirect.Settings.CktModelMethod
CktModel(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.CktModels}
)

{dssMultiphase * | dssPositiveSeq} IIndicate if the circuit model is positive sequence. (Setter)

source
OpenDSSDirect.Settings.CktModelMethod
CktModel(dss::DSSContext) -> OpenDSSDirect.Lib.CktModels

{dssMultiphase * | dssPositiveSeq} IIndicate if the circuit model is positive sequence. (Getter)

source
OpenDSSDirect.Settings.IterateDisabledMethod
IterateDisabled(dss::DSSContext, Value::Bool)

Controls whether First/Next iteration includes or skips disabled circuit elements. The default behavior from OpenDSS is to skip those. The user can still activate the element by name or index.

The default value for IterateDisabled is 0, keeping the original behavior. Set it to 1 (or True) to include disabled elements. Other numeric values are reserved for other potential behaviors.

(Setter) (API Extension)

source
OpenDSSDirect.Settings.IterateDisabledMethod
IterateDisabled(dss::DSSContext) -> Bool

Controls whether First/Next iteration includes or skips disabled circuit elements. The default behavior from OpenDSS is to skip those. The user can still activate the element by name or index.

The default value for IterateDisabled is 0, keeping the original behavior. Set it to 1 (or True) to include disabled elements. Other numeric values are reserved for other potential behaviors.

(Getter) (API Extension)

source
OpenDSSDirect.Settings.LoadsTerminalCheckMethod
LoadsTerminalCheck(dss::DSSContext, Value::Bool)

Get/Set the state of terminal checking in all load elements. (Setter)

This controls whether the terminals are checked when updating the currents in Load component. Defaults to true. If the loads are guaranteed to have their terminals closed throughout the simulation, this can be set to false to save some time.

(API Extension)

source
OpenDSSDirect.Settings.LoadsTerminalCheckMethod
LoadsTerminalCheck(dss::DSSContext) -> Bool

Get/Set the state of terminal checking in all load elements. (Getter)

This controls whether the terminals are checked when updating the currents in Load component. Defaults to true. If the loads are guaranteed to have their terminals closed throughout the simulation, this can be set to false to save some time.

(API Extension)

source
OpenDSSDirect.Settings.PriceCurveMethod
PriceCurve(dss::DSSContext, Value::String)

Name of LoadShape object that serves as the source of price signal data for yearly simulations, etc. (Setter)

source
OpenDSSDirect.Settings.PriceCurveMethod
PriceCurve(dss::DSSContext) -> String

Name of LoadShape object that serves as the source of price signal data for yearly simulations, etc. (Getter)

source
OpenDSSDirect.Settings.ZoneLockMethod
ZoneLock(dss::DSSContext, Value::Bool)

{True | False*} Locks Zones on energy meters to prevent rebuilding if a circuit change occurs. (Setter)

source
OpenDSSDirect.Settings.ZoneLockMethod
ZoneLock(dss::DSSContext) -> Bool

{True | False*} Locks Zones on energy meters to prevent rebuilding if a circuit change occurs. (Getter)

source

Solution

OpenDSSDirect.Solution.AddTypeMethod
AddType(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.AutoAddTypes}
)

Type of device to add in AutoAdd Mode: {dssGen (Default) | dssCap} (Setter)

source
OpenDSSDirect.Solution.AddTypeMethod
AddType(dss::DSSContext) -> OpenDSSDirect.Lib.AutoAddTypes

Type of device to add in AutoAdd Mode: {dssGen (Default) | dssCap} (Getter)

source
OpenDSSDirect.Solution.AlgorithmMethod
Algorithm(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.SolutionAlgorithms}
)

Base Solution algorithm: {dssNormalSolve | dssNewtonSolve} (Setter)

source
OpenDSSDirect.Solution.ControlModeMethod
ControlMode(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.ControlModes}
)

{dssStatic* | dssEvent | dssTime} Modes for control devices (Setter)

source
OpenDSSDirect.Solution.MinIterationsMethod
MinIterations(dss::DSSContext, Value::Int64)

(read) Minimum number of iterations required for a power flow solution. (write) Mininum number of iterations required for a power flow solution.

source
OpenDSSDirect.Solution.MinIterationsMethod
MinIterations(dss::DSSContext) -> Int64

(read) Minimum number of iterations required for a power flow solution. (write) Mininum number of iterations required for a power flow solution.

source
OpenDSSDirect.Solution.ModeMethod
Mode(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.SolveModes}
)

Set present solution mode (by a text code - see DSS Help)

source
OpenDSSDirect.Solution.RandomMethod
Random(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.RandomModes}
)

Randomization mode for random variables "Gaussian" or "Uniform" (Setter)

source
OpenDSSDirect.Solution.RandomMethod
Random(dss::DSSContext) -> OpenDSSDirect.Lib.RandomModes

Randomization mode for random variables "Gaussian" or "Uniform" (Getter)

source
OpenDSSDirect.Solution.TotalTimeMethod
TotalTime(dss::DSSContext, Value::Float64)

(read) Gets the accumulated time of the simulation (write) Sets the Accumulated time of the simulation

source

Storages

OpenDSSDirect.Storages.StateMethod
State(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.StorageStates}
)

Set state: 0=Idling; 1=Discharging; -1=Charging;

Related enumeration: StorageStates

source

SwtControls

OpenDSSDirect.SwtControls.ActionMethod
Action(
    dss::DSSContext,
    Value::Union{Int64, OpenDSSDirect.Lib.ActionCodes}
)

Open or Close the switch. No effect if switch is locked. However, Reset removes any lock and then closes the switch (shelf state). (Setter)

source
OpenDSSDirect.SwtControls.ActionMethod
Action(dss::DSSContext) -> OpenDSSDirect.Lib.ActionCodes

Open or Close the switch. No effect if switch is locked. However, Reset removes any lock and then closes the switch (shelf state). (Getter)

source
OpenDSSDirect.SwtControls.DelayMethod
Delay(dss::DSSContext, Value::Float64)

Time delay [s] betwen arming and opening or closing the switch. Control may reset before actually operating the switch. (Setter)

source
OpenDSSDirect.SwtControls.DelayMethod
Delay(dss::DSSContext) -> Float64

Time delay [s] betwen arming and opening or closing the switch. Control may reset before actually operating the switch. (Getter)

source

Text

OpenDSSDirect.Text.CommandMethod
Command(dss::DSSContext, Value::Vector{String})

Runs a list of commands all at once in the engine. Ignores potential intermediate output in the global result.

(API Extension)

source
OpenDSSDirect.Text.CommandBlockMethod
CommandBlock(dss::DSSContext, Value::String)

Runs a large string (block) containing many lines of commands. Ignores potential intermediate output in the global result.

(API Extension)

source

Topology

TSData

Transformers

OpenDSSDirect.Transformers.RneutMethod
Rneut(dss::DSSContext, Value::Float64)

Active Winding neutral resistance [ohms] for wye connections. Set less than zero for ungrounded wye. (Setter)

source
OpenDSSDirect.Transformers.RneutMethod
Rneut(dss::DSSContext) -> Float64

Active Winding neutral resistance [ohms] for wye connections. Set less than zero for ungrounded wye. (Getter)

source
OpenDSSDirect.Transformers.WdgMethod
Wdg(dss::DSSContext, Value::Float64)

Active Winding Number from 1..NumWindings. Update this before reading or setting a sequence of winding properties (R, Tap, kV, kVA, etc.) (Setter)

source
OpenDSSDirect.Transformers.WdgMethod
Wdg(dss::DSSContext) -> Float64

Active Winding Number from 1..NumWindings. Update this before reading or setting a sequence of winding properties (R, Tap, kV, kVA, etc.) (Getter)

source
OpenDSSDirect.Transformers.WdgCurrentsMethod
WdgCurrents(dss::DSSContext) -> Vector{Float64}

All Winding currents (ph1, wdg1, wdg2,... ph2, wdg1, wdg2 ...)

WARNING: If the transformer has open terminal(s), results may be wrong, i.e. avoid using this in those situations. For more information, see https://github.com/dss-extensions/dss-extensions/issues/24

source
OpenDSSDirect.Transformers.WdgVoltagesMethod
WdgVoltages(dss::DSSContext) -> Vector{ComplexF64}

Complex array of voltages for active winding

WARNING: If the transformer has open terminal(s), results may be wrong, i.e. avoid using this in those situations. For more information, see https://github.com/dss-extensions/dss-extensions/issues/24

source
OpenDSSDirect.Transformers.XhlMethod
Xhl(dss::DSSContext, Value::Float64)

Percent reactance between windings 1 and 2, on winding 1 kVA base. Use for 2-winding or 3-winding transformers. (Setter)

source
OpenDSSDirect.Transformers.XhlMethod
Xhl(dss::DSSContext) -> Float64

Percent reactance between windings 1 and 2, on winding 1 kVA base. Use for 2-winding or 3-winding transformers. (Getter)

source
OpenDSSDirect.Transformers.XhtMethod
Xht(dss::DSSContext, Value::Float64)

Percent reactance between windigns 1 and 3, on winding 1 kVA base. Use for 3-winding transformers only. (Setter)

source
OpenDSSDirect.Transformers.XhtMethod
Xht(dss::DSSContext) -> Float64

Percent reactance between windigns 1 and 3, on winding 1 kVA base. Use for 3-winding transformers only. (Getter)

source
OpenDSSDirect.Transformers.XltMethod
Xlt(dss::DSSContext, Value::Float64)

Percent reactance between windings 2 and 3, on winding 1 kVA base. Use for 3-winding transformers only. (Setter)

source
OpenDSSDirect.Transformers.XltMethod
Xlt(dss::DSSContext) -> Float64

Percent reactance between windings 2 and 3, on winding 1 kVA base. Use for 3-winding transformers only. (Getter)

source
OpenDSSDirect.Transformers.kVMethod
kV(dss::DSSContext, Value::Float64)

Active Winding kV rating. Phase-phase for 2 or 3 phases, actual winding kV for 1 phase transformer. (Setter)

source
OpenDSSDirect.Transformers.kVMethod
kV(dss::DSSContext) -> Float64

Active Winding kV rating. Phase-phase for 2 or 3 phases, actual winding kV for 1 phase transformer. (Getter)

source
OpenDSSDirect.Transformers.kVAMethod
kVA(dss::DSSContext, Value::Float64)

Active Winding kVA rating. On winding 1, this also determines normal and emergency current ratings for all windings. (Setter)

source
OpenDSSDirect.Transformers.kVAMethod
kVA(dss::DSSContext) -> Float64

Active Winding kVA rating. On winding 1, this also determines normal and emergency current ratings for all windings. (Getter)

source
OpenDSSDirect.Transformers.strWdgCurrentsMethod
strWdgCurrents(dss::DSSContext) -> String

All winding currents in CSV string form like the WdgCurrents property

WARNING: If the transformer has open terminal(s), results may be wrong, i.e. avoid using this in those situations. For more information, see https://github.com/dss-extensions/dss-extensions/issues/24

source

Vsources

WireData

XYCurves

OpenDSSDirect.XYCurves.XArrayMethod
XArray(dss::DSSContext, Value::Vector{Float64})

X values as a Array of doubles. Set Npts to max number expected if setting (Setter)

source

YMatrix

OpenDSSDirect.YMatrix.getYsparseFunction
getYsparse(
    dss::DSSContext
) -> SparseArrays.SparseMatrixCSC{ComplexF64, Int64}
getYsparse(
    dss::DSSContext,
    factor::Bool
) -> SparseArrays.SparseMatrixCSC{ComplexF64, Int64}

Return SparseMatrixCSC of ComplexF64

source

ZIP

OpenDSSDirect.ZIP.ContainsMethod
Contains(dss::DSSContext, Name::String) -> Bool

Check if the given path name is present in the current ZIP file.

(API Extension)

source
OpenDSSDirect.ZIP.ExtractMethod
Extract(dss::DSSContext, FileName::String) -> Vector{Int8}

Extracts the contents of the file "FileName" from the current (open) ZIP file. Returns a byte-string.

(API Extension)

source
OpenDSSDirect.ZIP.ListMethod
List(dss::DSSContext, regexp::String) -> Vector{String}

List of strings consisting of all names match the regular expression provided in regexp. If no expression is provided, all names in the current open ZIP are returned.

See https://regex.sorokin.engineer/en/latest/regular_expressions.html for information on the expression syntax and options.

(API Extension)

source
OpenDSSDirect.ZIP.OpenMethod
Open(dss::DSSContext, Value::String)

Opens and prepares a ZIP file to be used by the DSS text parser. Currently, the ZIP format support is limited by what is provided in the Free Pascal distribution. Besides that, the full filenames inside the ZIP must be shorter than 256 characters. The limitations should be removed in a future revision.

(API Extension)

source
OpenDSSDirect.ZIP.RedirectMethod
Redirect(dss::DSSContext, FileInZip::String)

Runs a "Redirect" command inside the current (open) ZIP file. In the current implementation, all files required by the script must be present inside the ZIP, using relative paths. The only exceptions are memory-mapped files.

(API Extension)

source