Programming a message

#MSG [<mode>] [<receiver>] ["<message_text>"]

<mode>

The mode defines the time of the message output. If the message is to be output synchronously with the processing state in the interpolator, the SYN or SYN_ACK mode must be specified. If no mode or ACK is specified, the message is output immediately after decoding.

Mode

Time of message output

SYN

Synchronous with processing state in interpolator

SYN_ACK

Synchronous with processing state in interpolator with acknowledgement by the receiver (e.g. SPS). Processing is only continued in the interpolator after the acknowledgement is received.

---

Immediately after decoding (default).

ACK

Immediately after decoding with acknowledgement by the receiver (e.g. SPS). Decoding is only continued after the acknowledgement is received.

<receiver>

The receiver of the message is specified by its communication device ID.

Receiver ID

Description

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

Attention

attention

Messages must be read by the corresponding receiver, otherwise the CNC stops after sending 10 messages.

<message_text>

The message text must be enclosed in quotation marks "...".

Programing Example

prg_example

Programming a message

#MSG HMI ["Text_1"]

#MSG SYN HMI ["Text_2"]

#MSG ["Text_3"]

#MSG SYN ["Text_4"]

#MSG SYN_ACK ["Text_5"]

Text_1 is sent immediately after decoding to the system-specific user interface; the Text_2 string is sent synchronously for processing in the interpolator.

Text_3 is sent immediately after decoding to the default receiver; the Text_4 string is sent to the same device synchronously for processing in the interpolator.

Text_5 is also sent to the default receiver synchronously for processing in the interpolator but processing is stopped until the acknowledgement is received.

The following format elements to output numerical values and to output strings are available:

%d or %D

Output of decimal numbers with sign (signed integer)

%u or %U

Output of decimal numbers without sign (unsigned integer)

%f or %F

Output of real numbers (float)

%s or %S

Output of strings (<String>, Macros, V.E.STRING, V.STR)

Notice

notice

A maximum of 10 parameters can be output with %xx. The number of format characters must match the number of subsequent parameters.

Programing Example

prg_example

Programming a message with format elements:

         #MSG [ "Message text_%d and message text_2", 1 ]

Sent string: Message text_1 and message text_2

         #MSG [ "Current measured value: %f", V.A.MEAS.ACS.VALUE.X]

Sent string: Current measured 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 quotation marks.

Programing Example

prg_example

Programming a message with "%" and quotation marks:

         #MSG [ "Text with %% character"]

         #MSG [ "Text in quotation marks: \"TEXT\" "]

Sent string: Text with % character and text in quotation marks: "TEXT"

A message text may also be specified with parameters and variables.

Programing Example

prg_example

Programming 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 sends the Text_1 and Text_2 strings synchronously to processing in the interpolator to the default receiver.