Writing to plc tag using a udt and custom property

Hello,

I have perspective project where I am writing to a plc tag which writes to a laser marker block. I recently have switched my tags to udts to help with scalability.

However, when I use a custom property to write a machineID based on device IP it doesn’t seem to write. I believe my issue is that I need to output the tagpath as a string?? See image below.

Thanks for any help!

Hi Steve,

You've double nested your list of tag paths. Instead of a list of (one) strings, you have a list of a list of one string.

In the future, don't post screenshots of code, except perhaps to show editor context. Instead, use a code block:

3 Likes

And if you do, make sure compression is low for jpgs, or just use a compressionless format like PNG (far superior to jpg for screenshots)

5 Likes

Thanks for the help, this solved my issue! Here's the updated code below in the correct format (I think) :slight_smile:

tagPath = "[default]Keyence Laser Marker MD-X2000/" + self.session.custom.IP_MachineID + "/Trigger"

system.tag.writeBlocking([tagPath],[1])
3 Likes