Subscription for datachange on internal db sqltag?

what is the right way to catch the datachange on internal db sqltag ?

I try :
public class DataChange implements TagChangeListener{
public void tagChanged(TagChangeEvent e)
{
}

		public TagProp getTagProperty()
		{
		}
	}

TagListener tg = new TagListener();
List listeners = new ArrayList(1);
listeners.add(tg);
context.getTagManager().subscribe(Arrays.asList(TagPathParser.parse(“default”,“test”)), listeners);

or is it possible to use the ProviderSubscriptionModel in hte example tag provider ???
how to indicate to use as provider the defaut tag manager ???

Hey,

(First off, really quick: when posting code, it’s best to wrap it in the “” tags, so you don’t lose formatting)

Yes, that code should be fine… besides the fact that you need to return something from “getTagProperty”, as I’m sure Eclipse is telling you. You can just return null to listen for all events, or return TagProp.Value to just listen to value (and quality) changes.

If I can be honest, I think you should stay away from the TagProvider example. That’s only going to be confusing at this stage, and I think it’s nowhere close to what you want to do.

For the default provider: there is no such thing as the “default” in the gateway. The default is set on a project by project basis, so it is only applicable in the Client scope. In the gateway, you’ll have to always specify the provider you want… which you’re doing in your code, by specifying the provider named “default”, which is created when Ignition is installed.

Regards,

It also looks like you’re not instantiating your DataChange class anywhere.

TagListener tg = new TagListener();

should probably be

DataChange tg = new DataChange();