The Write command writes text on the display window.
The appearance of the text (colour, font size and font name) can be set with the Use command.
Coordinates are specified as a pair of numbers separated by a comma. The first number, X, is the horizontal offset in pixels from the origin, while the second number, Y, is the vertical offset in pixels from the origin.
The drawing below shows the display window’s coordinate system. At the centre is the origin, where X and Y are both 0.
The maximum and minimum values of X and Y at which text written will be visible will depend on your PC monitor’s screen resolution, but writing text at off-screen coordinates is allowed.
The Write command can write text, numbers stored in variables, or any combination of the two, as shown in this example:
Let JibPosition = 25
Let HookPosition = 3
Write "Crane Status" At 20, 20
Write "Jib position: " JibPosition "%" At 20, -20
Write "Hook position: " HookPosition "%" At 20, -40
You can also refer to coordinates stored in previously defined variables:
Write "Hello World!" At X, Y
You should always enclose text in double quotes ( " ), otherwise MECControl will think it is a variable.
Text can be centred on its coodinates by adding the Centred command, as shown in this example:
Write "Hello World!" Centred At 0, -50