# Tag keeps going null

**URL:** <https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901>\
**Category:** Ignition\
**Created:** [January 25, 2014, 12:17am UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901 "2014-01-25T00:17:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [January 25, 2014, 12:17am UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/1 "2014-01-25T00:17:06Z")

</div>

I have a tag data type instance where one of the tags periodically goes null. I have 10 instances of this data type and I have had one of them go null several times and a couple others only a few times. if I change the data type instance property that points to the tag to something else and then change it back to the correct address it works fine again for a few days.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 25, 2014, 12:28am UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/2 "2014-01-25T00:28:56Z")

</div>

A few questions: what version of Ignition is this? Are there any related events happening in the gateway logs? What kind of device is providing these tags?

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [January 27, 2014, 4:27pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/3 "2014-01-27T16:27:20Z")

</div>

I seem to have made it through the weekend without any of them going null. One of my coworkers suggested changing its type from int4 to int2 and making it read only. Im not sure if that helped. its version 7.6.4. I haven’t spotted any related events. The instance thats dropping the most is a DL205 - the other 2 are modicon quantum through modbus plus bridge. The weird thing is I still have an ignition server running off my office computer which is version 7.6.2 (its one of the old free vision panel licences) and its monitoring the exact same DL205 and its never in the last 8 months ever gone null. Its not a UDT tag template instance though its just a directly configured tag and it was set up as boolean. would that make any difference?

---

<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:** [January 27, 2014, 7:15pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/4 "2014-01-27T19:15:21Z")

</div>

Hi,

Once they’re up and running, the UDT tags are exactly the same as non-udt tags. However, the fact that they’re going to null value and “unknown” quality (which I see from the tag icon), which just happens to be the first value of a tag before the value comes in, suggests that perhaps for some reason the udt (definition or instance) is being modified and reloaded. This would seem unlikely, but could probably be triggered by a script or tag binding that writes to a “config” property of a tag in the udt… in other words, a property that isn’t value. Does this seem possible?

If it’s not the tag reloading, then it could theoretically be something going on with the OPC server. The console, which Kevin pointed you towards, might show the opc connection going down briefly, or something like that.

Another thing to look at would be to go to Status\>OPC Connections when the tag is bad quality. Try to track down the tag in the list of subscriptions. Is it there? Is it’s value also null? The opc server won’t reset the value to null, it would only send bad quality, but if you see null in that list, it means the value was subscribed and never received a value. This would pretty much also indicate that the tag was getting reloaded for some reason at a later point.

Regards,

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [January 30, 2014, 5:53pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/5 "2014-01-30T17:53:10Z")

</div>

thank you I will look into that, none of them have gone null in a few days. im not really sure what to make of it but I’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [February 17, 2014, 3:56pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/6 "2014-02-17T15:56:12Z")

</div>

Hi, we just upgraded to the version 7.6.4 and we have the same problem but involving memory tags. Sometimes the tags go null/unknown. We write the value of these tags using java code but never the quality, so there is nothing we can change in our code or Ignition’s configuration. This happens randomly and recovers in a few minutes, but there are some of these tags that are critical and our system collapses. Any solution other than going back to the older version we where using?

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [February 17, 2014, 3:58pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/7 "2014-02-17T15:58:52Z")

</div>

I still have some tags randomly going null but I havnt been able to pin it down. last week I had an entire folder with all the containing alarm tags go null.

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [February 17, 2014, 4:13pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/8 "2014-02-17T16:13:00Z")

</div>

The same is happenig here. The main issue is that it doesn’t follow a pattern, so it is impossible for me to narrow down the problem. If you find a lead, let me know! Thanks in advance!

---

<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:** [February 19, 2014, 3:43pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/9 "2014-02-19T15:43:44Z")

</div>

Hi,

Let’s see if we can narrow down some possibilities:

Alcaan - you said: “We write the value of these tags using java code but never the quality”. How are you executing the write? Can you post an example? If you really are doing it in java, my suspicion is that you’re setting the value on a TagDiff and then calling edit, which could possibly lead to this.

cja7928 - Are the affected tags always in UDTs?

In both cases: If you go to Status\>SQLTags in the gateway, and look at the executing scan classes, what kind of numbers do you see for “Last Execution Duration”? This wouldn’t be a cause, but I’m just curious.

