This function is used to draw a line in the display.
Input:
x1 : INT (1..136 for DX4, 1..190 for NX-400)
x position (column) of the start point, 1 is the leftmost
y1 : INT (1..32 for DX4, 1..99 for NX-400)
y position (row) of the start point, 1 is the topmost
x2 : INT (1..136 for DX4, 1..190 for NX-400)
x position (column) of the end point, 1 is the leftmost
y2 : INT (1..32 for DX4, 1..99 for NX-400)
y position (row) of the end point, 1 is the topmost
color : INT (Default 1)
0 (zero)
|
- Background (OFF).
|
1
|
- Black (ON).
|
Returns:
None.
Declaration:
FUNCTION displayLine;
VAR_INPUT
x1 : INT;
y1 : INT;
x2 : INT;
y2 : INT;
color : INT := 1;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM example;
VAR
sym1 : ARRAY[1..22] OF SINT := 16#1F, 16#00, 16#20, 16#80, 16#40, 16#40, 16#80, 16#20, 16#80, 16#20, 16#80, 16#20, 16#80, 16#20, 16#80, 16#20, 16#40, 16#40, 16#20, 16#80, 16#1F, 16#00;
sym2 : ARRAY[1..22] OF SINT := 16#1F, 16#00, 16#24, 16#80, 16#44, 16#40, 16#84, 16#20, 16#84, 16#20, 16#FF, 16#E0, 16#84, 16#20, 16#84, 16#20, 16#44, 16#40, 16#24, 16#80, 16#1F, 16#00;
sym3 : ARRAY[1..22] OF SINT := 16#1F, 16#00, 16#20, 16#80, 16#60, 16#C0, 16#91, 16#20, 16#8A, 16#20, 16#84, 16#20, 16#8A, 16#20, 16#91, 16#20, 16#60, 16#C0, 16#20, 16#80, 16#1F, 16#00;
END_VAR;
displayPower(power := ON);
displayDefineChar(index := 0, map := "0000180C6666060666660C1800000000");
displayCircle(x := 8, y := 8, rad := 5);
displayLine(x1 := 8, y1 := 3, x2 := 8, y2 := 13);
displayLine(x1 := 3, y1 := 8, x2 := 13, y2 := 8);
displayImage(x := 3, y := 19, width := 11, height := 11, data := ADDR(sym3));
displayXY(x := 3, y := 1);
displayString(message := "Hello World $80");
displayXY(x := 3, y := 2);
displayString(message := "Cookie: ");
displayXY(x := 11, y := 2);
displayNumber(number := 4711);
displayBox(x1 := 1, y1 := 1, x2 := 125, y2 := 31);
BEGIN
...
END;
END_PROGRAM;
|