Write not Hardware configured dp from Driver

Discussion about recent product features & solutions!
4 posts • Page 1 of 1
CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Write not Hardware configured dp from Driver

Post by CyaNn »

Hello,

I have juste a little question.

I am still developping my driver.
I want to write the driver status in a database.

How to write datapoint to database directly from address (without calling Resources::getId2Connect) ?

Thank you in advance for your answer.
Best regards
Yann

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Write not Hardware configured dp from Driver

Post by CyaNn »

Well, I have found nothing in the Driver document I have to do what I want.

The idea seems simple : writing the status of the driver in an internal datapoint.
I am able to get the dpId of the point to write, but HWService::writeData only accept an HWObject.

I just want to be able to write a value in the database without any transformation.... just by simple query. What is the method to use for ?

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: Write not Hardware configured dp from Driver

Post by Gertjan van Schijndel »

For writing 'fixed' datapoints you should define the functions 'getNumberOfDpNames' and 'getDpName4Query' in your driver resources class to get your dpId's.
To get the dpId's dynamically you can use a 'NameServerSysMsg' message.

The retrieved dpId can then be used to do the usual Manager::dpSet.

CyaNn
Posts:97
Joined: Tue Nov 23, 2010 9:48 am

Re: Write not Hardware configured dp from Driver

Post by CyaNn »

Thanks a lot Gertjan, it works greate.
I don't knew it was possible to use manager into a driver.

Thanks.
Best regards.
Yann

4 posts • Page 1 of 1