OPC UA alternatives (aka Kepserver)?

This script will parse your CSV and enter it into the ignition historian with your RTU timestamp.

#convert the csv into an ignition dataset
import csv
path = system.file.openFile("csv")
if path != None:
	f = open(path,'rb')
	reader = csv.reader(f)
	csvlist = list(reader)
	ds=[]
	row = 0
	for x in csvlist:
		if row == 0:
			headers = x
		if row > 0:
			ds.append(x)
		row += 1
csvdataset = system.dataset.toDataSet(headers, ds)

#parse the dataset and enter the data into the historian
for row in range(csvdataset.rowCount):
	tagname = csvdataset.getValueAt(row,'tag')
	tagvalue = int(csvdataset.getValueAt(row, 'intvalue'))
	tagtimestamp = system.date.fromMillis(long(csvdataset.getValueAt(row, 't_stamp')))
	tagquality = 192
	system.tag.storeTagHistory("ign_historical","default",[tagname],[tagvalue],[tagquality],[tagtimestamp])
1 Like