Hey guys,
After looking at hardware interface and software device code for 5 hours today, I'm sorry to tell you that I don't think this is going to happen. Not anything time soon anyway
For those of you who have read through (and grasped the concept of the C SDKs): the whole deal with sending InterfaceArgumentPacks to "interfaces" and the arguments involved works well in C, but just isn't very portable to the COM way of doing things. VB gets very upset when it comes to arrays of structures, and even more so when those structures may contain pointers. Wrapping the interface arguments in a COM object (a la IEnumVARIANT) is not undoable, but would require much more time than the separation between Interface and Device is worth IMHO. And I haven't even looked at the IRCode part...
If anyone wants to take a stab at it and use my code as a base or example, by all means, let me know and I'll send you what I have. I may even explain my convoluted thought process when I wrote it
Peter
Create Hardware Interface Plugin in VB?
Initially I would like to use it with http://home.tiscali.no/henriksen/1-wire/
so just being able to read DDE values would be enough. We could always add writing and doing NetDDE in a future version.
I was thinking the user would need to specify the application name and topic. For WServer application name will be "WServer" and topic is "Weather". Then the user would be able to create a list of "items" to be read such as temperature, wind speed, etc. They would probably also want to specify how often to update the values. You can see an example of how Excel can get values from WServer here http://home.tiscali.no/henriksen/1-wire/sw/dde.zip.
so just being able to read DDE values would be enough. We could always add writing and doing NetDDE in a future version.
I was thinking the user would need to specify the application name and topic. For WServer application name will be "WServer" and topic is "Weather". Then the user would be able to create a list of "items" to be read such as temperature, wind speed, etc. They would probably also want to specify how often to update the values. You can see an example of how Excel can get values from WServer here http://home.tiscali.no/henriksen/1-wire/sw/dde.zip.
DDEDevices.dll, initial version
Per your request, I have made a plugin for HouseBot that allows you to define DDE devices.
http://users.planetcable.net/pzand/ddedevices.zip
The concept is similar to HouseBot's own IRDevices; you make an XML file (example in the zip) that describes the device you want to make, and add an instance of that device to HouseBot as a normal software device.
The overall structure of the XML is as follows:
<Devices ... >
<Device ... >
<Property ... />
<Property ... />
...
</Device>
...
</Devices>
Available attributes for the Device node:
- NAME: the name as it appears in HouseBot's "Add Device" dialog
- DDEService: the application name used in the DDE conversation
- DDETopic: the topic name used in the DDE conversation
- DDEConnectInterval: interval, in ms, between connection attempts. The plugin will automatically attemp to reconnect when the DDE server disappears.
Available attributes for the Property node:
- NAME: Name of the property
- Description: Description of the property
- InitialValue: Initial value of the property
- Default: set to "Yes" to indicate that this property is the default property. Note: Only ONE default property per device is allowed! Values: Yes|No
- Persistent: set to "Yes" to indicate that the value of this property should be stored in HouseBot's database. Normally, you'd set this to "No". Values: Yes|No
- SameValueChanges: Leave at "No"
- TraceToLog: Set to "Yes" to indicate that changes to this property's value should be logged in HouseBot's device log.
- DDEItem: The item name used in the DDE conversation.
The example in the zip tries to connect to Excel and display whatever is in Row1:Column1 and Row1:Column2. I hope that gives you enough to go on...
Finally: I have no idea what the dependencies of this code are yet, or if it'll even work right on other machines than my own. It's very beta and as such may cause things to happen that you never believed were possible. Use at your own risk!
Enjoy!!
Peter
http://users.planetcable.net/pzand/ddedevices.zip
The concept is similar to HouseBot's own IRDevices; you make an XML file (example in the zip) that describes the device you want to make, and add an instance of that device to HouseBot as a normal software device.
The overall structure of the XML is as follows:
<Devices ... >
<Device ... >
<Property ... />
<Property ... />
...
</Device>
...
</Devices>
Available attributes for the Device node:
- NAME: the name as it appears in HouseBot's "Add Device" dialog
- DDEService: the application name used in the DDE conversation
- DDETopic: the topic name used in the DDE conversation
- DDEConnectInterval: interval, in ms, between connection attempts. The plugin will automatically attemp to reconnect when the DDE server disappears.
Available attributes for the Property node:
- NAME: Name of the property
- Description: Description of the property
- InitialValue: Initial value of the property
- Default: set to "Yes" to indicate that this property is the default property. Note: Only ONE default property per device is allowed! Values: Yes|No
- Persistent: set to "Yes" to indicate that the value of this property should be stored in HouseBot's database. Normally, you'd set this to "No". Values: Yes|No
- SameValueChanges: Leave at "No"
- TraceToLog: Set to "Yes" to indicate that changes to this property's value should be logged in HouseBot's device log.
- DDEItem: The item name used in the DDE conversation.
The example in the zip tries to connect to Excel and display whatever is in Row1:Column1 and Row1:Column2. I hope that gives you enough to go on...
Finally: I have no idea what the dependencies of this code are yet, or if it'll even work right on other machines than my own. It's very beta and as such may cause things to happen that you never believed were possible. Use at your own risk!
Enjoy!!
Peter
-
- Member
- Posts: 30
- Joined: Sat Jun 28, 2003 1:58 pm
Re: DDEDevices.dll, initial version
pzand wrote:Per your request, I have made a plugin for HouseBot that allows you to define DDE devices.
http://users.planetcable.net/pzand/ddedevices.zip
SNIP..
This link is dead.. Anyone have an alternate link or a copy of the zip?
-
- Member
- Posts: 30
- Joined: Sat Jun 28, 2003 1:58 pm
Re: DDEDevices.dll, initial version
MediaStorm wrote:This link is dead.. Anyone have an alternate link or a copy of the zip?pzand wrote:Per your request, I have made a plugin for HouseBot that allows you to define DDE devices.
http://users.planetcable.net/pzand/ddedevices.zip
SNIP..
Nevermind... I found a copy I downloaded a while back.
Thx.