Need help with high rate accel via registerSensorDataListener


Need help with registerSensorDataListener. Idea is it get high frequency acc data to analyse specific type of movements.
According to documentation it should be pretty straightforward via registerSensorDataListener. But can't get it working.
Please help! Some example will be very useful.

My code is below. It seems onSensor callback never happen.

    function setAcc() as Void{
        var options = {
            :period => 4,               
            :accelerometer => {
                :enabled => true,       // Enable the accelerometer
                :sampleRate => 25       // 25 samples
        var sHandler = method(:onSensor) as Lang.Method;
        Sensor.registerSensorDataListener(sHandler, options); 
        function onSensor(sensorData) as Void{
        mX = sensorData.accelerometerData.x;
        mY = sensorData.accelerometerData.y;
        mZ = sensorData.accelerometerData.z;