# Create Pen DataSource programmatically

**URL:** <https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 28, 2022, 2:37pm UTC](https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814 "2022-10-28T14:37:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ISEMAREN\_AAG](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ISEMAREN\_AAG](https://forum.inductiveautomation.com/u/ISEMAREN_AAG)\
**Post date:** [October 28, 2022, 2:37pm UTC](https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814/1 "2022-10-28T14:37:50Z")

</div>

In our company we have an **Ignition Edge** connected to an **Igntion Central** via **GetwayNetwork**.  
Ignition Edge tags are **historicized** to an Ignition Central history provider.

For a power chart, I need to programmatically create the pens datasource from the tag path.

For example:

- Tag path: [remtagElBonillo]UP1/Inverters/Inv1/RT/Current/AC

- Expected Pen Datasource:  
"histprov:elbonillo:/drv:ignition-elbonillo:tagedge:/tag:up1/inverters/inv1/rt/current/ac"

If I try to get the necessary values ​​with readBlocking, I get the parameters that correspond to the remote tag, for example _ **History Provider = "histEdge"** _, but I need _ **History Provider = "elbonillo"** _.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4dca7b42a33e82fb559629b8d9331157b13b78ff.png)

So the solution would be to access the **parameters of the Real Time Provider** (Edge Remote) programmatically. Is it possible to read these parameters somehow?:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/f/df1925e68ae100ea6903cafaa26eb8e02643e821.png)

Best Regards.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 28, 2022, 2:59pm UTC](https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814/2 "2022-10-28T14:59:51Z")

</div>

If you use the script provided in this thread, what does it return?

> [@Get the Historical Tag Path from the Tag Path](https://forum.inductiveautomation.com/t/get-the-historical-tag-path-from-the-tag-path/61981/6):
>
> So, the driver is actually part of the full tag path. It is possible if you are using remote tag providers to use a gateway message handler in conjunction with this function to get what you’re looking for. If you put this function in a shared script on the same gateway as the tag provider, then it should return your historical tag path. Inspired heavily from the script provided by @PGriffith def getHistoricalTagPath(path): from com.inductiveautomation.ignition.common import QualifiedPath,…

---

<div class="post-metadata">

**Author:** ![ISEMAREN\_AAG](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ISEMAREN\_AAG](https://forum.inductiveautomation.com/u/ISEMAREN_AAG)\
**Post date:** [October 28, 2022, 4:14pm UTC](https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814/3 "2022-10-28T16:14:59Z")

</div>

Thanks, but with that function I get the same result as with the script I indicated above.  
The PowerChart and the script are in the Ignition Central, not the Ignition Edge.  
Any other ideas please?

Is it not possible to access the information that appears on this web page via script? This is the information I need:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96de74a59662d30d8d05a187d544d1c86aa40dfe.png)

Best Regards.
