boliva

Combining channels into array

Recommended Posts

I am sampling many channels every second, some of which are temperature readings and others pressures and such.  I want to take a group of the temperature readings (not all of them), and create another channel or variable that would be the average of that group, another that would be the max, and a third that would be the min of the group.  Is that possible without an elaborate script?

Share this post


Link to post
Share on other sites

Sure.  If you aren't going to log it in a logging set, probably the easiest is to use a V channel, and in the expression calculate those values.  For mean, you could calc it in one step on your own, but max and min are more involved, so its probably best to use concat() for all three. 

mean(concat(a[0], b[0], c[0], d[0]))

max(concat(a[0], b[0], c[0], d[0]))

Note that concat() is limited to 20 parameters, so if you have more you'll have to nest it:

mean(concat(concat(a[0], b[0], c[0], d[0]),e[0], f[0], g[0]))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now