Plc to pc(server)

Good Day,
We have an HMI KTP700 BASIC PANEL AND S71200 PLC AND ALSO A PC SERVER WHICH IGNITION is installed. They are both connected on the same network. We also have an SQL SERVER for the data entry from the HMI panel.

Can the Ignition writes the tag right before the connection was lost(PC Server)? Or Is the PLC can monitor its connection to the PC Server(Ignition)?

There are ways to capture the last tag value before connection was lost in Ignition. And you can also program a handshake between PLC and Ignition so PLC can respond to a connection loss, if desired.

What are you trying to accomplish?

1 Like


I am trying to create an indicator from the PLC to the HMI, so that the user can know that the Ignition/Database isn’t connected therefore transaction will not be recorded until the connection has returned.
How can the handshake work?

I tried the handshake from set tag in case of failure, but i think it only works for some sql query? Still it would not write tag right before connection is lost. Or maybe i misconfigured something?

Are you trying to indicate:
1 - that DB isn’t connected or
2 - that PLC isn’t connected?

1 Like

The PC where Ignition and DB is installed,
Is it possible? That the Ignition will write a tag to the PLC indicating LIKE ‘Ignition Server Lost it’s connection, inform the HMI’ haha

The conundrum is how to send a message through a broken connection. You can’t. So you can’t wait for the connection to be broken. You have to send messages regularly and have the PLC notice (short timeout) that they are absent.

This is called a heartbeat. A common technique would be to have a one-second timer script in Ignition write the current second to a PLC register. If that register doesn’t change in a couple seconds, the PLC can let the HMI know that the SCADA is offline.



Yes, I have tried to create a timer script from the gateway events that set the tag(trigger) to ‘1’ every 2s and create a ladder logic program to the PLC, set and reset the tag and latches to the other tag (plc_status). I created also a TON Timer and ANDED together the NO contact of plc_connected NC contact trigger to monitor if the ignition does not set the trigger tag to ‘1’ for a period of 5s, now indicating that the PC lost its connection

You should not be writing to a tag from two directions. Send a changing number from Ignition. Don’t change it or reset it on the PLC side. That way leads to race conditions and flaky behavior.

1 Like

I recommend heartbeat logic in the PLC that looks something like this:

Ignition writes to IgnitionHeartbeat once a second. Other logic in the PLC that cares whether Ignition is connected would simply use the bit IgnitionOK.DN.

1 Like

Thanks, i will try another approach. On the logic you have sent, Ignition will send a number to the tag IgnitionHeartbeat. The comparator NEQ will examine the sources. If not equal, the value of IgnitionHeartbeat will then Move to the HeartbeatCopy and turn on the IgnitionOK for 2s.Is there a chance that Ignition will send the number more than twice?

Thank you very much Mr pturmel for helping.

Not quite. The timer is an OFF-delay. It stays on as long as the number keeps changing within the two-second timeout.

1 Like

Good idea. On the flip side how would ignition know the plc isn’t connected?

Use another tag, but have the PLC change it. Maybe copying its localtime seconds. On the Ignition side, use a change script to update a timestamp to now(). If that timestamp becomes older than two seconds, you’ve lost your PLC.

Ignition will also know if the PLC is not Connected.
If you have successfully made connection with the PLC, the status of the Device will change from connected to connecting.

Also, there is a system tag created upon registering the PLC to Ignition
You can check the Tag Browser, System Tags>Gateway>Devices and see the status of the PLC.

Unless there is a multi-hop connection (e.g. routing through one PLC to get to another). Then it only shows the first hop.