# Reference: Solver Variable

Command ElementModifies a variable element.

## Format

<Reference_Variable
id                  = "integer"
{   type                = "EXPRESSION"
expr                = "motionsolve_expression"
| USERSUB
usrsub_dll_name     = "valid_path_name"
usrsub_param_string = "USER( [[par_1[,...][,par_n]])" } >
</Reference_Variable>

## Attributes

id
Element identification number (integer>0). This number is unique among all Reference_Variable elements.
type
Select from EXPRESSION and USERSUB. Specifies how the variable expression is defined.
The EXPRESSION option specifies that the value of the Reference_Variable is a MotionSolve expression that can be evaluated at run-time. The USERSUB option indicates that the value of the event is specified in a user defined subroutine, VARSUB. The parameters "usrsub_param_string" and "usrsub_dll_name" are used to provide more information about the user defined subroutine.
expr
Specifies a MotionSolve expression that defines the Reference_Variable. Use this parameter only when type = EXPRESSION. Any valid run-time MotionSolve expression can be provided as input.
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 VARSUB in the DLL at run time. Use this keyword only when type = USERSUB is selected.
usrsub_param_string
The list of parameters that are passed from the data file to the user defined VARSUB. Use this keyword only when type = USERSUB is selected.

## Example

<Reference_Variable
id                  = "30700800"
type                = "EXPRESSION"
expr                = "sqrt(VX(30301011)**2+VY(30301011)**2)">
</Reference_Variable>
<Reference_Variable
id                  = "30100100"
type                = "USERSUB"
usrsub_param_string = "USER(30102031,30101020,0.01,1)"
usrsub_dll_name     = "NULL">
</Reference_Variable>