How would I create an tag in the kepware server triggered from ignition

How would I create an tag in the kepware server triggered from ignition? Is it possible to do it directly from the event script using something like system.opc.writeValues() or should I download an outside library like kepconfig or something like postman?

I know that you can do things like disabling/enabling devices via their REST Configuration API (see this link: Configuration API | OPC Server | Kepware). I’m not sure whether you can create tags or not. Keep in mind though that many of the drivers in KEPServerEx allow dynamic referencing against a given channel/device–this way you don’t actually need to even create static tags in the KEPServerEx configuration.

If anyone wanted to know I downloaded python 3.6 outside of ignition and used the kepconfig library to create tags.makekeptag.py (1.9 KB)

I used the system.util.execute([‘python’, path_to_python_script.py, channel_arg, device_arg, tag_group_arg, tag_arg]) inside of ignition to trigger the python code. What you put in the system.util.execute function is how you would want it to run in the command line so you can add more varables as needed.

To get the data of the variables used in the code I used the get function of postman using placeholder variables that had the same properties that I wanted. For more information on this the kepware video is helpful.

3 Likes