msEventShock (Structure)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, LX2

Firmware version:

1.50.00


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;
  Threshold   : FLOAT := 0.3;
  Duration    : DINT := 100;
  Latency     : DINT := 100;
  Window      : DINT := 0;
  X           : BOOL := TRUE;
  Y           : BOOL := TRUE;
  Z           : BOOL := TRUE;
  Once        : BOOL := FALSE;
END_STRUCT_BLOCK;