msVectorToForce (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.50.00


This function will take the applied values and calculate the total force.

Returned values are in G.

 

Input:

X : FLOAT

The acceleration force measured on the X-axis.

 

Y : FLOAT

The acceleration force measured on the Y-axis.

 

Z : FLOAT

The acceleration force measured on the Z-axis.

 

Returns: FLOAT

The total acceleration force.

 

Declaration:

FUNCTION msVectorToForce : FLOAT;
VAR_INPUT
  X    : FLOAT;
  Y    : FLOAT;
  Z    : FLOAT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
  val   : msDataSet;
  force : FLOAT;
END_VAR;
 
msOpen();
msAccEnable(enable := TRUE);
 
BEGIN
msRead(data := val);
force := msVectorToForce(x := val.AccX, y := val.AccY, z := val.AccZ);
 ...
END;
END_PROGRAM;