# Ignition Module / Dataset

**URL:** <https://forum.inductiveautomation.com/t/ignition-module-dataset/3264>\
**Category:** Module Development\
**Created:** [September 7, 2011, 7:56pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264 "2011-09-07T19:56:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdalwalla](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pdalwalla](https://forum.inductiveautomation.com/u/pdalwalla)\
**Post date:** [September 7, 2011, 7:56pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/1 "2011-09-07T19:56:38Z")

</div>

We are trying to develop ignition module that will include only datasets. These datasets can then be assigned to any component such as a table and should be able to refresh automatically as the data changes.

Do you have any example or can you point us to converting business logic queries (datasets) to modules and can be auto refreshed based on the component’s (table, or chart) refresh properties that the dataset is attached to.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 9, 2011, 5:50pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/2 "2011-09-09T17:50:27Z")

</div>

I think your best bet will be to hook into the extensible binding system.

These are the bindings that comes up under Other \> Functions on the binding window. They usually (always) return Datasets, just like you wanted.

Check out the BindingType and the VisionClientInterface classes in the vision API.

---

<div class="post-metadata">

**Author:** ![pdalwalla](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pdalwalla](https://forum.inductiveautomation.com/u/pdalwalla)\
**Post date:** [September 12, 2011, 7:31pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/3 "2011-09-12T19:31:04Z")

</div>

We are trying to develop additional functions selectable as part of the “other” for components such as tables and charts which use datasets.

do you have any code example for how to bind. We looked at the VisionClient API as you suggested and did find the Binding Type as well as binding parameters etc.

Our problem is as follows (not actual code, just a conceptual representation of our problem):

function getmachinedata (var\_machineid)  
{Select \* from table where machineid=var\_machineid  
return dataset}  
end;

Machine id will be assigned to selected item value of dropdown which will show all our machines.

It will be nice if you have any example that can demonstrate this. This is a very simple case, we can build complex datasets using this example.

I am assuming we have to use BindingType as our function name; where do we link the parameters of the function.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 12, 2011, 9:46pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/4 "2011-09-12T21:46:27Z")

</div>

I don’t think we have any example code for using the extensible binding system, let me see if I can help you along a bit.

First of all, you should implement this in part of your module that gets packaged up for scope “CD”(Client + Designer) scope.

The root of it all will be your implementation of [tt]BindingType[/tt]. This class will both describe your binding function to the designer so that it can be configured, and will execute the binding when needed in the client.

The Javadocs on that class are fairly complete, so I won’t go over each function in detail.

There are the three functions that provide resource keys that will be used to identify describe the function. The title and category must be keys that exist in a .properties file that you’ve loaded during your module’s startup function. (see [tt]BundleUtil[/tt])

The [tt]getParameters()[/tt] function is the key to setting up the parameters for binding. This function returns a list of [tt]BindingParameter[/tt] instances, which describe each parameter your function expects to receive upon execute. There are a number of functions on this interface that help describe the parameter, its type, and ways to select values (freeform value, choice list, tree browser, etc).

And of course the most important part of a [tt]BindingType[/tt] is the [tt]execute[/tt] function, which is what actually needs to calculate the Dataset that you’d like to return.

Hopefully this gets you guys started.

---

<div class="post-metadata">

**Author:** ![pdalwalla](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pdalwalla](https://forum.inductiveautomation.com/u/pdalwalla)\
**Post date:** [September 16, 2011, 9:26pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/5 "2011-09-16T21:26:17Z")

</div>

We tried but are not getting anywhere and still confused; is it possible to request an example function that will have one parameter; call a database; return a dataset using this extensible system.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 21, 2011, 6:14pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/6 "2011-09-21T18:14:22Z")

</div>

What part is giving you trouble?

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 26, 2011, 4:09pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/7 "2011-09-26T16:09:50Z")

</div>

Dear Carl,

Please find the enclosed attachment for our client project code (3 Java, 1 properties file) and module.xml file where we are defining the scope.

Let us know if you need any other information.  
[Playground\_Client (2).zip](https://us1.discourse-cdn.com/inductiveautomation/original/1X/f2b03c2227527c71c93368b259ed0c72aae50041.zip) (9.72 KB)

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 26, 2011, 4:15pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/8 "2011-09-26T16:15:09Z")

</div>

The module is getting built successfully. However, we are not able to see the Function in Ignition Designer Binding Functions List.

We had a look at System Console. We had messages like Module Started etc. However, No error messages.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 29, 2011, 5:00pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/9 "2011-09-29T17:00:53Z")

</div>

Your module.xml file specifies three hook classes: one each for designer, client and gateway, but the desginer and gateway hook classes don’t actually exist in what you sent me.

You need a Designer hook (it will look very similar to your client hook) that adds the MachineNameBinding in the Designer as well as the client.

Also, you don’t need a gateway hook at all for the extensible binding system.

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 30, 2011, 8:12am UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/10 "2011-09-30T08:12:08Z")

</div>

Thank you Carl. We made required modifications and able to see the Function in Designer. As per our understanding, We need to make the Functions or Libraries to be Designer, Client scope. Since, the functions binded components are showing error in Client Browser.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 30, 2011, 5:00pm UTC](https://forum.inductiveautomation.com/t/ignition-module-dataset/3264/11 "2011-09-30T17:00:39Z")

</div>

You need to compile two separate jars, one for client scope, and one for designer scope.

The BindingType implementation and client hook goes in the client scope jar.

The designer hook goes in the designer scope jar.
