5.3 Reference Guide for REX.HMI.Graph

Time-based graph component which is shown on the bottom of the web page. Graph can read arbitrary signal connected via alias and cstring or all signals from TRND* blocks. The Graph is shown when first signal is added over addSignal or addTrend function.

The REX.HMI.Graph has following functions:

REX.HMI.Graph.resume() Resume redrawing the graph

Example

1REX.HMI.Graph.resume()

REX.HMI.Graph.pause() Pause redrawing the graph

Example

1REX.HMI.Graph.pause()

REX.HMI.Graph.show() Show graph

Example

1REX.HMI.Graph.show()

REX.HMI.Graph.hide() Hide graph

Example

1REX.HMI.Graph.hide()

REX.HMI.Graph.addSignal(opt) Add arbitrary signal from the REX executive to the trend. Warning! The data are stored inside the web page once refreshed all the data will be lost.

Param

Type

Description

opt

Object

Main configuration object

opt.alias

string

Alias for the connection

[opt.cstring]

string

Connection string of the signal from REX

[opt.desc]

Array. <string>

Signal’s description

[opt.period]

number

Signal refresh period [ms]

Example

1REX.HMI.Graph.addSignal({alias:"Signal-1", cstring:"task.CNR:ycn", desc:"Set point", period:500});

REX.HMI.Graph.addTrend(opt) Add signals from TRND* blocks to the common graph in HMI

Param

Type

Description

opt

Object

Main configuration object

opt.cstring

string

Connection string for TRND* block

[opt.labels]

Array. <string>

Array of signal labels

[opt.period]

number

Graph redraw period

Example

1REX.HMI.Graph.addTrend({cstring:"task.TRND", labels:["signal-1","signal-2"], period:500});

REX.HMI.Graph.setSize(size) Change size of the graph. The size is in percent of the page.

Param

Type

Default

Description

size

number

0.39

Size of the graph in percents <0;1>

Example

1REX.HMI.Graph.setSize(0.39); // Default

REX.HMI.Graph.setRefreshRate(period) Change refresh rate of all signals and trends.

Param

Description

period

Refresh period [ms]

Example

1REX.HMI.Graph.setRefreshRate(250);

REX.HMI.Graph.hideLegend() Hide legend of the graph

Example

1REX.HMI.Graph.hideLegend();