Retrieve default tag provider

Is there a way to use the Ignition's project default tag provider in my module? Not a provider with the name "default", but the provider that is selected as default under Project Properties.

From what scope (Gateway or Client/Designer) do you need to figure this out?

Gateway scope

Ok, with a reference to GatewayContext, try something like:

String defaultProvider = context.getProjectManager()
  .getProjectProps(projectName)
  .getDefaultSQLTagsProviderName();

Wouldn't I have to hardcode the projectName this way?

You have to provide one somehow. The default tag provider is defined within the context of a project.

:cry:

What are you trying to do, exactly?

Is this related to your other post about a tag reading scripting function?

I think I actually have it figured out, at least in my head. But yes, it's related to that other post. So from the client scope I'm sending a remote procedure call (rpc) to the gateway to give me the values of some tags. In that call, I simply have to include the default tagProvider name of the client and that should solve my problem.

The code in the client scope would look something like this:

String tagProvider = context.getDefaultTagProviderName();
List<QualifiedValue> values = rpc.readGatewayTags(tags,tagProvider)

context in this case would be the ClientContext.

How do I get access to the Vision Client Tags tag browser?
I tried:

ClientTagManager tagManager = ClientHook.context.getTagManager();
ClientTagProvider provider = tagManager.getDefaultProvider();

But that returns the provider I have set as my default under project properties.

The Vision client tag provider:

  1. Only exists in the Vision client scope, by definition.
  2. Doesn't implement modern access methods or the "new" tag interfaces for 8.0+.
  3. Is always hardcoded to a provider ID of client.

Using client as the provider name works. Thanks