# Creating Tags with History from a gateway module

**URL:** <https://forum.inductiveautomation.com/t/creating-tags-with-history-from-a-gateway-module/11265>\
**Category:** 3rd Party Modules\
**Created:** [February 24, 2016, 2:25pm UTC](https://forum.inductiveautomation.com/t/creating-tags-with-history-from-a-gateway-module/11265 "2016-02-24T14:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@benoit](https://forum.inductiveautomation.com/u/benoit)\
**Post date:** [February 24, 2016, 2:25pm UTC](https://forum.inductiveautomation.com/t/creating-tags-with-history-from-a-gateway-module/11265/1 "2016-02-24T14:25:46Z")

</div>

Hi !

I’m able to build Tags from a gateway module, but I must have missed something I do understand how to give them some properties.

In my GatewayHook class I have  
a SimpleTagProvider tagProvider member.

In my GatewayHook::setup method  
I do :

`tagProvider = new SimpleTagProvider("TheProvider");
try{
        tagProvider.startup(context);
}
catch(Exception e)
{...}
`  
And I have the getter method for the tag provider.

In my drivers  
I have

`private SimpleTagProvider tagProvider;
private ExtendedTagType tagType;`  
I do :  
In the connect method :

`GatewayHook ecoSpecHook = (GatewayHook)(getDriverContext().getGatewayContext().getModuleManager().getModule("com.example.MyModule").getHook());
        if (null!=ecoSpecHook)
            tagProvider = ecoSpecHook.getTagProvider();
        tagType = TagType.Custom;
        Set<TagProp> tagProperties = TagProp.setOf(TagProp.AccessRights,TagProp.HistoryEnabled,TagProp.HistoryTimestampSource);
        if (null!=tagProvider)
            tagProvider.configureTagType(tagType, TagEditingFlags.STANDARD_VALUE,tagProperties);`

Then When I have to create a Tag (booelan in this case I do :

```auto
 tagProvider.configureTag(tagPath, com.inductiveautomation.ignition.common.sqltags.model.types.DataType.Boolean, tagType);
```

and to set a value I do :

```auto
tagProvider.updateValue(tagPath, value, DataQuality.GOOD_DATA);
```

As I have set the TagProp.HistoryEnabled I suppose the History should have been activated, but it is not the case.  
Some of the properties in TagProp should a value set, How do I set the properties values ?

---

<div class="post-metadata">

**Author:** ![benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@benoit](https://forum.inductiveautomation.com/u/benoit)\
**Post date:** [March 1, 2016, 3:16pm UTC](https://forum.inductiveautomation.com/t/creating-tags-with-history-from-a-gateway-module/11265/2 "2016-03-01T15:16:01Z")

</div>

Since I have done What I presented above, my driver is instable, and when I uninstall it Ignition seems dead locked. I’m not even able to kill it. The only solution is to reboot my computer.  
Does anybody know what is missing or wrong ?
