mdtWrite (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.02 / 1.00.00


This function writes a text message on the display at the current write position.

If a text message tries to print past the display limits, the remaining text is ignored and the current write position remains at the end of the line.

 

It is possible to add certain attributes to the text printed in the display by using the following control sequences:

 


\H

Starts highlighted text.


\h

Stops highlighted text.


\U

Starts underlined text.


\u

Stops underlined text.


\BL1

Starts blink mode 1 (the text alternates between visible and hidden).


\bl1

Stops blink mode 1.


\BL2

Starts blink mode 2 (the text alternates between normal and highlighted).


\bl2

Stops blink mode 2.

 

Once the text attribute is started, all text printed will be affected until it is stopped.

 

 

Note:

If the string passed to mdtWrite contains the "$" character, it must be duplicated ("$$") to avoid interference with the low-level communication protocol used between the RTCU and MDT. Please further observe the restrictions when using the "$" characters in strings.

Failing to observe these precautions may result in the write operation failing.

 

 

Input:                

message : STRING

Text string to print.

 

Returns: INT

0

- Success.

-1

- MDT not present or communication error.

-2

- MDT not open.

 

Declaration:

FUNCTION mdtWrite : INT;
VAR_INPUT
  message : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc : INT;
END_VAR;
 
BEGIN
  ...
  // Write test
  mdtGotoXY(x := 5, y := 2);
  mdtWrite(message := "Highlight \Htest\h text");
  mdtGotoXY(x := 5, y := 4);
  mdtWrite(message := "Underline \Utest\u text");
  mdtGotoXY(x := 5, y := 6);
  mdtWrite(message := "Blink 1   \BL1test\bl1 text");
  mdtGotoXY(x := 5, y := 8);
  rc := mdtWrite(message := "Blink 2   \BL2test\bl2 text");
  ...
END;
END_PROGRAM;