I am running an ignition edge project and am storing certain tag values into the tag historian. Once a day I then pull values from the historian and populate them into a csv file. Up until now the number of decimal places has been correct but the last few days it has been populating with way more than I want. I have the individual tag values set to ##0.0. I have included a snippet of the script, a screenshot of one of the tags themselves, and some of the csv file I am seeing.
#define column names and empty rows
AIheaders = ["Analog Input","Value","Units","Totalizer","Total Units","Alarm Low Setpoint", "Alarm High Setpoint"]
AIrows = []
#iterate through tags, collect values (2-Name,7-Value,12-Units,11-Totalizer,10-Total Units,1-Alm Low Spt,0-Alm High Spt) of each UDT tag
#show zero when high spt is 1000, low spt is -1000
for AIudtPath in AIudtPaths:
AIudt = system.tag.browse(AIudtPath)
AIrow = [AIudt[2]['value'].value, AIudt[7]['value'].value,
AIudt[12]['value'].value, AIudt[11]['value'].value,
AIudt[10]['value'].value, AIudt[1]['value'].value,#create and populate analog input file
AIudt[0]['value'].value]
if AIrow[5] == -1000:
AIrow[5] = 0
if AIrow[6] == 1000:
AIrow[6] = 0
AIrows.append(AIrow)
#convert header & rows to dataset then convert to html
AIdataset = system.dataset.toDataSet(AIheaders, AIrows)
AIStatusHTML = system.dataset.dataSetToHTML(True, AIdataset, "ANALOG INPUT STATUS:")
#write data to dataset
AIstatus = '[PLC]AnalogInStatus'
system.tag.writeBlocking(AIstatus, AIdataset)
Am I missing something? Do I have to make sure to format the Value columns value in the script and if so how would I do that? I want to have each one of those values set to one decimal point.