[bug-16241]Ignition 8 - system.tag.importTags to create vision client tags?

Can we use this function system.tag.importTags to create vision client tags ?

collisionPolicy = "a"
filePath = "d:/test.xml"
basePath = "[client]"
system.tag.importTags(filePath, basePath, collisionPolicy)

return java.lang.NullPointerException (Ignition 8.0.10)

Is there any way to create a cision client tag by scripting in Ignition 8 ?

system.tag.configure only support gateway tags but not vision clients tag ?

The 7.9 function system.tag.loadFromFile should still work in 8.0; it’s just deprecated and thus removed from the 8.0 manual. Client tags still use the legacy tag code, so I wouldn’t expect the new functions to work with them.

system.tag.loadFromFile seems not supporting client tag ?
with provider = client, no client tags are created ???

Can you send me your client tag XML? I can breakpoint the function and see where it’s going wrong.

A simple file exported from v8.0.10

<Tags>
   <Tag name="essai" path="" type="Client">
      <Property name="Value">false</Property>
      <Property name="DataType">6</Property>
      <Property name="PollRate" mode="2">0</Property>
   </Tag>
</Tags>

Well, it’s not working because it’s not implemented. Whoops. I’ll file a ticket.

1 Like

It will be usefull to implement the exportTags function for vision client tag !
We especially need it to automate by scripting, client tags exports to xml file or json in order to commit this file in git with the project.

@PGriffith

in 8.0.10, do you think it’s possible to use in client scope (in a module) the following 7.9 flavour class in order to export client tags of a project to xml file ?

com.inductiveautomation.ignition.common.sqltags.importexport.ClientTagExporter::
exportTags​(java.util.List nodes, java.io.Writer writer, ProgressListener progress, TagPath base)

http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.10/com/inductiveautomation/ignition/common/sqltags/importexport/ClientTagExporter.html

If yes, what are the parameter to export all the tag of [client] ?
is nodes mandatory ?

Yes, it is possible; it’s the same class that’s used internally. For nodes, just make a base TagPath of [client], then get the ClientTagProvider and call getTag; something like:

                ClientTagProvider clientProvider = context.getTagManager().getClientTagProvider("client");
                if (clientProvider instanceof SubManagerAdapter) {
                    ClientSubManager client = ((SubManagerAdapter) clientProvider).getTarget();
                    BasicTagPath path = new BasicTagPath("client");
                    List<Tag> clientTag = List.of(clientProvider.getTag(path))
                    new ClientTagExporter().exportTags(clientTags, fw, null, null);
1 Like