Missing scripting functions

#1

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.

0 Likes

Prevent a user from edit a project
#2

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.

0 Likes

#3

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

0 Likes

#4

See system.tag.configure.

1 Like

#5

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

#6

I second this! wordswordswords

0 Likes

#7

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 @joshdandy are right. We need wordswordswords

2 Likes

#8

Thanks @witman for the link!

2 Likes

#9

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

0 Likes

#10

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)
0 Likes