56
•
4 byte unsigned integer -
dt.uint32
— number
•
4 byte signed integer -
dt.int32
— number
•
4 byte floating point -
dt.float32
— number
•
4 byte access control -
dt.access
— number, currently not fully supported
•
14 byte ASCII string -
dt.string
— string, null characters ('\0') are discarded during
decoding
1.2.12.
Data storage function
storage
object provides persistent key-value data storage for user scripts. Only the following Lua
data types are supported:
•
boolean
•
number
•
string
•
table
storage.set(key, value)
Sets new value for the given key. Old value is overwritten. Returns boolean as the result and an
optional error string.
storage.get(key, default)
Gets value for the given key or returns default value (
nil
if not specified) if key is not found in
the data storage.
Note: all user scripts share the same data storage. Make sure that same keys are not used to store
different types of data.
Examples
•
The following examples shows the basic syntax of
storage.set
. Result will return
boolean
true
since the passed parameters are correct
result
=
storage.set
(
'my_stored_value_1'
,
12.21
)
•
This example will return
false
as the result because we are trying to store a function
which is not possible.
1.
testfn
=
function
(
t
)
2.
return
t
*
t
3.
end
4.
result
=
storage.set
(
'my_stored_value_2'
, testfn
)
-- this will result in an error
Summary of Contents for LogicMachine3 Re:actor
Page 10: ...10 Terminal connection schemes KNX TP...
Page 12: ...12 24V power supply...
Page 13: ...13 Analog inputs e g reed contact...
Page 14: ...14 Analog inputs 0 10V...
Page 15: ...15 Digital output...
Page 16: ...16 Resistive sensor input...
Page 17: ...17 Analog output...
Page 26: ...26 Make sure that bus status is Online press button in ETS...
Page 35: ...35 o Then minimize side bar by pressing on left arrow icon to make the map more visible...
Page 83: ...83 66 if err then 67 alert FTP upload failed s err 68 end...
Page 107: ...107...
Page 108: ...108 1 14 Help Documentation for scripting syntaxes is displayed in Help tab...
Page 126: ...126 Datapoints can be shown also in a way of table which can be later exported as CSV file...
Page 141: ...141...