Useful Scripts for the Non-Programmer: Interpreting Telvent Feeder Manager Bits

August 7, 2011 — Skye Perry

Just about all of our electric utility clients use Telvent Feeder Manager to manage the connectivity of their electric distribution (and some transmission) circuits. Feeder Manager is a great application that builds on the core value of an ESRI geometric network. I don’t want to get into the details of what a geometric network is or how they work here. Instead I want to focus on how Telvent manages the flow of electricity through a geometric network.

Feeder Manager maintains your electric connectivity as you edit the data within ArcMap by using a series of AutoUpdaters (Telvent GIS triggers).

The first thing that the AutoUpdaters (AU’s) do is read the key electric attributes from the current feature record being created/updated. These attributes include phase designation, normal status (open/closed), device type, etc.

To make the electric traces faster, Feeder Manager combines all of the important electric properties into a single field typically named MMElectricTraceweight. This is achieved by using a bit gate. A bit gate uses good ole binary bits – 1’s and 0’s to indicate whether specific property is true or false. As you may (or may not) remember from school, there are 8 bits in 1 byte and we can fit 4 bytes into an ESRI long integer field in the database. Therefore we essentially have 32 (4 bytes x 8 bits/byte) configurable true/false properties we can track about a feature record in the geometric network.

In the case of Feeder Manager, these 32 different bits indicate different electric properties of the feature record. These electric properties are defined by Telvent and can be found in the configuration help documentation. Point features (junctions) and linear features (edges) use different bits to indicate different electric properties. We’ve included some of the more important bits here:

Junction Bit

3 Phase A Exists
4 Phase B Exists
5 Phase C Exists
8 Phase A Protected
9 Phase B Protected
10 Phase C Protected
12 Device is a Switch
13 Device is a Circuit Source
14 Device is a Transformer
28 Phase A Normal Status (open/closed)
29 Phase B Normal Status (open/closed)
30 Phase C Normal Status (open/closed)
Edge Bit

12 Non-Traceable
28 Phase A Exists
29 Phase B Exists
30 Phase C Exists

So these bit gates are very cool in that we can have a single numeric field that tells us all of the information above. These bit gates can be used by the electric traces to determine the electric connectivity of a circuit. Processing this data is extremely fast because it is all numeric and ESRI provides special techniques for interacting with the bit gate during tracing, which further speeds things up.

In addition to the MMElectricTraceweight bit gate, Feeder Manager utilizes another bit gate field to store even more information about each electric feature as it relates to the rest of the circuit. This data is stored in the FeederInfo field. FeederInfo tracks the same data for junctions and edges including the following useful values:

FeederInfo Bit

0 Energized on Phase A
1 Energized on Phase B
2 Energized on Phase C
3 Feature is part of an Island (not energized)
6 Feature is part of an electrical loop
7 Feature is part of a multi-feed (fed from more than one circuit source)
8 Feature is a terminal device (when OPEN, prevents flow of electricity)
9 Feature is a tie device (OPEN device tying two circuits together)

Everything above is pretty common knowledge but what most folks don’t realize is that you can use the bit gate fields for your own analysis as well by writing queries against the data, using the data in your VBA or C#.Net scripts/apps, or even to visualize the data within ArcMap. Both SQL Server and Oracle provide functions to interpret individual bits within a bit gate. For example, if we wanted to find all of the overhead primary that exists within a loop, we could use a where clause like this:

Oracle:

where BitAnd(FeederInfo, Power(2, 6)) > 0;

SQL Server:

where (FeederInfo & Power(2, 6)) > 0;

The red value of 6 above is the bit we are filtering on from the FeederInfo bit gate. We can switch out this value with any other bit value from the above table to get back the relevant results. This is a very simple way to find all of your loops (6), islands (3), or multi-feeds (7) in your GIS data. You can plug this into the Definition Query tab of an ArcMap layer file to filter the data shown on the map:

useful-scripts-layer-properties

Or plug it into the Select By Attributes tool to select all of the records on the map:
useful-scripts-select-by-attributes

Or even use it when querying an ESRI Multi-Version View directly in the database:

Oracle:

select * from GIS.PrimaryOhLineSection_MV where BitAnd(FeederInfo, Power(2, 6)) > 0;

SQL Server:

select * from GIS.PrimaryOhLineSection_MV where (FeederInfo & Power(2, 6)) > 0;

If we combine the FeederInfo bit gate with the MMElectricTraceweight bit gate we can do some even more interesting things. One of my favorites is to query the data for dropped phases. A dropped phase is where the energized phases are less than the phase designation on the feature. For example, we might want to find all of the 3-Phase lines that are NOT energized on all three phases. This can occur for a variety of reasons within the data and might be important for us to correct if this data feeds an Outage Management System (OMS) or any other application that depends on the electric properties of the data. The following query is generic enough to return all records with any dropped phase (A, B, or C):

