# Script won't execute on Value Change event

**URL:** <https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082>\
**Category:** Ignition\
**Created:** [September 13, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082 "2023-09-13T14:24:11Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/1 "2023-09-13T14:24:11Z")

</div>

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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/7550b673b4a7bf17d251a9ce51e5fe013d8020a3.png)

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

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/277c5ca0dc7c6da02338bcbf0cb5615715d14223.png)

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:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/814c16517be76fb73f9c723a908e095f02109151.png)

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? 🙂

Kind regards,  
Liem

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 13, 2023, 2:28pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/2 "2023-09-13T14:28:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [September 13, 2023, 2:29pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/3 "2023-09-13T14:29:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/4 "2023-09-13T14:36:00Z")

</div>

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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba655fb924440263b13245fd992d0f275191e989.png)

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/5 "2023-09-13T14:36:54Z")

</div>

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

![afbeelding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba655fb924440263b13245fd992d0f275191e989.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [September 13, 2023, 2:40pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/6 "2023-09-13T14:40:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:42pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/7 "2023-09-13T14:42:36Z")

</div>

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

 ![afbeelding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/3/331b093524cdc06e34aa8f4488ca2b1c730c5882.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [September 13, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/8 "2023-09-13T14:43:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:46pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/9 "2023-09-13T14:46:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [September 13, 2023, 2:49pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/10 "2023-09-13T14:49:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/11 "2023-09-13T14:55:40Z")

</div>

OS:

 ![afbeelding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/748ce1ae4d9b6814449a6d6ab8505dd4137390c9.png)

I have multiple wrapper.log files:

![afbeelding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/28262203868528bb1b346cd6cd68cf6048ba10c9.png)

wrapper.log content:

```auto

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.

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 2:58pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/12 "2023-09-13T14:58:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [September 13, 2023, 2:59pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/13 "2023-09-13T14:59:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 3:02pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/14 "2023-09-13T15:02:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [September 13, 2023, 3:05pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/15 "2023-09-13T15:05:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 13, 2023, 3:35pm UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/16 "2023-09-13T15:35:33Z")

</div>

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

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

 ![afbeelding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/22a0a16ad463d5ed001c058450af6516a4464c37.png)

---

<div class="post-metadata">

**Author:** ![Liem\_Nguyen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/liem_nguyen/32/52217_2.png) [@Liem\_Nguyen](https://forum.inductiveautomation.com/u/Liem_Nguyen)\
**Post date:** [September 14, 2023, 8:09am UTC](https://forum.inductiveautomation.com/t/script-wont-execute-on-value-change-event/79082/17 "2023-09-14T08:09:34Z")

</div>

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