msClose (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.36.00


Closes the Motion Sensor interface, switching off the various sensors and clearing the possible wake-up sources.

 

 

Returns: INT

1


- Success.

0


- This function is not supported.

-1


- Interface is not open. Call msOpen first.

-2


- Generic error.

 

Declaration:

FUNCTION msClose : INT;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
   wk    : DINT;
END_VAR;
// Open Motion Sensor interface
msOpen();
// Enable wake on vibration with high sensitivity
msVibrationSetWakeup(sensitivity := 80enable := ON);
// Sleep 600 seconds or wake on vibration detection
wk := pmSuspend(time:=600mode := 0);
...
// Close Motion Sensor interface
msClose();
BEGIN
   ...
END;
END_PROGRAM;