Script won't execute on Value Change event

Hi all,

I'm new to ignition and I am following the courses from the inductive university. However I fail to figure out something that is not working for me regarding binding a script to a tag value change event.

I've created a boolean named "hi" that toggles each second between true and false on a Beckhoff IPC:

image

I've successfully imported this variable as a tag in my Ignition Designer:

image

I was able to execute a simple logging message in the script console with following code:

logger = system.util.getLogger("Liem says")
logger.info("Hello")

However, when trying to apply the code to the Value Changed event, the message does not get logged. Neither do I find any error in the diagnostics:

After trying all sorts of code onto the Value Changed event, I really think I am overlooking something here. Would anyone be able to point me into the right direction please? :slight_smile:

Kind regards,
Liem

In your tag browser screenshot, the value "8,500" is red. That suggests you don't have proper communication. Fix that first.

1 Like

If you hover over the check mark on the Ignition tags, see if it says any bad quality error. Booleans don't go red when bad quality and can be deceiving

1 Like

My bad, I'm currently experimenting on a trial version of ignition edge.

I must have taken the screenshot at the moment that it had expired. Here is a new screenshot of it fixed, however the same issue remains.

afbeelding

Thank you for the info, sadly enough the connection is "Good" when the issue happens.

afbeelding

Where are you looking for the logged message to show up?
Tag Change Events will log to the gateway not to a client.

I'm checking both the log of the designer and the logs in the gateway. The gateway has always been empty for me too:

So there aren't any log events at all in the gateway? That is strange...

I haven't tried to log anything else or experimented with anything else. Could this be why my log is empty? Or should there be more that is logged automatically like a reactivation of the trail etc?

There should be a number of logged events in there... just normal Ignition stuff.

What OS is this?
In the directory that holds the Ignition installation, there should be a logs folder with a wrapper.log file. Can you open that and see if there is anything in that file?

OS:

I have multiple wrapper.log files:

afbeelding

wrapper.log content:


INFO   | jvm 1    | 2023/09/13 16:52:02 | 16:52:02,789 |-ERROR in com.inductiveautomation.logging.SQLiteAppender[DB] - problem appending event org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: LOGGING_EVENT)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: LOGGING_EVENT)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.DB.newSQLException(DB.java:1179)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.DB.newSQLException(DB.java:1190)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.DB.throwex(DB.java:1150)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.NativeDB.prepare(NativeDB.java:126)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.DB.prepare(DB.java:264)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:46)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:32)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:25)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:34)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:226)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:206)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:221)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at com.inductiveautomation.logging.SQLiteAppender.batchAppend(SQLiteAppender.java:494)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:02 | 	at 	at java.base/java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2023/09/13 16:52:03 | I [Liem says                     ] [14:52:03]: Hello

Great, that wrapper log is usefull! So it does get logged sort of and apparently i first had to set up my database it seems for the logs to work. I will look into that now, thank bschroeder for your feedback and showing me this.

Oh wait, database was on my main ignition gateway, i believe it wasn't supported in edge?

That SQLiteException is referencing the internal Ignition database. That isn't something that you have to create.

This might be a permissions issue.

How did you install Edge?

I downloaded the zip file for ignition edge on my personal laptop and then i pasted it on the ipc through remote desktop because I don't have internet access on the IPC. Then I believe i just extracted it and installed from there. It's possible i did not install as admin. Do you recommend a clean installation?

Yep. It's possible that permissions are messed up.

You can download the regular install file for Ignition install it and then a web page will show up that will allow you to select the flavor of Ignition to use. Pick Edge and then go from there.

3 Likes

I don't have enough storage for the regular Ignition Installer :joy: .

I will fix that tommorrow and let you know the results. Thanks again!

I'm very happy to say that this solution did it for me, works like a charm now! Thank you bschroeder!

1 Like