Draw a single line diagram, connect and bind it, and see how the power flow engine energizes it at runtime.
Modules → Electrical Pack → Single Line Diagrams and Power Flow
This walkthrough rebuilds the SingleLine display of the Electrical Template: a 230 kV line, a 230/69 kV transformer and one 69 kV feeder.
In Unified Namespace → Tags, create one tag per piece of equipment and set its type to the matching UserType:
Tag | Type | Equipment |
|---|---|---|
| Generator | 230 kV line (the source) |
| Switch | Line disconnector |
| Breaker | Line, transformer high side, transformer low side and feeder breakers |
| BusBar | 230 kV and 69 kV buses |
| Transformer | 230/69 kV transformer |
A line coming from the grid is modeled as a Generator drawn with the Generator_Transmission symbol: it is the source that energizes the diagram.
Create a Canvas display and open it in the Draw editor.
From the Symbols panel (In Solution), drag the electrical symbols onto the canvas: Generator_Transmission, Switch, Breaker, BusBar, Breaker, Transformer, Breaker, BusBar, Breaker, Standard_Load.
Select each symbol and set its properties:
The equipment link (Generator, Switch, Breaker, BusBar, Transformer) to its tag, for example @Tag.SL_52L1.
On the source: BaseVoltage = @Enum.Voltage.kV_230.
On the transformer: BaseVoltage1 = @Enum.Voltage.kV_230, BaseVoltage2 = @Enum.Voltage.kV_69, and the winding connections TypeConnector1 and TypeConnector2.
Select the Connector tool.
Click a terminal of the first symbol, then a terminal of the next one. The connector attaches to the terminal; a red marker shows the terminal it will attach to.
Repeat for every link: source, disconnector, line breaker, 230 kV bus, transformer high side breaker, transformer, transformer low side breaker, 69 kV bus, feeder breaker, load.
On a BusBar, feed it on a top node (odd numbers) and take the outgoing circuits from a bottom node (even numbers). Use the end nodes 97 and 98 for bus couplers.
A line that only looks connected does not carry energization. Always end a connector on a terminal. |
Saving the display stores the topology. With the Electrical Pack in the license, the save also gives every connector its own color channel, so each line shows the voltage of its own section, and writes the equipment identification to the bound tags. Save again after you change any connection.
Start the runtime and open the display. Within a few seconds the engine colors the network: the source and everything it reaches through closed devices take the energized color of their voltage level; sections behind an open device take the de-energized color.
What you see | Why |
|---|---|
The 230 kV side and the 69 kV side in different colors | Each voltage level has its own energized color in |
Breaker body in the closed color | Closed, good quality, from |
Breaker body in the open color and the line below dark | Open; the downstream section is de-energized |
Without field devices, turn on SIMULATION in the header. The engine then makes each equipment follow its own commands: a breaker goes to the commanded position, a generator to the commanded state.
Click the feeder breaker. Its dialog opens.
Click Open and confirm with Yes.
The breaker opens and the feeder is de-energized.
Simulation is a client setting: it acts only while that client has the check box on.
Symptom | Check |
|---|---|
Nothing is colored | The license includes the Electrical Pack; the symbols are electrical symbols ( |
One symbol stays uncolored | Its equipment link points to a tag of the same UserType as the symbol: a Breaker symbol needs a Breaker tag. |
A section stays dark although its breakers are closed | A connector does not end on a terminal, or a busbar is fed from a bottom node. |
The generator does not energize |
|
Display opens. With the Electrical Pack in the license and connected electrical symbols on the display, the client creates one engine instance for that display.
Register. The client registers every electrical symbol and connector on the canvas as an element, with its type (the symbol name without the _H, _V or _Type2 suffix) and its bound equipment tag, then registers each saved connection between two terminals.
Cycle. While the display is open, the engine runs on every refresh cycle of the display.
Reads the Simulation setting of the client.
Copies the tag values into the network: generator state and base voltage, breaker, disconnector and fuse positions and quality, transformer winding voltages.
Orders the generators by voltage, highest first, and walks the network from each running generator through the connections:
closed breakers, disconnectors and fuses pass power; open ones stop it;
transformers change the voltage to the base voltage of each winding;
bars and busbars join every connected line;
connectors carry the voltage of their section.
Writes the result back to the tags: colors, states, and terminal voltages, plus the color channel of each connector.
When Simulation is on, each equipment also follows its commands.
A closed loop in the network is handled: an element is visited once per walk, so a ring does not repeat. A connection to an element that is no longer on the display is skipped, and the runtime trace names the element that holds it.
Lines and equipment: the TensionColors enumeration. Each voltage level has an energized color (ActiveColor) and a de-energized color (InactiveColor).
Switching devices: the SwitchColors enumeration, one color per state (intermediate, closed, open, inconsistent); good quality uses ActiveColor and bad quality uses InactiveColor.
Change a color once in the enumeration and every diagram follows it.
Element | Reads | Writes | With Simulation on |
|---|---|---|---|
Generator |
|
| State follows |
Breaker |
| Colors, state, terminal voltages and states | Position follows |
Switch |
| As Breaker | Position follows |
Fuse |
| Colors and state | |
Transformer, Transformer3 | Winding base voltages | Colors and voltages per winding | Paralleling, forced air and tap mode follow their commands |
Reactor, Capacitor, Rectifier | Colors and states of both terminals | ||
Bar, BusBar, Standard, Jumper, Connector | Color of the element |
The power flow engine is built into the product. A solution can replace it with its own: a Script Class named Power, domain Client, content Namespace, declaring the namespace T.MyPower. When that class exists, the client loads T.MyPower.Power (or T.MyPower.PowerBase); otherwise it uses the built in engine.
The Electrical Template ships its own Power class: a full copy of the engine that adds the directional BusBar element. Displays that use the BusBar symbol need this class. The class is compiled for both the desktop clients and the HTML5 client, so keep any change compatible with both.
Edit Scripts → Classes → Power. Common changes:
A new equipment type: add a class derived from BaseElement, named exactly as the symbol (without suffix), and override the steps you need.
Different energization rules: override the execution steps of an existing element, for example to treat a breaker in test position as open.
Different simulation: override Simulation() of an element.
public class MySwitchgear : BaseElement
{
public Terminal Terminal1 { get; set; } = new Terminal();
public Terminal Terminal2 { get; set; } = new Terminal();
public MySwitchgear(string objectNameOrUid, Guid guid, PowerBase parent)
: base(objectNameOrUid, guid, parent) { }
public override void CopyTagToNet() { /* read your tag members */ }
public override void CopyNetToTag() { /* write colors and states */ }
public override Terminal GetTerminal(int terminal)
=> terminal == 1 ? this.Terminal1 : this.Terminal2;
} |
Build the solution after editing. If the class does not build, the display shows no energization and the client trace reports that the Power class could not be found.
With Debug tracing on, the engine writes the network topology to the trace when the display opens (which element connects to which), and reports any cycle that takes longer than 50 ms.