Also, have either of you been in contact with support? Ideally I’d like to get the wrapper.log file(s) (from {installdir}\logs) that cover the time when this occurs. You could probably just zip them up and post them here, otherwise email them to support AT [inductiveautomation.com](http://inductiveautomation.com), and say “for colby” in the subject or something.

Regards,

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [February 19, 2014, 5:29pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/10 "2014-02-19T17:29:15Z")

</div>

I have seen it in both UTD and regular tags. I dont have access to the Status (developer only). next time I see a null tag I will request our IT group get this info for me.

---

<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:** [February 19, 2014, 5:34pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/11 "2014-02-19T17:34:55Z")

</div>

Hi,

Probably more important would be to get the log files, either on disk, or through the gateway from Config\>Console\>Logs\>Export Logs.

Regards,

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [February 20, 2014, 12:42pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/12 "2014-02-20T12:42:23Z")

</div>

Hi,  
Here is a example of code we use to write the memory tags:

`	public void writeValue(String tagPath, String value) {
		try {
			List<WriteRequest<TagPath>> writePaths = new ArrayList<WriteRequest<TagPath>>();
			WriteRequest<TagPath> writeValue = new BasicAsyncWriteRequest<TagPath>(TagPathParser.parse(tagPath), value);
			writePaths.add(writeValue);
			tagManager.write(writePaths, null, true);
		} catch (IOException e) { 
			logger.error("Error escribiendo el valor " + value + " en el tag " + tagPath, e); 
			}
	}`

Also attached screenshots for the scanclasses. The last error was the 17th and the logs fall short, we have a lot of noise and ignition only save a few days. I will save the logs as soon as a new error occurs and send them to you.

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [March 11, 2014, 3:39pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/13 "2014-03-11T15:39:28Z")

</div>

Here is the log and the graph when you can see the time of the error. Still happening randomly once or twice a week. I looked at the log, but didn’t find anything strange.

---

<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:** [March 11, 2014, 4:21pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/14 "2014-03-11T16:21:26Z")

</div>

Hi,

For those two tags: what kind of scan class are they in? Is it a direct scan class, or a leased scan class? The log doesn’t show much, but it’s somewhat suspicious to me that it does show messages about a lost session more or less each time the values go flat… The session shouldn’t affect the tags, but it might be doing something to the subscriptions, which in turn might have an unintended consequence.

Also, what is the data source for those tags? Are they from the custom driver that is shown in the logs?

Regards,

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [March 11, 2014, 5:05pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/15 "2014-03-11T17:05:36Z")

</div>

Hi,  
The two tagas are memory tags and the scan class is the default from Ignition. We change the value of the memory tags using a module. The code we use is this:

`public void writeValue(String tagPath, String value) {
		try {
			List<WriteRequest<TagPath>> writePaths = new ArrayList<WriteRequest<TagPath>>();
			WriteRequest<TagPath> writeValue = new BasicAsyncWriteRequest<TagPath>(TagPathParser.parse(tagPath), value);
			writePaths.add(writeValue);
			tagManager.write(writePaths, null, true);
		} catch (IOException e) { 
			logger.error("Error escribiendo el valor " + value + " en el tag " + tagPath, e); 
			}
	}`

I can’t understand how using this code we can get a null value and unknow state in a memory tag and the problem being random it doesn’t help to narrow it. For us is a critical to solve this. The only think I can think now is to do a donwgrade on the version. Hope we can solve it before going that far! Thanks!

---

<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:** [March 11, 2014, 5:13pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/16 "2014-03-11T17:13:35Z")

</div>

Hi,

The write looks like it’s probably fine, but again, what is the scan class set to? I’m really curious if the tags happen to be in a leased scan class. Even if not, I’m trying to figure out if by some long shot, the lost session messages might be related (my thinking is that lost sessions mean resubscription, and subscriptions do end up loading tags from the internal database, so maybe something is going on there).

Regards,

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [March 11, 2014, 5:25pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/17 "2014-03-11T17:25:25Z")

</div>

Here you have one of the memory tags and the scanClass. Let me know if it is useful!

---

<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:** [March 13, 2014, 9:29pm UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/18 "2014-03-13T21:29:22Z")

</div>

I’ve been trying to test various scenarios, but I simply can’t come up with anything. You mentioned rolling back, is there a particular version where you know that this wasn’t happening?

Unfortunately the logging isn’t very helpful in this case, I can’t find anything that would help me narrow down what could be going on. I’ve got one idea, however, that might help me confirm or deny one idea:

You could try to set up a Gateway Tag Change Script on just that tag, and do something like the following:

```auto
print "Path: %s Value: %s Quality: %s Tag: %s" % (event.tagPath, newValue.value, newValue.quality, str(event.source))
```

The “print” output will only write to the wrapper.log file in {InstallDir}\logs. The main point I’m curious about is the last parameter, the toString of the source, which should show me the actual instance hash of the tag. I’m curious if this changes when the null values occur. If you set this script up, as soon as you see a null event, send me (attach here) the wrapper.log file.

Regards,

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [March 28, 2014, 11:22am UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/19 "2014-03-28T11:22:56Z")

</div>

I’ve been trying for weeks the gateway tag change script, but I couldn’t catch the bug in the log. The last version of Ignition without the bug was 7.6.2, now we are running the 7.6.4. As soon I get the bug in a log I send it to you. Thanks!

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [July 22, 2014, 10:44am UTC](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901/20 "2014-07-22T10:44:35Z")

</div>

Hi, After not happening for a while (at least we didn’t notice in the important tags), the problem appeared again. You can see the moments that the value went null in the pics. Also you have the logs. Let me know if this info is useful to solve the problem!  
[log.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0e22cd52a8704f792295faf59ee8ad79104a52c0.zip) (277 KB)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b468f85b9f9f1a57290f6f8e4c73e6990ed43c75.png)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b9593657c79f9ae64f445a26bd0c3b71e3d58893.png)

[Next page](https://forum.inductiveautomation.com/t/tag-keeps-going-null/7901.md?page=2)
