Good way of Editing Tags?

Say I have a UDT that is 32 Booleans to make a dint. I want to add a message to each Boolean with some copy paste action. What are people using? I currently use a mix of Notepad++ and Excel for almost everything. I have been using Notepad++ to make editing the xml files easier but it's still pretty clunky.

When you say "a message", what exactly do you mean?

I am looking at setting up alarms using a UDT with dynamic parameters I got off the exchange. The Alarm property of the tag has a "Display Path" that is bound to the parameter {Message00} for dint 0 and the {Message01} for dint 01 and so on. I would rather not have to open every single one to add the message.
I am planning on making a journal to log events for an EPA record on one machine. I also have another UDT dint that has an added string parameter for each of the Booleans that I want to add a fault message for that fault.

Import xml into Excel.

I use Excel in combo with a python script to create bulk tags like this, where I can create udts and write to their parameters.
I use excel only to create the table, then copy the table and let python read the clipboard and create or write to the tags. Writing to tags is far easier than creating them, and since you've already got yours created, you can just write to them. To set udt paramaters, you can write to 'path/to/udtinstance/Parameters/Message00'

Eg
system.tag.writeBlocking('path/to/udtinstance/Parameters/Message00', 'hello')

The function I use to read the clipboard I posted here

@nminchin is using the clipboard faster/better than uploading excel and reading cells that way?

I don't know about faster in terms of code execution time (but I would assume clipboard is faster - also faster to write the code!), but I'm lazy when it comes to selecting files. I would much rather have the file open, copy stuff from it, and then run the script on the clipboard rather than have to worry about finding the file in a file dialogue box. It wasn't so bad when I could use Listary (file indexer) which has a hook into file open dialogues and lets you easily search for and select files. But our IT said no to productivity tools indexing software :frowning:

But still, it's far more flexible as well if you're just copying tables rather than relying on the Excel being in the exact format you need, with the table exactly "starting in cell C23" and inside a sheet called "hello puppy"

2 Likes