No values provided Error when using storeTagHistory Function

Hi everyone,

I'm attempting to copy the history from one tag to another.

It's complaining that "No values provided" but I have checked the data is in the array.

Here is the code I am using:

sourcePath='[MQTT Engine]Edge Nodes/XNEELO 002/seneca/C8F9810F26XX/avi/abalone/zgprs3001/custom/FLOW_1_FB'
destPath='[default]Edge Nodes/projects/avi/abalone/zgprs3005/custom/FLOW_1_FB'

endTime = system.date.now()
startTime = system.date.addWeeks(endTime, -1)

dataSet = system.tag.queryTagHistory(paths=[sourcePath], startDate=startTime, endDate=endTime, returnFormat='Wide')
converted=system.dataset.toPyDataSet(dataSet)

dst=[destPath]*len(converted)
datetimes=[x[0] for x in converted]
Values=[x[1] for x in converted]
Quality=[192]*len(converted)


print [x[1] for x in converted[:10]]
system.tag.storeTagHistory(
	historyprovider='seneca', 
	tagprovider='default', 
    path=[destPath]*len(converted),
	values=Values,
	qualities=[192]*len(converted),
	timestamps=[x[0] for x in converted])

Here is the error I get:

Traceback (most recent call last):
  File "<input>", line 23, in <module>
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.invoke(GatewayInterface.java:954)
	at com.inductiveautomation.ignition.client.script.ClientTagUtilities.storeTagHistoryImpl(ClientTagUtilities.java:327)
	at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.storeTagHistory(AbstractTagUtilities.java:602)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: No values provided.

What mistake am I making?

Try logging len(converted).

image

Hmm. That one argument is the only list that isn't an inline list comprehension. Try substituting?

Also, consider not using keyword parameters. The docs don't say this function supports them.

You were correct, it doesn't accept keyword parameters.