Basic question, just getting started.
So I have a tag that represents an array of INT’s. I’d like to display the value of the average of that array. When I generate a custom property for the linear scale object that will display it, I bind the property to the expression
And the scale is then greyed out, with a blue tag with a red ‘x’ in the top corner. The online manual only gives an example for the mean function using a 2-dimensional database, so I’m not sure what I could be doing wrong here. I’m used to working with Python, datatypes are handled intelligently by the compiler, but I don’t believe the expression window runs on Python. Do I need to convert my INT’s to floats first?
Having found the same blue tag-red x error indication in another linkage, I realized that I was including the base ‘Tags’ Folder in my path. Omitting ‘Tags’ from the path in that particular scale solves the problem. As that scale shows the difference between nearest neighbor values from the same array, I have not involved any of the built in math functions. Simply subtracting one array value from another seems to work fine, suggesting the issue for my other scale is in the call to the mean function.
However, now when I attempt to implement the script, I get:
“Type mismatch: Argument 0 for function ‘mean(dataset, column OR number, number…)’ needs to be a number”
Argument zero is my dataset path, correct?
My path extended as far as the top-level name of the array, though it has a sub-property ‘Value’ which has 24 indices. If I change my path name to include ‘Value’, I get the same blue tag, red-x warning that seems to indicate an invalid path.