IDE script not working - how do I check it

The following script was put in by a 3rd party integrator. It does not seem to be working even though the script is set to running and auto start is checked. Hearbeat_In and Heartbeat_Out are Controller Bools to an AB PLC. The tags are running, all are updating and there are no errors. When heartbeat_in goes to 1, heartbeat_out is not changing. I have tried rebooting the EWON.

// Monitor incoming pulses from PLC, send a response pulse
Onchange “Heartbeat_In”, “@heartbeat
Function heartbeat

If Heartbeat_In@=1 Then
Heartbeat_Out@=1
Endif

ENDFN

Hi Chester,

I just tried checking the code and it seems like it doesn’t have any errors in it. One thing you could do to test it is create a dummy tag called test.

Then you can modify the code to be like this:

Onchange “Test”, “@heartbeat

Function heartbeat

If test@ = 1 Then
Heartbeat_Out@ = 1
print Heartbeat_Out@

Endfn

You should be able to just go onto the console and change the value of test by writing something like test@ = 1 or test@ = 0 and the code will run each time that it sees the value of test@ change

Thanks!