This function must be called to open the Motion Sensor interface, and is mutually exclusive to the accOpen function.
Returns: INT
1
|
- Success.
|
0
|
- This function is not supported.
|
-2
|
- Generic error.
|
-12
|
- Failed, as the 3D Accelerometer interface is open. Use accClose to close the interface.
|
-13
|
- Motion Sensor interface already open.
|
Declaration:
FUNCTION msOpen : INT;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
wk : DINT;
END_VAR;
msOpen();
msVibrationSetWakeup(sensitivity := 80, enable := ON);
wk := pmSuspend(time:=600, mode := 0);
...
msClose();
BEGIN
...
END;
END_PROGRAM;
|