DurationOn Aggregation fails due to datatype return size

Hi all,

I've encounter a situation where using the DurationOn aggregation with system.tag.queryTagCalculation cannot be used for tags where the tag has been true for longer than ~30 days.

I believe the issue is caused by the fact that calculation is made in milliseconds and not seconds since the return value is in milliseconds.

Caused by: com.inductiveautomation.ignition.client.gateway_interface.ResponseParser$1: Error reading data element [row=0, column="DurationOn", type=Long]
java.lang.NumberFormatException: For input string: "5.17888461E8"

	at com.inductiveautomation.ignition.client.gateway_interface.ResponseParser.endElement(ResponseParser.java:290)

	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)

	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:498)

	... 28 more

I'm also getting this data from the a Canary Historian so I'm not sure If Ignition database Handles the calculation differently or not ?

Okay found the issue,

The Canary Module returns the value in milliseconds and not seconds and this causes the type conversion error

Hopefully they will fix it.

I'm not sure the issue is strictly that it's in milliseconds, it seems to be a number format issue in some XML parsing.

java.lang.NumberFormatException: For input string: "5.17888461E8"

Would this be from the Canary Module side or the Ignition side?

I think the Canary side but I'm really not certain what all their module does or implements.

But it looks like they built a dataset where the column is specified as Long but the value in that row/column spot is "5.17888461E8".