Hi, im doig a heartbeat between a contrologix and my geteway. I did it using this code
server = "Ignition OPC UA Server"
HeartBeatAddress = "ns=1;s=[Contrologix]HeartBeat"
system.opc.writeValue(server, HeartBeatAddress, 1)
i placed it in my edge getaway too because i wanted to do a fallback client and keep the program runnning.
In my plc i just receive the value, and if its equal then i change the value to 0, and if it hasnt change in some seconds, flags a variable.
It was working perfectly until i decided to do another one, vinculated with the gateway writing to another variable and in another clients getaway.
In the first parts, i changed variables to see if it was something about the name, but one instance always kept running, in like the 10th change or try, the code just did nothing. I went back to the version in wich it was running and nothing happens.
I already, restarted the 3 gateaways and the PLC. There are no loggs cause it seems to be executing the script, but in my PLC i receive nothing.
Double check your server name. At some point, the default was changed from Ignition OPC UA Server
to Ignition OPC-UA Server
. (Notice the dash)
just reviewed the servers in the main server and the 2 edges, they all are the same
this is the diagnostics enable for the main server
On the VMs I use for random questions from all corners, subject to imports of all kinds, I duplicate the loopback connection with both names, so it just works™.
3 Likes
Thanks all, actually it was something about the timers, my PLC was writing at the same frequency than ignition so it never changed the value. I just added a timer to the writing in my PLC and worked perfectly.
Glad you got it working.
Off topic: My vocabulary is fairly ample, but I did have to look up vinculate. I guess I'm not the very model of a modern major general.
For those not familiar with the Pirates of Penzance.
1 Like
Ah, a common problem when a tag is written from two directions. Use two tags. Toggle or increment one regularly from Ignition for the PLC to monitor, and toggle/increment the other from the PLC for Ignition to monitor.
3 Likes