mdtDefineChar (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.07 / 1.00.00


This function is used to define a character in the MDT font. This feature is not available on the MDT-100.

 

The font in the MDT-200 uses characters 11 pixels wide by 20 pixels high.

To help visualize and calculate the character map, use a table with 12 * 20 cells with each representing a pixel.

 

clip0021

(Figure 1. Empty character pixel map)

 

The 12th column (with gray background in Figure 1) is not used in the character and is only included to ease the calculations. This must be filled with 0's (zeros).

The 3 last rows (with green background in Figure 1) is below the writing line and should only be used if characters similar to "p", "g", or "q" are defined.

 

Draw the character in the table using 1's (ones, shows pixel) and 0's (zeros, hides pixel) as shown in Figure 2.

 

clip0022

(Figure 2. Sample character: copyleft)

 

Once the table is filled, calculate the 3 hex digits for each line.

The map string in the function contains the hex digits from the top-left and down.

For the sample character in Figure 2., the map string would look like this:

"0000000003F03F0618CCCD2CC2CD2CCCC6183F03F0000000000000000000".

 

Note: only uppercase characters can be used and no spacing characters can be included.

 

 

Input:                

index : INT (0..255)

The index of the character to define.

 

map : STRING

The calculated map of the character.

 

Returns: INT

0

- Success.

-1

- MDT not present or communication error.

-2

- MDT not open.

 

Declaration:

FUNCTION mdtDefineChar : INT;
VAR_INPUT
  index : INT;
  map   : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
mdtDefineChar(index:=33,map:="0000000003F03F0618CCCD2CC2CD2CCCC6183F03F0000000000000000000");
 
BEGIN
  ...
END;
END_PROGRAM;