I have my MYSQL database and SQL Tags Historian setup and logging. I need to be able to automatically every 10, 30 and 60 minutes to run a query on certian tags and export these to the same excel spreadsheet. Where in the excel spreadsheet I can then move the tags to the correct column and row.
Sure, you can create a timer script that runs on the gateway (in one location) every 30 seconds like this:[code]from java.util import Date
from java.util import Calendar
spreadsheet = system.dataset.dataSetToExcel(1, [ds])
filePath = “C:\output\results.xls”
system.file.writeFile(filePath, spreadsheet)[/code][where “dbname” in the queryTagHistory() function is the name of the database connection holding your SQLTag history data]