accVectorToForce (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

CX1, SX1, MX2 turbo/encore/warp, NX-200, NX-900, LX2, LX5

Firmware version:

2.40 / 1.40.00


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

Returned values are in mg.

 

Input:

x : DINT

The acceleration force measured on the X-axis (mg).

 

y : DINT

The acceleration force measured on the Y-axis (mg).

 

z : DINT

The acceleration force measured on the Z-axis (mg).

 

Output:

None

 

Returns: DINT

>=0

-

The total acceleration force (in mg).

 

Declaration:

FUNCTION accVectorToForce : DINT;
VAR_INPUT
  X : DINT;
  Y : DINT;
  Z : DINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
  x,y,z : DINT;
  force : DINT;
END_VAR;
accOpen();
BEGIN
accVector(x := x, y := y, z := z);
force := accVectorToForce(x := x, y := y, z := z);
 ...
END;
END_PROGRAM;