Good morning, my name is Felipe and I have been studying ignition hard, but I am still very young on the platform. I have been studying a way to write in a table component by clicking on the mouse using the system.tag.queryTagHistory
function, I don’t know is possible, and if so, I would like to know what I’m doing wrong? used as reference in startdate the following expression in a text field component:
dateArithmetic({Setup_Plant/Plant01/CurrentShiftStart1},-1, 'days')
the enddate reference I used the following expression in the text field 1 component:
dateArithmetic({Setup_Plant/Plant01/CurrentShiftStart1},0, 'days')
and in the button component scripting component, in the event handlers >> mouse clicked I used the expression:
startdate =event.source.parent.getComponent('Text Field').text
enddate = event.source.parent.getComponent('Text Field 1').text
pathlist = []
namelist = ["TimeStamp"]
name = "necker0101"
historyTagPath = "[ign_Historical]Machines_DM/" + name + "/count_discharge"
pathlist.append(historyTagPath)
infeedName = name + "_discharge"
namelist.append(infeedName)
# name = "necker0201"
# historyTagPath = "[ign_Historical]Machines_DM/" + name + "/count_discharge"
# pathlist.append(historyTagPath)
# infeedName = name + "_discharge"
# namelist.append(infeedName)
data['hourly_counts'] = system.tag.queryTagHistory(paths=pathlist, aggregationMode='Sum', columnNames=namelist, startDate=startdate, endDate=enddate, intervalHours=1, noInterpolation=True)
data['hourly_counts'] = event.source.parent.getComponent('Table').data
I really don’t know if it’s possible, I’m just testing it for another application and also to improve my knowledge in other scripting functions. because I believe you could do this using the system.dataset.toDataSet