Writing Tags From 1 PLC to Another

I’ve come up with this script to write 1 OPC tag to another OPC tag using system.tag.writeAll() function. I run this script as a Gateway event script on a tag change. when I execute it my gateway script says it was successful but I don’t get the values written to the tags.

tags = ["Write_Test/Test_Read_Tags_0_", "Write_Test/Test_Read_Tags_1_", "Write_Test/Test_Read_Tags_2_", "Write_Test/Test_Read_Tags_3_", "Write_Test/Test_Read_Tags_4_"] v1 = "Read_Test/Read_Tags_0_" v2 = "Read_Test/Read_Tags_1_" v3 = "Read_Test/Read_Tags_2_" v4 = "Read_Test/Read_Tags_3_" v5 = "Read_Test/Read_Tags_4_" Values = [ v1, v2, v3, v4, v5] values = system.tag.writeAll(tags,Values)

I have also tried the system.tag.write() function with the same result in the gateway script saying successful.

value = "Write_Test/Test_Read_Tags_0_" system.tag.write("Read_Test/Read_tag1" ,value)

am I doing something wrong?

Are you trying to write literal strings to the tags, or the values of other tags?
In your second example, you’re literally writing the string “Write_Test/Test_Read_Tags_0_” to Read_tag1.
If you want to read a tag value in order to write it to another tag, you would need to do something like this:

value = system.tag.read("Write_Test/Test_Read_Tags_0_").value system.tag.write("Read_Test/Read_tag1" ,value)

Thanks PGriffith,

yes I am writing Dint values from a piece of equipment designed to communicate only with a PC to my PLC, back and forth. your script works perfect.

Thanks a bunch.