By issuing the *MSG command within a macro, you can display custom output messages via the Mechanical APDL message subroutine. The command has the following format:
*MSG,Lab,VAL1,VAL2,VAL3,VAL4,VAL5,VAL6,VAL7,VAL8
Where Lab is one of the following labels for output and
termination control:
| INFO | Writes the message with no heading (default). |
| NOTE | Writes the message with a "NOTE" heading. |
| WARN | Writes the message with a "WARNING" heading, and also writes it to the errors file, Jobname.ERR. |
| ERROR | Writes the message with an "ERROR" heading and also writes it to the errors file, Jobname.ERR. If this is a Mechanical APDL batch run, this label also terminates the run at the earliest "clean exit" point. |
| FATAL | Writes the message with a "FATAL ERROR" heading and also writes it to the errors file, Jobname.ERR. This label also terminates the Mechanical APDL run immediately. |
| UI | Writes the message with a "NOTE" heading and displays it in the message dialog box. |
VAL1 through VAL8 are numeric or alphanumeric character values to be included in the message. Values can be the results of evaluating parameters. All numeric values are assumed to be double precision.
You must specify the message format immediately after the *MSG command. The message format can contain up to 80 characters, consisting of text strings and predefined "data descriptors" between the strings where numeric or alphanumeric character data are to be inserted. These data descriptors are:
%i, for integer data. The FORTRAN nearest integer (NINT) function is used to form integers for the %I descriptor.
%g, for double precision data
%c, for alphanumeric character data
%/, for a line break
The corresponding FORTRAN data descriptors for the first three descriptors are I9, 1PG16.9, and A8 respectively. A blank must precede each descriptor. You also must supply one data descriptor for each specified value (eight maximum), in the order of the specified values.
Don't begin *MSG format lines with *IF, *ENDIF, *ELSE, or *ELSEIF. If the last non-blank character of the message format is an ampersand (&), the Mechanical APDL program reads a second line as a continuation of the format. You can use up to 10 lines (including the first) to specify the format information.
Consecutive blanks are condensed into one blank upon output, and a period is appended. The output produced can be up to 10 lines of 72 characters each (using the %/ descriptor).
The example below shows you an example of using *MSG that prints a message with two integer values and one real value:
*MSG, INFO, 4Inner4 ,25,1.2,148 Radius ( %C) = %I, Thick = %G, Length = %I
The resulting output message is as follows:
Radius (Inner) = 25, Thick = 1.2, Length = 148
Here is an example illustrating multiline displays in GUI message windows:
*MSG,UI,Vcoilrms,THTAv,Icoilrms,THTAi,Papprnt,Pelec,PF,indctnc Coil RMS voltage, RMS current, apparent pwr, actual pwr, pwr factor: %/& Vcoil = %G V (electrical angle = %G DEG) %/& Icoil = %G A (electrical angle = %G DEG) %/& APPARENT POWER = %G W %/& ACTUAL POWER = %G W %/& Power factor: %G %/& Inductance = %G %/& VALUES ARE FOR ENTIRE COIL (NOT JUST THE MODELED SECTOR)
Note: The command /UIS,MSGPOP controls which messages a message dialog box displays when the GUI is active. See the Command Reference for more information about this command.