msEventShock (Structure) |
Top Previous Next |
Structure to configure detection of shock events. Used with msEventRegister,
A shock is defined as the measured acceleration exceeding a threshold and returning below the threshold before the duration limit expires. A double shock is defined as two shocks detected after each other where the second shock must start within a time window after the first has ended.
If a shock (or double shock) is detected, a shock event is raised. Use msWaitEvent and msReadEvent to receive the events.
Note: The threshold should be below the full scale resolution set with msAccEnable.
Fields: Threshold : FLOAT [0.0 .. 16.0] (default 0.3) The acceleration which each axis is compared against to detect the start and end of a shock (in mg).
Duration : DINT [1..5120] (default 100) The time in milliseconds before which the end of a shock must occur.
Latency : DINT [0..10240] (default 100) Number of milliseconds where shocks are ignored.
Window : DINT [0..10240] (default 0) For double shock detection. Number of milliseconds before the second shock must occur. Set to zero (0) for single shock detection.
X : BOOL (default TRUE) Detects shocks on x-axis.
Y : BOOL (default TRUE) Detects shocks on y-axis.
Z : BOOL (default TRUE) Detects shocks on z-axis.
Once : BOOL (default FALSE) If TRUE, only one event will occur based on this configuration.
Declaration: STRUCT_BLOCK msEventShock; |