Oracle:

where (BitAnd(ElectricTraceWeight, Power(2, 3)) > 
and (
BitAnd(FeederInfo, Power(2, 0)) = 0)
OR (BitAnd(ElectricTraceWeight, Power(2, 4)) > 
and (
BitAnd(FeederInfo, Power(2, 1)) = 0)
OR (BitAnd(ElectricTraceWeight, Power(2, 5)) > 
and (
BitAnd(FeederInfo, Power(2, 2)) = 0)

SQL Server:

where ((ElectricTraceWeight & Power(2, 3)) > 
and (
FeederInfo & Power(2, 0)) = 0)
OR ((ElectricTraceWeight & Power(2, 4)) > 
and (
FeederInfo & Power(2, 1)) = 0)
OR ((ElectricTraceWeight & Power(2, 5)) > 
and (
FeederInfo & Power(2, 2)) = 0)

In the first half of the above queries, we are checking bits 3, 4, and 5 of the MMElectricTraceWeight bit gate which correspond to phases A, B, and C in the phase designation field on the record. We use the “> 0” operator to check for the existence of each phase. This indicates the bit is set to 1 (or true).

Then in the second half of the statement we are checking bits 0, 1, and 2 of the FeederInfo bit gate which correspond to the energized phases A, B, and C based on the electricity being fed into the record. Here we are using the “= 0” operator to look for phases that are not energized. This indicates the bit is set to 0 (or false).

When we combine these two queries we end up looking for records with phase A that are not energized on phase A, records with phase B that are not energized on phase B, and records with phase C that are not energized on phase C. Pretty cool stuff… hopefully this makes sense and you can start thinking of other ways you could use the above bit gates to validate the data in your GIS.

In summary, we’ve reviewed the two bit gate fields used by Telvent Feeder Manager, what each bit indicates, and how to query the individual bits in each field. Once you get these query patterns down you can create some very powerful views of your data that perhaps you never even knew were possible.

We Wrote the Book

The Indispensible Guide to ArcGIS Online

Download It for Free
Chairman of the Board

5 comments

  • This looks to be a very useful article, giving users the ability to find features that are not playing nice, perhaps participating in their own fantasy loops. I would, however like a little clarification on what your query is doing. My understanding is that I could select where FeederInfo = 6However, you are starting at some point beyond that and I don’t understand how or why. where BitAnd(FeederInfo, Power(2, 6)) > 0;Many thanks!

    • Keep in mind that FeederInfo is a bitgate field. This means that the end value is really just a compilation of binary bits. So if you are looking at the FeederInfo field for features that are in a loop, you couldn’t just query for FeederInfo=6 as you noted above. The end value in the FeederInfo field isn’t actually the value of “6”. Instead the 6th bit in the value is toggled to a value of “1” or true.

      I’d recommend reading up on binary to decimal conversions. Just google “understanding binary to decimal” and you’ll get plenty of hits.

      The use of a bitgate allows us to track many different values by toggling different bits. Then we can convert the resulting binary value into a decimal value which is what gets stored in the FeederInfo field.

      The quick example for loops is that we need to look at the 6th bit for a true/false (1/0) value. When talking binary this goes from right to left and is 0-based. So a binary value with the 6th bit true would be displayed as: 01000000

      If you count digits from right to left, the 7th digit is set to 1/true. This is the 6th bit. Now when we convert the binary value of 01000000 to decimal, we get a value of 64. You can validate this online using any bit to decimal conversion (google it). So the value of 64 would be stored in the FeederInfo if the feature was part of a loop but did not encompass ANY of the other possible values (energized on A, B, or C, part of an island, etc, etc.). But that’s not reality… because each feature is typically going to have more than one bit set to true.

      Using the binary pattern, a feature energized on A, B, and C that is NOT an island, that IS in a loop, is NOT part of a multi-feed, is NOT a terminal device, and is NOT a tie device would have a binary value of:

      0001000111

      Note there are 10 digits in the above binary value. This is inclusive of the 0th through 9th bit as described in this article. The last three 1’s are for the A, B, and C energized phases and the 1 in the 6th bit is the loop. The decimal value that would be stored in FeederInfo for this binary value would be 71 (again, check an online calculator).

      So, all of that leads me to why we use “BitAnd(FeederInfo, Power(2, 6)) > 0;”

      This specific Oracle querystring checks to see if the value in the 6th bit is true. This query is especially cool because it will check the 6th bit regardless of the values in the other bits. And that’s exactly why you need to use the BitAnd instead of just querying the field directly for a value. I hope this (wordy) explanation helps you make some sense of this!

      Best of luck exploring the binary world…

  • Renato Salvaleon says:

    Excellent explanation of the bits… Trying to understand ELECTRICTRACEWEIGHT field and find out if I can use it for spatially sequencing edges and junctions and your article helps a lot.

What do you think?

Leave a comment, and share your thoughts

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.