# PackedHistoricalTagValue

**URL:** <https://forum.inductiveautomation.com/t/packedhistoricaltagvalue/25196>\
**Category:** Module Development\
**Tags:** ignition80\
**Created:** [May 21, 2019, 1:39pm UTC](https://forum.inductiveautomation.com/t/packedhistoricaltagvalue/25196 "2019-05-21T13:39:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 21, 2019, 1:39pm UTC](https://forum.inductiveautomation.com/t/packedhistoricaltagvalue/25196/1 "2019-05-21T13:39:53Z")

</div>

I was using :

```auto
com.inductiveautomation.ignition.gateway.history.PackedHistoricalTagValue

```

to store history in Ignition 7.9.

This function seems to be still available in Ignition 8 but it use legacy **TagPath / DataQuality**  
is there another class to replace PackedHistoricalTagValue ? or how to use it in Ignition 8 ?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 21, 2019, 2:33pm UTC](https://forum.inductiveautomation.com/t/packedhistoricaltagvalue/25196/2 "2019-05-21T14:33:07Z")

</div>

it seems that the mix of legacy and new class is possible…

```auto
import com.inductiveautomation.ignition.common.tags.model.TagPath;
...

CompletableFuture<List<QualifiedValue>> future = this.gatewayContext.getTagManager().readAsync(tagPaths);
List<QualifiedValue> qualifiedValues = future.get();
if (qualifiedValues.size() == tagPaths.size()){
	for (QualifiedValue qualifiedValue : qualifiedValues) {
		if (qualifiedValue != null) {
			com.inductiveautomation.ignition.common.sqltags.model.TagPath tagPath = com.inductiveautomation.ignition.common.sqltags.parser.TagPathParser.parseSafe("default", tagPaths.get(i).toStringFull());
			historicalTagValue = new PackedHistoricalTagValue(tagPath,
			tagDataTypes.get(i).getTypeClass(),
			tagDataTypes.get(i).getTypeClass() == DataTypeClass.Float ? InterpolationMode.Analog_Compressed : InterpolationMode.Discrete,
			TimestampSource.Value,
			qualifiedValue.getValue(),
			DataQuality.getQualityFor(qualifiedValue.getQuality().getCode()),
			qualifiedValue.getTimestamp());
		}
	}	
	i = i + 1;
}	

```

---

<div class="post-metadata">

**Author:** ![war\_vortex](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@war\_vortex](https://forum.inductiveautomation.com/u/war_vortex)\
**Post date:** [September 5, 2019, 11:01am UTC](https://forum.inductiveautomation.com/t/packedhistoricaltagvalue/25196/3 "2019-09-05T11:01:49Z")

</div>

How do you use queryHistory to query historical data, I have encountered some difficulties, the query timed out
