USRMES
Utility/Data Access SubroutineThe USRMES utility subroutine allows you to output custom messages during MotionSolve execution.
Use
This function can be called by any user-defined subroutine.
Format
- Fortran Calling Syntax
- CALL USRMES (MSGFLG, MESAGE, ID, MSGTYP)
- C/C++ Calling Syntax
- c_usrmes (msgflg, message, id, msgtyp)
- Python Calling Syntax
- py_usrmes (msgflg, message, id, msgtyp)
- MATLAB Calling Syntax
- m_usrmes (msgflg, message, id, msgtyp)
Attributes
- ID
- [integer]
- MSGFLG
- [logical]
- MESSAGE
- [character*(*)]
- MSGTYPE
- [character*(*)]
Example
The following Python script illustrates the use of the USRMES sub routine to output customized messages.
def VARSUB(id, time, par, npar, dflag, iflag):
#The user message is specified below
py_usrmes(1,"This is a padded info message",1234,"INFO")
if iflag:
py_set_discrete_interface()
ipar = []
ipar.append(int(par[1]))
[dif, errflg] = py_sysfnc("DIF", ipar)
[dif1, errflg] = py_sysfnc("DIF1", ipar)
value =0.01*dif+0.0001*dif1
return value
Using the above script, the table below illustrates the format of the user message that is written out to the log file and on-screen during the simulation.
MSGTYP | Code and Output |
---|---|
INFO |
|
USRMES:USER [1234] INFO: This is a padded info message. |
|
INFO_NOPAD |
|
INFO: This is a non-padded info message. | |
INFO_LOG |
|
USRMES:USER [1234] INFO: This is a padded info message written only to the log file. |
|
WARN |
|
USRMES:USER [1234] Warning: This is a padded warning
message. |
|
WARN_NOPAD |
|
Warning: This is a non-padded warning message.
|
|
WARN_LOG |
|
USRMES:USER [1234] Warning: This is a padded warning
message written only to the log file. |
|
ERROR |
|
USRMES:USER [1234] ERROR: This is a padded error message. |
|
ERROR_NOPAD |
|
ERROR: This is a non-padded error message. | |
FAULT |
|
USRMES:USER [1234] FAULT: This is a padded fatal error message. |
|
FAULT_NOPAD |
|
FAULT: This is a non-padded fatal error message. |