I am running an event based SQl query to time stamp an estop
I need help using the tag name in my script. my python is useless
My script works as follows
system.db.runUpdateQuery(“INSERT INTO LTN4_ESTOP (t_stamp, estop_name, message) VALUE (‘t_stamp’, ‘tagName’, ‘EStop Active’)”)
I want to use the value of a tag called t_stamp and the name of my tag and insert it in to my query so that it updates the table with the name of the estop that has been pushed and at what time
I want to update the UDT so this is a generic script for all ESTOP Tags
i rolled back to a simple update query so that i got to a known good situation
i created a TEST instance of the UDT to frig the value to 1 to test if it wrote to the db, each time I change the value to one I get the little red dot error after the tag and I cant see what the error is on the console, it doesnt write to the db either, the system.tag.write line is proven and has been working for a while
Try adding the database connection name to the runUpdateQuery statement. Since tag event scripts are executed on the Gateway there is no default database connection to use.