4.2 Available Rows and Components
- AnalogLookupTable (’ALT’)
- Analog Write (’AW’)
- Analog Read (’AR’)
- Digital Read (’DR’)
- Digital Write (’DW’)
- Empty Space (’ES’)
- Link Button (’LINK’)
- Manual Pulse (’MP’)
- Push Button (’PB’)
General row options - Every row is configured with common and row-specific properties. The following object represents the common part.
Name |
Type |
Description |
|
||
type |
String |
The type of the component / row (eg. ”AR”) |
alias |
alias |
UNIQUE identification of the item from control system (eg. ’SP’). Must NOT contain spaces or diacritics |
desc |
String |
Name of the component shown in the description (eg. ”Set point”). If the alias is not defined the desc is used instead. The desc is converted to lowercase, spaces are substitute with underscore and all non-ascii letters omitted or replaced with ascii equivalent. |
cstring |
String |
Connection string which contain whole path to the target device (eg. ”task.CNR:ycn”) |
disable_by |
String | Object |
If defined by ’alias’ or object {alias:"XXX", cstring:"XXX", reverse_meaning:false} the state of the component changes (enabled / disabled). |
hide_by |
String | Object |
If defined by ’alias’ or object {alias:"XXX", cstring:"XXX", reverse_meaning:false} the visibility of the row changes. |
refresh_from |
String |
If defined by ’alias’ or object {alias:"XXX", cstring:"XXX"} the value for the item is read from different location than written. It is aplicable on for WRITE components |
|
||
|
||
|
2{alias:"SP", desc:"Set point", cstring:"task.CNR:ycn", disable_by:null, hide_by:null refresh_from:null}
AnalogLookupTable (’ALT’) - Select with list of options. Used for user define enums.
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.show_key] |
boolean |
false |
Append keys to the list of options |
opt.values |
Object |
{} |
List of all values which can be selected. It is a Object with key-value pairs (e.g. {"1":"Options 1", "2":"Options 2"}) * |
|
|||
|
|||
|
Example
Analog Read (’AR’)
- Periodical reading of selected value (date,time,datetime,text,number).
date, time, datetime - Show date calculated from seconds from REX Epoch timestamp.
text- Show the value without any transformation (suitable for string values).
number - Show number transformed by scale, offset and round to number of decimals.
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.format] |
boolean |
number |
One of the following date,time,datetime,text,number |
[opt.scale] |
number |
1 |
Scale factor |
[opt.offset] |
number |
0 |
Offset for the displayed value |
[opt.decimals] |
number |
4 |
Number of decimals |
[opt.convert] |
function |
|
If defined, the format='number' value is transformed using convert function eg. convert=function(val){return val+1;} |
|
|||
|
|||
|
Example
2{type:'AR'}
3
4// Show date
5{type:'AR', format:'date'}
6
7// Show string values
8{type:'AR', format:'text'}
9
10// Convert radians to degrees
11{type:'AR', format:'number', scale:(Math.PI/180), offset=0, decimals=0}
Analog Write (’AW’)
- Set date,time,datetime,text or number to the control system.
date, time, datetime - R/W date calculated from seconds from REX Epoch timestamp
text- Write value without any transformation (suitable for string values)
number - R/W number transformed by scale, offset and rounded to number of decimals.
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.format] |
boolean |
number |
One of the following date,time,datetime,text,number |
[opt.scale] |
number |
1 |
Scale factor |
[opt.offset] |
number |
0 |
Offset for the displayed value |
[opt.min] |
number |
|
Limit the minimum value |
[opt.max] |
number |
|
Limit the maximum value |
[opt.decimals] |
number |
4 |
Number of decimals |
[opt.set_on_blur] |
boolean |
false |
If set the value is written when the input is blured. Use ESC to cancel changes |
[opt.convert] |
function |
|
If defined, the format='number' value is transformed using convert function eg. convert=function(val){return val+1;} |
[opt.convertW] |
function |
|
If defined, the format='number' value is transformed before write by convert function eg. convertW=function(val){return val+1;} |
|
|||
|
|||
|
Example
2{type:'AW'}
3
4// Set date
5{type:'AW', format:'date'}
6
7// Set string values
8{type:'AW', format:'text'}
9
10// Display degrees, read and write as radians
11{type:'AW', format:'number', scale:(Math.PI/180), offset=0, decimals=0}
12
13// Default options
14{type:'AW', format:'number',
15scale:1, offset:0, min: −Number.MAX_VALUE, max: Number.MAX_VALUE,
16set_on_blur:false, convert:null, convertW:null}
Digital Read (’DR’) - Periodical reading of boolean value.
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.label_false] |
String |
”OFF” |
Label for the false / off / disable value. |
[opt.label_true] |
String |
”ON” |
Label for the true / on / enable value. |
[opt.reverse _meaning] |
boolean |
false |
If set the ’0’ (zero) means enables / ON and ’1’ disabled / OFF |
[opt.color_false] |
String |
”” |
Change color of FALSE button when active |
[opt.color_true] |
String |
”” |
Change color of TRUE button when active |
|
|||
|
|||
|
Example
2
3// All options
4{type: 'DR', label_false: 'OFF(0)', label_true: 'ON(1)', reverse_meaning:false, color_false:'', color_true:''}
Digital Write (’DW’) - Set boolean value
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.label_false] |
String |
”OFF” |
Label for the false / off / disable value. |
[opt.label_true] |
String |
”ON” |
Label for the true / on / enable value. |
[opt.reverse _meaning] |
boolean |
false |
If set the ’0’ (zero) means enables / ON and ’1’ disabled / OFF |
[opt.color_false] |
String |
”” |
Change color of FALSE button when active |
[opt.color_true] |
String |
”” |
Change color of TRUE button when active |
[opt.flip] |
boolean |
false |
If set the position of the TRUE/FALSE buttons is flipped. |
|
|||
|
|||
|
Example
2
3// All options
4{type: 'DW', label_false: 'OFF(0)', label_true: 'ON(1)', reverse_meaning:false, color_false:'', color_true:'', flip:false}
Empty Space (’ES’) - Creates empty row to fill gaps
Link Button (’LINK’) - Create link to different page
Param |
Type |
Default |
Description |
|
|||
opt |
Object |
|
LINK configuration object |
[opt.target_url] |
String |
”” |
URL to which the link leads to. |
[opt.desc] |
String |
”” |
Description of the link |
[opt.label] |
String |
”” |
Button label |
|
|||
|
|||
|
Example
Manual Pulse (’MP’) - Manual Pulse controller (for MP block)
Param |
Type |
Description |
|
||
opt |
RowOption |
General configuration for row apply |
|
||
|
||
|
Example
Push Button (’PB’) - One button for setting different values on press and release.
Param |
Type |
Default |
Description |
|
|||
opt |
RowOption |
|
General configuration for row extended with following properties |
[opt.label_false] |
String |
”OFF” |
Label for the false / off / disable value. |
[opt.label_true] |
String |
”ON” |
Label for the true / on / enable value. |
[opt.reverse _meaning] |
boolean |
false |
If set the ’0’ (zero) means enables / ON and ’1’ disabled / OFF |
[opt.color_false] |
String |
”” |
Change color of FALSE button when active |
[opt.color_true] |
String |
”” |
Change color of TRUE button when active |
[opt.value_release] |
number | String |
0 |
Set the value which should be set on release (reverse_meaning do not apply). |
[opt.value_press] |
number | String |
1 |
Set he value which should be set on press (reverse_meaning do not apply). |
|
|||
|
|||
|
Example
2{type: 'PB'}
3
4// Write float value
5{type: 'PB', value_release: 0, value_press: 0.1}
6
7// All options
8{type: 'PB', label_false: 'OFF(0)', label_true: 'ON(1)', reverse_meaning:false,
9color_false:'', color_true:'', flip:false, value_release: 0, value_press: 1}}s
[Previous] [Back to top] [Up]