# POWERCAL and BULK\_SEQUENCE adapters: Filtering PMUs based on framerate

**URL:** <http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422>\
**Category:** openHistorian\
**Created:** [June 20, 2025, 9:19am UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422 "2025-06-20T09:19:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Korunekosama](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/korunekosama/32/708_2.png) [@Korunekosama](http://discussions.gridprotectionalliance.org/u/Korunekosama)\
**Post date:** [June 20, 2025, 9:19am UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/1 "2025-06-20T09:19:34Z")

</div>

Hello !

With the addition of 100 fps PMUs in my pool, I’m trying to configure `POWERCALC` and `BULK_SEQUENCE` adapters in openHistorian. Up to now, I’ve been using them with their default settings and a framerate of 50 fps, successfully (“_FramesPerSecond=50; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None_” and “_ForceCalcSignalType=True; FramesPerSecond=50; UseBadQualityData=True; LagTime=20_”). With the addition of 100 fps PMUs alongside the existing 50 fps ones, I’d like to have two separate adapters for each type: one `POWERCALC` at 50 fps and one at 100 fps; same for `BULK_SEQUENCE`.

I’m attempting to filter which PMUs should be considered by each adapter using the `InputMeasurementKeys` parameter, where I’m trying to apply dynamic filtering (rather than manually specifying each measurement ID one by one), but without success.

As an example, here’s what I tried for `BULK_SEQUENCE`, aiming to include only 50 fps PMUs (so that ‘PMU-100’ is excluded):

```auto
InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType IN ('VPHA', 'IPHA', 'VPHM', 'IPHM') AND Phase = 'A' AND PointTag NOT LIKE '%PMU_100%'}

```

Unfortunately, the adapter fails to initialize properly, and I get the following warning:

```auto
[PHASOR!BULK_SEQUENCE] WARNING: 14 of the source 'A', 'B', 'C' phase sets were incomplete and were excluded as input.
[PHASOR!BULK_SEQUENCE] WARNING: No valid inputs were defined. Cannot initialize adapter.

```

Could you please provide, or help me determine, the correct filtering parameter I should use so that I can configure `POWERCALC` and `BULK_SEQUENCE` to process only 50 fps PMUs?  
I’ll then apply the corresponding filter logic for the adapters dedicated to 100 fps PMUs.

Thanks for any help that you could provide,

Best Regards,

Stephane

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 20, 2025, 12:59pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/2 "2025-06-20T12:59:34Z")

</div>

Perhaps something like this:

```auto
InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag NOT LIKE '%PMU_100%'}

```

---

<div class="post-metadata">

**Author:** ![Korunekosama](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/korunekosama/32/708_2.png) [@Korunekosama](http://discussions.gridprotectionalliance.org/u/Korunekosama)\
**Post date:** [June 20, 2025, 1:35pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/3 "2025-06-20T13:35:30Z")

</div>

Hello Ritchie,

Unfortunately, it results in multiple messages in the console :  
[PHASOR!BULK\_SEQUENCE\_50] WARNING: Unexpected phase type ‘+’ in input “PPA:31983” [fd092a13-e95e-11ef-9d90-60f18ac70df7] for BulkSequenceCalculator. Expected one of ‘A’, ‘B’, or ‘C’, input excluded.

```auto
[PHASOR!BULK_SEQUENCE_50] WARNING: Unexpected phase type '+' in input "PPA:31984" [fd09c34d-e95e-11ef-9d90-60f18ac70df7] for BulkSequenceCalculator. Expected one of 'A', 'B', or 'C', input excluded.
[PHASOR!BULK_SEQUENCE_50] Starting measurement route calculation...
Starting measurement route calculation...
[PHASOR!BULK_SEQUENCE_50] Calculated 168 routes for 28 destinations in 0 seconds.
[PHASOR!BULK_SEQUENCE_50] Starting measurement route calculation...
[PHASOR!BULK_SEQUENCE_50] Calculated 168 routes for 28 destinations in less than 1 millisecond.

```

But no values are shown anymore in Grafana after the adapter is initialized with this filter.

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 20, 2025, 1:59pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/4 "2025-06-20T13:59:37Z")

</div>

Oh, bulk sequence adapter - yes, sorry, something like this:

