Hi, for a critical application I need to know the status of a transaction group inside a script.
It is necessary to “stop” the processing if the transaction group is failing for any reason.
I was expecting there was a system function to check that but I did not find it.
The only solution I saw is proposed here: Get status of transaction group. It surely can work but honestly I would prefer to something more “deterministic”. I found quite strange that the transaction group status is clear inside the designer ,however it is not possibile to check at run time.
As per my second email, the “Handshake on failure” in not writing the tag whenever is triggered and, by example, the DB is not available and the transaction group is failing.
a) What do I have to re-implelement?
b) Why the tag associated to the “on failure” is not written and vice versa also if the Transaction group is failing is written the “on success”
Please re-check my screenshot and second email about.
a) You write a script function that uses a combination of system.tag.readBlocking and system.opc.readValues to obtain all of your sample data. You compute any other items with jython and that sample data. You insert to the database with system.db.runPrepUpdate. You wrap the entire function in a try-except block. You call that function from a tag change event or a timer event.
b) Transaction group “write on failure” only writes when the DB has an error in the statement execution. Not if the DB wasn’t available at all. And as noted in the other topic, that failure requires a manual restart. In other words, you can’t get the level of monitoring you want.
I don’t see any screenshot from you.
Consider replying on the forum instead of by email if you can’t eliminate your signature block. Those are against the forum rules (see “Keep it Tidy” in the FAQ).
Hi Phil, sorry but point B) is not exactly true. If I drop the table (with automatically create table = false) as I did, surely the SQL statement (insert) will run in error but the “write on failure” is not writing in the associated tag.
Sorted out: setting in the Transaction Group → Option the “by pass of Store & Forward” all the unsuccessful transactions with the DB are triggering the “Failure” tag. Practically, the S&F acts as a “buffer” also in (temporary) absence of the DB