# Sensor: Event

Command ElementModifies a Sensor_Event model element.

## Format

  <Sensor_Event
id                    = "integer"
{
type                = "EXPRESSION"
expr                = "motionsolve_expression"
compare             = { "GE" | "LT" | "EQ" }
value               = "real"
error_tol           = "real"
|
usrsub_dll_name     = "NULL"
usrsub_param_string = "USER([[par_1[,...][,par_n]])"
usrsub_fnc_name     = "custom_fnc_name"
compare             = { "GE" | "LT" | "EQ" }
value               = "real"
error_tol           = "real"
}
[ verbose               = { "TRUE" | "FALSE" } ]
/>

## Attributes

id
Element identification number (integer>0). This number is unique among all Sensor_Event elements.
expr
Specifies an expression that defines the sensor event. Use this parameter only when TYPE = EXPRESSION. Any valid run-time MotionSolve expression can be used.
usrsub_param_string
The list of parameters that are passed from the data file to the user defined SENSUB. Use this keyword only when TYPE = USERSUB is selected.
usrsub_dll_name
Specifies the path and name of the DLL or shared library containing the user subroutine. MotionSolve uses this information to load the user subroutine SENSUB in the DLL at run time.
usrsub_fnc_name
Specifies an alternative name for the user-written subroutine SENSUB.
compare
Defines the comparison measure.
value
The sensor event threshold. An event is said to occur when the expression or user subroutine meets the comparison criterion with respect to value.
error_tol
Defines the error tolerance for detecting an event. The sensed value is required to be within this tolerance of the threshold value, before an event is generated by the solver.
verbose
Use this attribute to control how often an action message is written to the screen and log file when a sensor is triggered.
TRUE: MotionSolve writes out information about the action triggered by the sensor at each reported time step as long as the sensor is active.
Note: Setting verbose to TRUE may cause these messages to comprise a majority of the content for the log file.
FALSE: MotionSolve writes out the information about the action triggered by the sensor only once, at the very first time the sensor is triggered.
Default is FALSE.

## Example

<Sensor_Event
id       = "100"
expr     = "MOD(AZ(22,11),PI)-PI/2"
/>