Command Element |
|
Description |
|
Modifies 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" /> |
Command Element |
|
Description |
|
Modifies a SENSOR model element. |
|
Declaration |
|
def SENSOR(id, LABEL="", FUNCTION="", VALUE=0.0, ERROR=0.0, OPERATOR="", ROUTINE="", INTERPRETER="", SCRIPT=""): |
|
Attributes |
|
id |
Element identification number (integer>0). This number is unique among all the SENSOR elements. |
LABEL |
Modifies the name of the SENSOR element. Any alphanumeric string associated with the SENSOR. |
FUNCTION |
Modifies the expression that defines the sensor event. Any valid run-time MotionSolve expression can be used. Or Modifies the list of parameters that are passed from the data file to the user defined SENSUB. |
VALUE |
Modifies 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 |
Modifies 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. |
OPERATOR |
Modifies the comparison measure. Select from GE, LT, or EQ. The comparison measures are used to detect when an event has occurred and are implemented as follows: GE: FUNCTION >= VALUE LT: FUNCTION < VALUE EQ: FUNCTION = VALUE |
ROUTINE |
Modifies the alternative name for the user subroutine SENSUB. |
INTERPRETER |
Modifies the interpreted language that the user script is written in. Valid choices are MATLAB or PYTHON. |
SCRIPT |
Modifies the path and name of the user written script that contains the routine. |
CommentsSee Sensor_Event |
|
Example |
|
The example below demonstrates how to modify a SENSOR element. SENSOR(100, FUNCTION="MOD(AZ(22,11),PI)-PI/2") |