Gocator Snapshot Sensors: User Manual
Gocator Web Interface • 260
Function Description
int RuntimeVariable_Get32s(int id) Returns the value of the runtime variable at the given index.
Parameters:
Id – ID of the runtime variable
Returns:
Runtime variable value
Function Description
long long Stamp_Frame() Gets the frame index of the current frame.
long long Stamp_Time() Gets the time stamp of the current frame.
long long Stamp_Encoder() Gets the encoder position of the current frame.
long long Stamp_EncoderZ() Gets the encoder index position of the current frame.
unsigned int Stamp_Inputs() Gets the digital input state of the current frame.
Stamp Functions
Function Description
float sqrt(float x) Calculates square root of x
float sin(float x) Calculates sin(x) (x in radians)
float cos(float x) Calculates cos(x) (x in radians)
float tan(float x) Calculates tan(x) (x in radians)
float asin(float x) Calculates asin(x) (x in radians)
float acos(float x) Calculates acos(x) (x in radians)
float atan(float x) Calculates atan(x) (x in radians)
float pow (float x, float y) Calculates the exponential value. x is the base, y is the exponent
float fabs(float x) Calculates the absolute value of x
Math Functions
Example
The following example shows how to create a custom measurement that is based on the values from
other measurements. The example calculates the 3-Dimensional Euclidean distance between the center
of a hole and the center of the base of a nearby stud, then checks decision limits on this metric before
sending the output.
/* Calculate the 3-Dimensional Euclidean distance between two points in 3D space*/
/* Retrieve 3D coordinate from Hole X, Y and Z tools (assumes these tools have been
configured as ID 0, ID 1 and ID 2 respectively) */
double HoleX = Measurement_Value(0);
double HoleY = Measurement_Value(1);