Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

%HI_SetGraphData and %HI_AddGraphData functions


Old name
%HI_SetDiagramData
Function
The function %HI_SetGraphData sets the data to display in the displayer of Graph type (Control function).

The function %HI_AddGraphData adds data into a specific graphic flow.

Declaration


Blok kódu
languageesl
themeConfluence
%HI_SetGraphData(
   INT in refId, 
   INT in index, 
       in refToCol[, 
   INT in step := 0,
   BOOL in bStart := @TRUE,
   INT in bStart useAxisNr := 0]
 ) 
 
 
 


Blok kódu
languageesl
themeConfluence
%HI_AddGraphData(
   INT in refId,
   INT in index,
       in refToCol[,
   INT in step := 0]
 )
Parameters


refIdReference to graphic object (reference variable).
indexSerial number of the graphic flow.
refToColReference to column of local variable of RECORD type.
stepOptional parameter.
bStartUnused parameter.
useAxisNrAk je hodnota uvedená a väčšia ako 0, priebehu bude priradená existujúca os v grafe. Ak hodnota nie je uvedená alebo je 0, os priradená k priebehu sa nezmení.
Description

The graph must be placed in the picture, where the parameter refId is the reference variable of the graph. The parameter RefToCol is the reference to the structure column (item), that includes the data to display. Individual values in the structure column are forming a value array. Each of the values contains a timestamp used to display in the graph. These timestamps must be arranged upwardly.
The parameter step determines, whether the data in the graph considers to be periodical (value is defined in the time written in its timestamp). If the value of the parameter step=0, the values are displayed as non-periodical (change values).
The parameter bStart_Int is not used.

Data fulfilment can be used only for the graphic flows with defined alternate object - "*".


The function %HI_SetGraphData (unlike the %HI_AddGraphData function) deletes all the values of the flow first and then inserts the new ones.


Example
The following example reads values in last 10 minutes from the archive and displays them in the graph.
 


Blok kódu
languageesl
themeRDark
ENTRY sendData_OnClick
   INT  _retCode
   TIME _BT
   TIME _ET
 
   RECORD (SD.ArchVal) _data
 
   _ET := SysTime
   _BT := %SubTime(_ET, 10*60)
 
   GETARCHARR H.Sec, _data^Value, _data^Flags, _BT, _ET, 0, 1000, _retCode
 
   %HI_SetGraphData(_graf, 2, _data^Value)
   %HI_SetGraphInfo(_graf, 2, "Number of values = " + %IToStr(_data\DIM))
 
 END sendData_OnClick