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 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]))

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.