Reference: String

Model ElementReference_String defines a user defined text string in MotionSolve. The string may be of any length. It must contain only printable ASCII characters.


Reference_String is primarily used within user defined subroutines. They are commonly used to pass filenames, messages, block names and DLL names to user defined subroutines.

Within a user defined subroutine, the MotionSolve utility subroutine GTSTRG is used to access the Reference_String. The ID of the Reference_String itself may be passed as a parameter to the user defined subroutine.


  id                  = "ID Number"
  label               = "Name of the string"
  string              = "The string itself" >
  usrsub_dll_name     = valid_path_name
  usrsub_param_string = "USER([[par_1[,...][,par_n]])"
  usrsub_fnc_name     = "custom_fnc_name" >
  script_name         = valid_path_name
  interpreter         = "PYTHON" | "MATLAB"
  usrsub_param_string = "USER([[par_1[,...][,par_n]])
  usrsub_fnc_name     = "custom_fnc_name" >


Element identification number (integer>0). This number is unique among all Reference_String elements.
The name of the Reference_String element.
Specifies the character string to be stored.
Specifies the path and name of the DLL or shared library containing a user subroutine. MotionSolve uses this information to load the user subroutine in the DLL at run time.
The list of parameters that are passed from the data file to the user defined subroutine, String_Read. This attribute is common to all types of user subroutines and scripts.
Specifies an alternative name for the user subroutine String_Read.
Specifies the path and name of the user written script that contains the routine specified by usrsub_fnc_name.
Specifies the interpreted language that the user script is written in. Valid choices are MATLAB or PYTHON.


The example below demonstrates how a Reference_String can be used to define a filename that can be passed to a VARSUB. Notice how the ID of the Reference_String is passed as a parameter to the user defined VARSUB. This generalizes the implementation of the VARSUB.

   id                  = "1101"
   label               = "Name of string"
   string              = "/staff/gates/test/tire_data.xml" >


Reference_Strings may be used in any user defined subroutine.