Dynamic Coloring in Ignition

Hi everyone,

There is a topic in Power SCADA which is called “dynamic coloring” and I have to implement it in the Ignition.

This feature is used to show operators the state of energizing and de-energize of each elements
and line in SLD (Single Line diagram) base on the state of CBs and power sources like a power plant or substation in the whole circuit by changing the color.

As the SLD getting larger and larger (for example for a small city) using the traditional binding method on tags or using expression binding with a lot of if statement is pointless and really time-consuming,
so I wonder how to make lines and elements color dynamics.

As a very simple example consider the following samples. There are many loops and complex conditions to decide which line has to show powered or not. We may have lines that can be energized on three different sides.


One method is to parse power grid mesh with an algorithm and find out the final state and send it as JSON to the view that shows the SLD. The message receiver in the view then assigns data one by one to the background SVG of SLD by using the SVG ID Tag. But I don’t know how to calculate JSON in the first place.
Some specific SCADA packages can import SLD as AutoCAD and after you define the sources of power they calculate it for you automatically.
If anyone has any experience or idea on how to do that please share it.

Ignition is not going to be able to import an SLD and create tags/bindings/graphics automatically.

I know that and that’s I try to explain it in the topic. What I’m looking at is how to calculate the power mesh energized or not base on CBs and power sources tags.
If I can solve this the rest is easy. I can convert dwg of SLD to svg and assign them TAG ID. And in ignition search svg DOM by it.

Very interested in what you come up with, as this would be useful for complex p&ids as well. We tried using chained expressions before in Vision (ie stored the state of each segment and bound the state of the downstream segments to its connected upstream segments) but from memory it updated quite slowly as any change in calc value upstream caused cascading updates downstream


I wished someone came with some idea or trick for this and wonder why nobody see this problem before.

Only idea I have is to implement this in vision, but this is far for been a solution. Perspective, in my opinion is not mature enough to handle this kind of projects yet. What brings to my mind to congratulate you for your work in project with perspective knowing its limitations.
In vision you’ll only need great organization with component names of lines of those diagrams, and to avoid making hundred of binding you could implement a script to call every component names in window with some prefix and set a property color value with a tag change script. I don’t know if that would trigger an idea on you.

1 Like

What I’m looking for is a algorithm for calculating which element is energize and which is not then I can assign data to element by a script.

You can solve this as an electrical circuit with nodes (buses) and branches (feeders/bus-couplers). Form an admittance matrix for the network each cycle based on status of the CB’s status (close = small resistance say 0.001, open=large resistance, say 9999.). Then inject 1 amp current at all the sources and calculate the voltage at each node by inverting the admittance matrix. Whichever nodes have voltage close to 0 those buses are deenergized, where ever its high they are energized. The branch current in each branch can be calculated based on the node voltages. The energization status of all buses and feeders can then be decided based on node voltages and branch currents. This can be done in server side and stored as two Boolean arrays of memory tags representing the energization status of buses and feeders and sent to client for displaying the colours of various buses and feeders.

But I don’t understand why you don’t have voltages available at all the buses in your tag db? Are only CB status available not the voltage and currents?

1 Like

Thanks greate idea. Do you have any practical example or source code for it?
I have current voltages in my DB. I have both energy source like Substation and CB.
Both of them have to be considered

Then why can’t voltage at buses and currents in branches be used to determine the energization status to change the color of the elements in the SLD? I didn’t understand the difficulty in doing so!

The algorithm can be written in a script , but I hope I have understood the problem!

1 Like

Because some of them have and rest doesn’t. For example only the source of power like Substation or power plant have PLC and others lines are just drawing. Also CB has PLC so I have open close postion.

Oh ok, mmm you'll need to build a transmission line model and perform transient simulations and analysis, like flow through loads.
There's advanced literature around this topic and that's why another software exists. With Ignition, I think you'll need to build libraries and scripts to try to build something similar.
Ones I used ETAP to make a small simulation.

1 Like

That will be too much effort just to know which lines are charged which are not! It can be done in a very simplified manner so that algorithm can run in few milli seconds and give the status of energization of buses and lines.

If you can model the network with branch/node numbers (number all nodes and number all branches once for all) then form an admittance matrix every cycle based on CB Status. It will be a very sparse matrix depending upon how many nodes you have in the network (10's or 100's or more ?). Then invert the matrix then find voltages at all buses by injecting 1 amp current at the source nodes. The voltages will give energization status.

Or you could devise your own topological tracing algorithms using graph theory to identify which buses are connected to source and which are not. You may have to do some search for such algorithms or device your own using common sense approach!

1 Like

Nice idea, actually our ideas are related. In fact to achieve your idea, it is necessary to build a transmission model to obtain the resistance and reactance of lines and then connect them to buses and identify generator and loads. Then ahead building an admittance matrix is trivial.

1 Like

Yes I agree, but its not necessary to know the line parameters for modelling the grid, we can just assume a finite or infinite resistance (reactance not required, no complex maths required) for each line based on the CB statuses. Our aim is just to know if a bus is charged or not for the current breaker status. Also the admittance formation is required when ever there is a change in CB status in the network.

1 Like