This is an old revision of the document!


Adaptable Example

In the previous example, we hard-coded the distance between each of our assets when requesting a lag-corrected query.

Using ARDI, it's also possible to use relationships and static properties to load these values dynamically.

srv = ardiapi.Server('demo.optrix.com.au/s/pl')
 
 
#Get the results
lcq = samplestream.LagCorrectedQuery(srv)
lcq.RateLagQuery('Strip Meters',"'Paint Line' ASSET 'Speed - Actual' PROPERTY VALUES")
lcq.AddQuery("'Finish Oven Zone 1' ASSET 'Temperature - Oven' PROPERTY VALUES")
lcq.AddQuery("'Prime Oven Zone 1' ASSET 'Temperature - Oven' PROPERTY VALUES",lag=50)
lcq.multiplier = 0.0166
lcq.shavems = True
 
starttime = datetime.datetime.utcnow()-datetime.timedelta(seconds=60*60)
endtime = datetime.datetime.utcnow()
 
df = lcq.Execute(starttime,endtime,samples=3600)