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?

Link to comment
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]))

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.