# Help for custom Driver

**URL:** <https://forum.inductiveautomation.com/t/help-for-custom-driver/4788>\
**Category:** Ignition\
**Created:** [July 9, 2012, 1:51pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788 "2012-07-09T13:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GermainN](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@GermainN](https://forum.inductiveautomation.com/u/GermainN)\
**Post date:** [July 9, 2012, 1:51pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/1 "2012-07-09T13:51:39Z")

</div>

Hi,  
I’m implementing a custom driver that reads a HTML page in a equipement that has an embedded web server.  
This driver just reads the datas in a table in this page, create the opc-ua nodes on connect() with the header line found and updates the nodes at each update() with the values founded in the cells.  
I actually used as the weather driver example an AbstractDriver.  
As I saw in a other post, U say that if we want to make a real driver we have to make a AbstractNioDriver, so I’m going to do so.  
My question is this one : I have to timestamp the datas with the datetime I found in the web page, as I need to history datas with the source timestamp and not the gateway timestamp. Would it be possible with a NioDriver and how ? I didn’t see the waay to do that in the modbus V2 sample.  
Can we access the “LastChange” property of the tag ? Or is there an more “official” way to do this ?

Thanks for your help ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 9, 2012, 2:35pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/2 "2012-07-09T14:35:17Z")

</div>

[quote="GermainN"]Hi,  
As I saw in a other post, U say that if we want to make a real driver we have to make a AbstractNioDriver, so I'm going to do so.  
[/quote]

By "real" driver I mean one that talks to a PLC. For a driver like this extending NodeMapDriver, or even better the new AbstractTagDriver, is perfectly suited.

> [@GermainN](#):
>
> My question is this one : I have to timestamp the datas with the datetime I found in the web page, as I need to history datas with the source timestamp and not the gateway timestamp. Would it be possible with a NioDriver and how ? I didn't see the waay to do that in the modbus V2 sample.

When you create a DataValue object you can set the source timestamp. Use the public DataValue(Variant value, StatusCode statusCode, UtcTime sourceTimestamp, UtcTime serverTimestamp) constructor.

> [@GermainN](#):
>
> Can we access the "LastChange" property of the tag ? Or is there an more "official" way to do this ?

Not from a driver, that's a SQLTag property, not an OPC property.

---

<div class="post-metadata">

**Author:** ![GermainN](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@GermainN](https://forum.inductiveautomation.com/u/GermainN)\
**Post date:** [July 9, 2012, 3:07pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/3 "2012-07-09T15:07:09Z")

</div>

Thanks Kevin.

I love this forum, your answers are so quick and effficient ! 😃

I didn’t mind of that, cause in the weather driver the DataNode .java did instanciate the DataVariableNode with a new UtcTime()… and I didn’t saw it.  
I’m going to try this.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 9, 2012, 3:30pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/4 "2012-07-09T15:30:44Z")

</div>

You might also want to explore implemented a SQLTag provider instead of a driver. There’s an example of that in the SDK as well, I think it’s called SimpleTagProvider.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 9, 2012, 5:42pm UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/5 "2012-07-09T17:42:30Z")

</div>

You may also want to take a look at [this topic](http://inductiveautomation.com/forum/viewtopic.php?f=25&t=7436).

---

<div class="post-metadata">

**Author:** ![GermainN](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@GermainN](https://forum.inductiveautomation.com/u/GermainN)\
**Post date:** [July 10, 2012, 8:23am UTC](https://forum.inductiveautomation.com/t/help-for-custom-driver/4788/6 "2012-07-10T08:23:01Z")

</div>

It won’t be possible for me to use a TagProvider as I need to add a lot of devices with their own parameters (IP address, …). The OPC-UA driver correspond exactly to what I want to do. The equipement is a PLC but with no external protocol, this is why I use the embedded web server to catch the data.

I successfully tried the timestamping with the DataVariableNode, but I still have a problem…

If I change the value of the Node, I get it in the Tag in the Ignition Designer with the good timestamp on the LastChange Property. If I only change the timestamp (as the data value didn’t change in my web page), the tag is not refreshed in the Ignition designer.

If I use history, it archives the data only if the value changes (I use the Value timestamping for history of course).  
When I use a transaction group, as the tag is calculated directly by the group, I always have the good value and timestamp.

Is there’s a way to use the History Provider the same way ?

Thanks again for your help 😊
