*SetSensor()

Sets the values for a sensor.

Syntax

*SetSensor(sensor_name, EXPR|USER, `expr|user_subexpr`, 
                                             value, "LE|EQ|GE", error, 
                                             "CODGEN|NO_CODGEN", 
                                             dtval, 
                                             "HALT|NO_HALT", 
                                             "PRINT|NO_PRINT", 
                                             "RESTART|NO_RESTART", 
                                             "RETURN|NO_RETURN", 
                                             stepsize, 
                                             "YYDUMP|NO_YYDUMP", 
                                             "EVALUATE|NO_EVALUATE", 
                                             `expr|userexpr`) 
*Set(sensor_name.use_local_dll,TRUE|FALSE) 
*Set(sensor_name.local_dll,"path/filename")

Arguments

sensor_name
The variable name of the sensor.
Data type: varname
EXPR|USER
Indicates if the main expression for the sensor will be described directly by an expression or by a user subroutine.
`expr|user_sub expr`
The expression or string for the call to the user subroutine.
value
The value that the main expression will be compared against.
Data type: real
"LE|EQ|GE"
The sensor will be triggered when the value is within error, either less than, equal to, or greater than.
error
The tolerance where the main sensor expression and value have to differ within, in order for the sensor to be triggered.
Data type: real
"CODGEN|NO_CODGEN"
Causes the solver to generate a new pivot sequence if set to CODGEN.
dtval
Resets the solver printout steps to this value.
Data type: real
"HALT|NO_HALT"
Causes the solver to stop simulation if set to HALT.
"PRINT|NO_PRINT"
Causes results to be written to the output files at the time when the sensor is triggered.
"RESTART|NO_RESTART"
Causes the solver to restart if the sensor is triggered.
"RETURN|NO_RETURN"
Causes the solver to return to the command input for simulation to continue.
stepsize
Resets the stepsize to this if the sensor is triggered.
Data type: real
"YYDUMP|NO_YYDUMP"
Causes the solver to export the state variable vector.
"EVALUATE|NO_EVALUATE"
Determines if an evaluation of an expression will occur when a sensor is triggered, and if the expression is determined by a user subroutine or direct expression.
`expr|user expr`
The expression or string for the user subroutine call that defines the expression to be evaluated.
sensor_name.use_local_dll
Specifies if a user subroutine DLL is specific to the instance of one sensor entity.
Data type: boolean
sensor_name.local_dll
The path and filename for the user subroutine DLL to be used with an instance of the user defined sensor.
Data type: string

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()