Gocator Line Profile Sensors: User Manual
Gocator Web Interface • 238
To remove a script output, click on the button next to it.
4. Click the Save button to save the script code.
If there is a mistake in the script syntax, the result will be shown as a "Invalid" with a red border in the
data viewer when you run the sensor.
Outputs from multiple measurement tools can be used as inputs to the script. A typical script would
take results from other measurement tools using the value and decision function, and output the result
using the output function. Stamp information, such as time and encoder stamps, are available in the
script, whereas the actual 3D point cloud data is not. (The script engine is not powerful enough to
process the data itself.) Only one script can be created.
Script Measurement
A Script measurement can be used to program a custom measurement using a simplified C-based
syntax. Similar to other measurement tools, a script measurement can produce multiple measurement
values and decisions for the output.
Scripts must be less than 27000 characters long.
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
Measurement Functions