Can't get enabled attribute set with system.tag.editTag

Here’s the one of the lines I’m using:

system.tag.editTag(tagPath=’[]’ + unit + ‘/CompMotorVoltage’, attributes={“Enabled”:“false”})

The unit var is correct, as I use it in a line above to a tag in the same udt above this line. I’m running this in the console and using this line to run it:

shared.Units.toggleCompVFD(‘180-8586’)

I do have the read/write toggled in the designer set and like I said get no errors anywhere. The tag above this line is set, just the attributes on the other tags don’t get set.

Thanks

Have you tried all lower case for “enabled” ?

Same issue. It’s not letting me replay with less than 20 characters so this sentence is filler:).

There’s no tag provider specified? You’re using square brackets to indicate that you have a fully qualified path, but (at least in the snippet posted) there’s no provider actually entered. I wouldn’t be surprised if that didn’t work.

A provider would be like [default]?

1 Like

So how do I set the tag provider, is this the device, the documentation mentions a tag provider but never concretely tells me what a provider is, I’ve been looking through the documentation and it’s only mentioned as if it’s common knowledge. Thanks

I’d recommend starting in the docs here; basically, tag providers are collections of tags that all come from a single source. In probably 90% of Ignition projects, there’s only the one, called default - but if you use remote providers (new in 7.9) or a module such as Cirruslink’s MQTT then you may have additional realtime tag providers. Also, the System and Client meta-folders you see in the tag browser in the designer are technically additional tag providers.

K, so it’s 7.8 and I’ve tried using both default and Default, Enable and enable and True and true, all of them do nothing.

Is there another way to do this, getAttribute works, I use it to find out if a tag is enabled, but there is no setAttribute. Here are the 2 calls to system.tag:

system.tag.write(’[]’ + unit + ‘/InterfaceCompVFD’, True)
system.tag.editTag(tagPath=’[]’ + unit + ‘/CompDCBusVoltage’, attributes=“Enabled”:True})

The first call succeeds the second call does not, as if it just doesn’t work. If there’s another way I’m game. I would just leave the tag there and disable the interface but the tag will literally be polling a none existent device if it’s kept enabled on units that don’t support it. I have 12 of these tags on 5 udt’s and the 12 are split into 2 sets of 6 that can have either enabled so I would need to create quite a few more udt’s to handle it that way for a script function that seems like it should work. I know I can just enable it by hand when applicable but wanted to make sure if I’m unable to someone else can with as little pain as possible. Thx

If you can’t get onto 7.9 (there’s at least one bugfix for editTag coming in 7.9.8, so it’s entirely possible there’s a bug in 7.8) you can try writing directly to the Enabled subproperty as a workaround, eg:
system.tag.write("[provider]path/to/tag.Enabled", False)

That worked, thx everybody.