# 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:** 1\
**Showing post:** 2

<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,…

---

_[View the full topic](https://forum.inductiveautomation.com/t/create-pen-datasource-programmatically/65814)._
