You may remember my last post about trying to call a stored procedure from a tag value change, that all worked out now (was due to the stored procedure being defined by a user not in the db - never forget Ignition isn’t responsible for everything!).
Here’s my current issue. I am using Igntition in trial mode on a VM. I am trying to get the event to now trigger on the first Sunday of every month. Now changing the computer’s date does change the tag values appropriately, but fast fowarding two hours does instantly kill the trial mode. Which, is not that big of a deal, I set it up to be 10 5-10 minutes before Saturday/Sunday midnight so I can reset the trial. However, when the day flips over, my logs show this error
|…drivers.TCPDriver[MarkEm_CoLOS_CimJet].T|06Apr2019 23:56:18|Error connecting to 192.168.0.50:1912. Connection timed out: connect
after which nothign happens for a while, definitely not my tag change stuff.
Here’s my tag change, I added a logger to write just on the day change over midnight and that too doesn’t get triggered -
import java.lang.Exception
import traceback
import system
logger = system.util.getLogger("myLogger")
logger.warn("Change of Day!")
if currentValue.value <= 7 and "[~]dayOfWeek" == 1:
#First sunday of the month
try:
call = system.db.createSProcCall("sp_performarchive", "antidivkd")
system.db.execSProcCall(call)
except java.lang.Exception e:
logger.warn("Java Error:", e)
except Exception, e:
tb = traceback.format_exc()
logger.warn("Python error: \n"+tb)
The expression for currentValue.value is dayOfMonth(now())
and the expression for dayOfWeek is dayOfWeek(now())
.
Anyone know why this is failing to fire? Is it due to me changing the internal clock to try to make it run? Is there another way I can test this?