Missing scripting functions

I created a Vision window where Engineers can enter a Device Name, IP address and select a driver from a drop-down.
When they click the 'Create Device' button I use:

system.device.addDevice

and

system.tag.addTag

To create the devices and tags.
I have complete security control over which users can access the Device Configuration window and none of them need access to the Gateway or the Designer.
I even test the IP to verify it's valid and then ping it before attempting to create the device and tags.

I am however concerned because those commands (system.device and system.tag.addTag) are not present in Ignition 8 Beta.
Have they been moved to a place I haven't found yet?
Have they been completely removed (not even deprecated)?
Version 8 is not an option for me without them.

addTag exists and is callable but is deprecated and hidden. It has a non-deprecated replacement.

The system.device functions are missing because they haven’t been ported yet. Should happen before RC.

What is the non-deprecated replacement for the addTag function?

See system.tag.configure.

1 Like

I look forward to the documentation update that includes a code snippet. I’d like to see examples of how to create a list of tag definitions.

1 Like

I second this! wordswordswords

I played with system.tag.configure a little and am pleased with what I've seen so far.
Here are Code Snippits using the script console:
To create a new Integer tag with Null value:

tagPath = '[default]'
tagAttributes = {}
tagAttributes['name'] = 'Test'
retVal = system.tag.configure( tagPath, tagAttributes )
print retVal

[Good]

Code Snippit to change the tag from Integer to String, set the value, add tooltip and documentation. Note that the 'o' to override was necessary.

tagPath = '[default]'
tagAttributes = {}
tagAttributes['name'] = 'Test'
tagAttributes['tooltip'] = 'Test Tag'
tagAttributes['documentation'] = 'This is a test tag.'
tagAttributes['dataType'] = 'String'
tagAttributes['value'] = 'Hello'
retVal = system.tag.configure( tagPath, tagAttributes, 'o' )
print retVal

[Good]

I got lucky guessing the capitalization.
@larryjones and @joshdunstan are right. We need wordswordswords

2 Likes

Thanks @witman for the link!

2 Likes

Thanks! By the way… wordswordswords was to bring the post character count up to I could post it. I wasn’t just being rude!

Here’s an example I got from support, also:

config = system.tag.getConfiguration("[default]Testing/24/nested",0)
config[0]['parameters']['top'] = '123'
system.tag.configure("[default]Testing/24/nested",config)

system.tag.addTag does not appear to work with historical tags in 8.0.7. A standard memory tag works as before. I’ll migrate to system.tag.configure.