You can retrieve data from data-logs using following function:
myscada.readDatalogData(options,callback);
To use this function, please use a visual dialog located in the editor top bar.
Example:
//read historical data from data-log options={}; options['dlgid']=1; options['tags']=[1]; options['timeFrom']=new Date()/1000-60*60; options['timeTo']=new Date()/1000; options['limit']=1000; myscada.readDatalogData(options, function(err,result){ //process each row of returned data for (i=0;i<result.length;i++) { var date=result[i].datetime; var value0=result[i][1]; //first (first@script) } });