Programming a message
#MSG [<mode>] [<receiver>] ["<message_text>"]
<mode> The mode defines the time of the message output. SYN or SYN_ACK mode must be specified if the message is to be output synchronously with the processing state in the interpolator. The message is output immediately after decoding if a mode has not been specified.
Mode | Time of the message output |
---|---|
SYN | Synchronous with processing state in interpolator |
SYN_ACK | Synchronous with processing state in interpolator with acknowledgement by the receiver (e.g. PLC). The processing in interpolator is continued if the acknowledgement is finished. |
--- | Immediately after decoding (Default) |
<receiver> The receiver of the message is specified by its communication device ID. Specifying the receiver is optional. If no receiver is programmed, the message is sent to the configurated default receiver [6].
Receiver-ID | Significance |
---|---|
ISG_DIAG_BED | Message is sent to the CNC-diagnosis interface |
HMI | Message is sent to the system specific user interface |
PLC | Message is sent to the system specific PLC |
<message_text> The message text must be enclosed in quotation marks "...".
Programming example
#MSG HMI ["Text_1"]
#MSG SYN HMI ["Text_2"]
#MSG ["Text_3"]
#MSG SYN ["Text_4"]
#MSG SYN_ACK ["Text_5"]
Immediately after decoding, Text_1
is transmitted to the system specific user interface; the Text_2
string is transmitted to the same device synchronously with processing in the interpolator.
Immediately after decoding, Text_3
is transmitted to the default receiver; Text_4
string is transmitted to the same device synchronously with processing in the interpolator.
Text_5
string is also transmitted to the same device synchronously with processing in the interpolator, but the processing is stopped until the acknowledgement is received.
For the output of numerical values and for the output of strings following format elements are available:
%doder %D | Output of decimal numbers (signed integer) |
---|---|
%uoder %U | Output of decimal numbers (unsigned integer) |
%foder %F | Output ofreal numbers (float) |
%soder %S | Output of strings (<String>, Macros, V.E.STRING) |
The number of format characters must agree with the number of the subsequent parameters.
Programming examples
Programming of a message with a format element:
#MSG [ "Message text_%d and message text_2", 1 ]
Sent string: Message text_1 and message text_2
#MSG [ "Current measurement value: %f", V.A.MESS.X]
Sent string: Current measurement value: 3.4567800000E+001
#MSG [ "Current state: %s", "End of roughing"]
Sent string: Current state: End of roughing
The control sequence "%%" must be programmed to output the "%" character. The "\" character must precede a quotation mark.
Programming of a message with "%" and quotation mark:
#MSG [ "Text with %%-character"]
#MSG [ "Text in quotation marks: \"TEXT\" "]
This example outputs the following strings:
Sent string: Text with %-character
and Text in quotation marks: "TEXT"
A message text may also be specified with parameters and variables.
Programming of a message with parameters and variables:
P10 = 1
V.P.BSP = 2
#MSG SYN ["Text_%D and Text_%D", P10, V.P.BSP]
This example transmits the Text_1and Text_2 string synchronously with the processing in the interpolator to the default receiver.