Gocator Line Profile Sensors: User Manual
Gocator Web Interface • 312
Scripts
Scripts use outputs from other measurement tools to produce custom measurements.
Similar to other measurement tools, a script measurement can output multiple measurement values and
decisions. Scripts are added, configured, and removed much like other measurement tools; for more
information on this, see Script under Profile Measurement on page 202 or Surface Measurement on page
244.
Scripts must be less than 27,000 characters long.
Scripts use a simplified C-based syntax. The following elements of the C language are supported:
Elements Supported
Control Operators if, while, do, for, switch and return.
Data Types char, int, unsigned int, float, double, long long (64-bit integer).
Arithmetic and Logical
Operator
Standard C arithmetic operators, except ternary operator (i.e., "condition? trueValue:
falseValue"). Explicit casting (e.g., int a = (int) a_float) is not supported.
Function Declarations Standard C function declarations with argument passed by values. Pointers are not
supported.
Supported Elements
Built-in Functions
Function Description
int Measurement_Exists(int id) Determines if a measurement exists by ID.
Parameters:
id – Measurement ID
Returns:
0 – measurement does not exist
1 – measurement exists
int Measurement_Valid(int id) Determines if a measurement value is valid by its ID.
Parameters:
id - Measurement ID
Returns
0 - Measurement is invalid
1 - Measurement is valid
double Measurement_Value (int id) Gets the value of a measurement by its ID.
Parameters:
id - Measurement ID
Returns:
Measurement Functions