# 'REFERENCE\_NOT\_FOUND' in UDT Instance on first execution

**URL:** <https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135>\
**Category:** Ignition\
**Created:** [September 12, 2012, 5:50pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135 "2012-09-12T17:50:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 12, 2012, 5:50pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/1 "2012-09-12T17:50:09Z")

</div>

Hello,

i encountered a problem when using DataType’s with a driven ScanClass. On first execution of the ScanClass, Instance tags fail with ‘REFERENCE\_NOT\_FOUND’. Subsequent triggers work as expected.  
If Tags are ‘chained’ in the DataType using expressions, there is an additional ScanClass execution necessary to get the second tag working.  
Here are some screenshots of a simple project to reproduce the issue, i can also post a backup, if this is helpful.  
The tags in the DataType use a driven ScanClass, driven by any change of tag ‘Trigger’.  
Ignition version is 7.5.2.

I hope there is an easy solution for this, i need to log data reliable starting from the first trigger.

Thank’s for your help.

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ef7529d1841c93a481b848fe1857f82f0b9dfbdd.png)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/72d8b03749269261c5c846d2221e38cfa056d510.png)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/adddb4e6fae489edbbbef54204a4b23097678a67.png)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/37e634200d2da6a3fb13c5bf5cd0ffe457a4c77a.png)

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [September 13, 2012, 4:41pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/2 "2012-09-13T16:41:27Z")

</div>

Hi,

I’ll have to look into this- as long as everything is in the same scan class, they references should execute each other. The reference\_not\_found quality is the default quality for a reference, until it successfully executes, leading me to believe that for some reason the parent expression thinks the reference is in a different scan class or something, and thus doesn’t execute it. The scan class finally executes it, so the value is available on the next cycle.

I’ll try to mock it up today and see.

Regards,

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 17, 2012, 1:27pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/3 "2012-09-17T13:27:49Z")

</div>

I just realized the this has nothing to do with UDTs. It happens in fact to any expression item, also to such used in a Transaction Group. In complex expression it causes a ‘Type Conversion Error’ instead of ‘Reference Not Found’.

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [September 18, 2012, 6:05pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/4 "2012-09-18T18:05:20Z")

</div>

I have been trying to replicate this issue with little success. Any chance you could upload a gateway backup to this thread?

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 18, 2012, 8:08pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/5 "2012-09-18T20:08:18Z")

</div>

Here is the backup. I had some problems uploading the file, so used 7Zip to split it in two parts. Remove the .zip ending to unpack (Borad does not accept files with .001 / .002).

The backup is from 7.5.2, running on a VM under Windows XP. I can reproduce the problem on a second installation and also on the licensed production system (There it blocks the ‘Does the server handle restarts without dataloss’ check).  
My system language is de\_DE.

Let me know if i can do anything else to help.  
[Ignition-backup-20120918-2128.zip.002.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9a76a7c995861824bef72a60ed84f81da1560542.zip) (4.29 MB)  
[Ignition-backup-20120918-2128.zip.001.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c01cea7a9969d35736f7145664e30f05bb7499d7.zip) (5 MB)

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 18, 2012, 8:43pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/6 "2012-09-18T20:43:17Z")

</div>

A little additional info: I set the ScanClass to LogLevel ‘All’ and got some warnings. I’m not sure what happend on ‘Sun Aug 17 08:12:55’…

```auto
INFO | jvm 1 | 2012/09/18 22:38:10 | WARN [ScanClass[Triggered] ] [22:38:10,142]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:14 | WARN [ScanClass[Triggered] ] [22:38:14,718]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:14 | WARN [ScanClass[Triggered] ] [22:38:14,728]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:14 | WARN [ScanClass[Triggered] ] [22:38:14,728]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:14 | WARN [ScanClass[Triggered] ] [22:38:14,728]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:21 | DEBUG [ScanClass[Triggered] ] [22:38:21,107]: Scan class 'Triggered' executing.
INFO | jvm 1 | 2012/09/18 22:38:21 | TRACE [ScanClass[Triggered] ] [22:38:21,107]: Setting the current rate to 1000. Existing rate is 1000. If equal, no changes will be made
INFO | jvm 1 | 2012/09/18 22:38:21 | WARN [ScanClass[Triggered] ] [22:38:21,107]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:21 | WARN [ScanClass[Triggered] ] [22:38:21,107]: Received a lease expiration that was older than the previous, will not apply - Sun Aug 17 08:12:55 CET 292278994 (9223372036854775807)
INFO | jvm 1 | 2012/09/18 22:38:25 | DEBUG [ScanClass[Triggered] ] [22:38:24,993]: Scan class 'Triggered' executing.
INFO | jvm 1 | 2012/09/18 22:38:25 | TRACE [ScanClass[Triggered] ] [22:38:24,993]: Setting the current rate to 1000. Existing rate is 1000. If equal, no changes will be made
INFO | jvm 1 | 2012/09/18 22:38:28 | DEBUG [ScanClass[Triggered] ] [22:38:28,798]: Scan class 'Triggered' executing.
INFO | jvm 1 | 2012/09/18 22:38:28 | TRACE [ScanClass[Triggered] ] [22:38:28,808]: Setting the current rate to 1000. Existing rate is 1000. If equal, no changes will be made
INFO | jvm 1 | 2012/09/18 22:38:33 | DEBUG [ScanClass[Triggered] ] [22:38:33,345]: Scan class 'Triggered' executing.
INFO | jvm 1 | 2012/09/18 22:38:33 | TRACE [ScanClass[Triggered] ] [22:38:33,345]: Setting the current rate to 1000. Existing rate is 1000. If equal, no changes will be made
```

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [September 19, 2012, 6:31pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/7 "2012-09-19T18:31:26Z")

</div>

Hi,

Thanks for the backup, we were able to quickly replicate it and track it down. Basically, it goes like this: references were subscribed on first execution of a tag. Depending on how quickly the subscription update was received, and the order of the tag execution, it sometimes might be lined up for the first exec, otherwise it would come through on the next one.

We’ve fixed it so that the tag reference is always in place (assuming the tag exists) for the first execution, and that the order of the execution doesn’t matter, because if they’re in the same scan class, the referencing tag will first cause the referenced tag to execute.

This will be available in the first 7.5.4 beta.

Regards,

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 19, 2012, 7:28pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/8 "2012-09-19T19:28:41Z")

</div>

Thank you, that’s good news.

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [September 26, 2012, 1:36pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/9 "2012-09-26T13:36:16Z")

</div>

I just checked 7.5.4 beta 1. Good news is that SQLTags are ok now, but it still happens for triggered expression items in a transaction group, if the expression references an SQLTag.  
Let me now if you need another demo project to reproduce this, i will try to put something together then.

---

<div class="post-metadata">

**Author:** ![Michael.Stofan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.stofan/32/3342_2.png) [@Michael.Stofan](https://forum.inductiveautomation.com/u/Michael.Stofan)\
**Post date:** [September 27, 2012, 6:01pm UTC](https://forum.inductiveautomation.com/t/reference-not-found-in-udt-instance-on-first-execution/5135/10 "2012-09-27T18:01:19Z")

</div>

If you could get a project together, that would be great. It’s definitely the quickest way for us to see what is wrong.
