guiGraphSetBar (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function sets the value of an entry in the bar graph.

 

Input:

graph : SYSHANDLE

The handle to the graph to set the bar on.

 

x : INT (-1,1..240) default -1

The position to the entry to set the value for. When set to -1, it is put in the buffer, ready to be appended when calling guiGraphScrollNext, otherwise it is set directly on the graph. The maximum value is x_count from guiGraphCreate.

 

y : INT default 0

The value to set the bar to. If the value is outside the valid range of the graph, it will be truncated.

 

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-3

- Invalid argument.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiGraphSetBar : INT;
VAR_INPUT
  graph : SYSHANDLE;
  x     : INT := -1;
  y     : INT := 0;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  graph  : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Set the value of bar 1 to -3
  rc := guiGraphSetBar(graph := graph, x:=1, y:=-3);
  // Set the value of bar 2 to 5
  rc := guiGraphSetBar(graph := graph, x:=2, y:=5);
  ...
END;
END_PROGRAM;