DaqConnect Max(array)


andybdjuk

Recommended Posts

Hi, I cant seem to get the Max(array) function to work in DaqConnect. I just seem to get the latest value displayed. From the help file all seems to be ok but...

I have left it on my page to look at if you could advise me

Thanks

Andy

Link to comment
Share on other sites

DAQConnect works a little differently than DAQFactory when it comes to retrieving historical data. This is because it is a client / server app and we don't want you accidently retrieving the entire history (which could be huge!) In DAQFactory, the history is in memory so its no big deal to retrieve the entire thing. Even in DAQFactory, we require specific subsetting to retrieve Persisted channel data, again to avoid you accidently loading too much data into memory.

So, in DAQConnect, when you do "mytag", it will only retrieve the most recent value. The exception is in a graph. The graph component automatically adds subsetting to the request based on the X scale time range. This is why you don't have to subset in graphs. What you need to do, then, is to subset the channel and specify exactly what range of data you want:

max(mytag[systime(), systime() - 86400])

would give you the max of the last day's readings.

Now, another difference: when subsetting by index (i.e. [0,5]), you can only go back 10 readings from the time you last refreshed the browser. When the system first loads, it gets the last 10 readings for any tags requested, and then will add values to the front of it, but you can retrieve back past 10 readings by subsetting by index. This is again because the system is client/server. It is therefore best, unless you are working with short durations (i.e. doing some short timescale averaging), that you always subset by time in DAQConnect.

Link to comment
Share on other sites

Thanks I'm pleased it wasnt something really simple. I assume this it is in the help but I failed to see it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.