```auto
InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND Phase IN ('A', 'B', 'C') AND PointTag NOT LIKE '%PMU_100%' ORDER BY PhasorID}

```

---

<div class="post-metadata">

**Author:** ![Korunekosama](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/korunekosama/32/708_2.png) [@Korunekosama](http://discussions.gridprotectionalliance.org/u/Korunekosama)\
**Post date:** [June 20, 2025, 3:11pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/5 "2025-06-20T15:11:12Z")

</div>

OK, it’s working well, and I was also able to configure the `Bulk_sequence` adapter for the 100 fps PMU.  
I ran into an issue with duplicate entries for all the `Bulk_sequence`-related measurements, so I had to delete them directly from the database to start from scratch — but now it’s working.

Can I use the same filter for `POWERCALC` (which uses the `PowerMultiCalculatorAdapter`) to apply the same 50/100 fps separation strategy?  
I mean :  
`FramesPerSecond=50; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None; InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag NOT LIKE '%PMU_100%' ORDER BY PhasorID}`  
and  
`FramesPerSecond=100; LagTime=20.0; LeadTime=3.0; AdjustmentStrategy=None; InputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType LIKE '%PH%' AND PointTag LIKE '%PMU_100%' ORDER BY PhasorID}`

The new measurements for PMU\_100 related to P/Q/S are not automatically created …  
Edit : I just remember I have to create them manually using the dedicated GUI 😕

---

<div class="post-metadata">

**Author:** ![Korunekosama](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/korunekosama/32/708_2.png) [@Korunekosama](http://discussions.gridprotectionalliance.org/u/Korunekosama)\
**Post date:** [June 20, 2025, 3:47pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/6 "2025-06-20T15:47:35Z")

</div>

It seems to be working, although I did get some error messages in the console when initializing the adapter:

```auto
IdentifierElement: Could not find a field/property/variable with the name 'P'
IdentifierElement: Could not find a field/property/variable with the name 'b'

```

However, I get the impression that the filtering isn’t being applied properly:  
If I disable the `POWERCALC_50` adapter and keep only `POWERCALC_100` enabled, power calculations are still performed for both `PMU_50` and `PMU_100`.  
Similarly, if I enable `POWERCALC_50` and disable `POWERCALC_100`, all power values (for both PMU\_50 and PMU\_100) are still being calculated.  
I have to disable **both** adapters for the calculations to stop entirely.

I believe I now have an answer to my question regarding power calculations:  
By setting the framerate to 100 fps, the adapter correctly calculates power values for each available data point — meaning I get 100 calculated values per second for each `PMU_100`, and 50 calculated values per second for each `PMU_50`.  
My initial concern — that I would get 100 calculated values per second even for the `PMU_50` devices (which would increase storage usage without improving data accuracy) — doesn’t appear to be valid.

So, does that mean I can simply keep a single `POWERCALC` adapter configured at 100 fps?

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 20, 2025, 8:09pm UTC](http://discussions.gridprotectionalliance.org/t/powercal-and-bulk-sequence-adapters-filtering-pmus-based-on-framerate/1422/7 "2025-06-20T20:09:31Z")

</div>

Since the power calculations adapter is configured from a database table, I would suggest creating two “views” in the database, both from the same source table `PowerCalculation`, perhaps like `PowerCalculation50` and `PowerCalculation100` where each view filters the power calculation definitions for the target set of PMU’s, 50 or 100.

Then for the power calculator adapter for the 50Hz PMUs, add to the connection string `; TableName=PowerCalculation50` and for the power calculator adapter for the 100Hz PMUs, add to the connection string `; TableName=PowerCalculation100`

I think something like this would “separate” the calculations, and allow the frame rate of the power calculator adapter for the 100Hz PMUs to be set to 100.

If you are using SQL Server, it may be possible to set the `TableName` parameter to a full query instead of the ~~table~~ view name:

```auto
; TableName=(SELECT * FROM PowerCalculation WHERE CircuitDescription LIKE '%PMU_50%')

```

And thus, avoid creating custom views in the database… Your mileage with other databases with such an operation may vary.

FYI - this all hinges on the `CircuitDescription` including needed PMU identification information, but I expect it should.
