Posts: 327
Threads: 126
Joined: May 2020
Reputation:
0
Hi
the variable used inside the script is GLOBAL ?
is possible use ALM1 in script 1 and ALM1 in script 2
when i try to make some sum I have this error
attempt to perform arithmetic on global 'ALM1' (a nil value)
But I make an addiction ALM1+ALM2 , if possible I have ALM1=0 and ALM2 =0
Thank's in adavantage
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
Variables in script are local. To use values between scripts you can use object or save data to storage.
------------------------------
Ctrl+F5
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
19.03.2022, 07:44
(This post was last modified: 19.03.2022, 07:48 by Erwin van der Zwart.)
Difference is that objects can only hold a single value, storage can hold tables so depending on your task you might need to use storage.
From performance you need to use virtual objects otherwise the values are processed for sending to the KNX interfaces and that uses recourses.
I think storage or virtual objects are using the same amount of resources but admin might correct me ?
The biggest difference is that you can see the objects and the values in the objects tab or even on your visu if needed, storage is only visible by using log() or the storage viewer app.
Both methods are running in RAM and are stored on SD by the save interval, so both are save to use with persistent / high speed writing.
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
Which one to use depends on the task. Objects can hold up to 250 bytes of data while storage can hold a lot more and you can put complex data like Lua tables there.
Virtual objects can be added into visualization to have some user-configurable properties (like e-mail address for reports etc) while this is not possible directly with storage.