# Reading CALC signals using openHistorian Python API

**URL:** <http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858>\
**Category:** openHistorian\
**Created:** [March 25, 2021, 6:19am UTC](http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858 "2021-03-25T06:19:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Datta](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/d/50afbb/32.png) [@Datta](http://discussions.gridprotectionalliance.org/u/Datta)\
**Post date:** [March 25, 2021, 6:19am UTC](http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858/1 "2021-03-25T06:19:01Z")

</div>

The openhistorian python API is unable to read CALC signals although it is reading all other signal types. Is there any fix for this? Also is there a way to get the source code for the Power Calculations and how the corresponding PPA point IDs are getting updated in realtime.

---

<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:** [March 25, 2021, 2:12pm UTC](http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858/2 "2021-03-25T14:12:10Z")

</div>

As long as the point ID is correct, the API will be able to read value, equally as any other. Perhaps a metadata query related to “CALC” signal type is not working properly? Can you sahre code on “how” you are looking up point ID?

The PowerCalculations code can be found [here](https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/Adapters/PowerCalculations).

If you specifically want the the code for calculating electric power, e.g., MW, then [here](https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/Adapters/PowerCalculations/PowerMultiCalculator).

Applications hosting power calculations, e.g., openHistorian / openPDC, will simply depend on the database to auto-increment a new point ID from the database, see `Measurement` table `PointID` column, when adding a new record to this table.

The `PointID` value here will match the point ID needed to query openHistorian.

---

<div class="post-metadata">

**Author:** ![Datta](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/d/50afbb/32.png) [@Datta](http://discussions.gridprotectionalliance.org/u/Datta)\
**Post date:** [March 26, 2021, 6:33am UTC](http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858/3 "2021-03-26T06:33:40Z")

</div>

Hi Ritchie,  
Thanks for the reply. One more thing is there a faster way to extract data for last 24 hours using pythonopenhistorian api for a particular signal every 20 milliseconds. As of now the traditional way that it reads data in taking long time to read the data. Is there an option to read the data only using key point IDs rather than checking a pointidlist for that particular signal type

---

<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:** [March 26, 2021, 6:40am UTC](http://discussions.gridprotectionalliance.org/t/reading-calc-signals-using-openhistorian-python-api/858/4 "2021-03-26T06:40:41Z")

</div>

You should only need to query the point ID array for a given signal type once and then use this array over and over.

Generally the array will only ever need to be refreshed if there is a change in configuration.

Otherwise, if you can share code, I will try to provide suggestions.
