Logic Machine Forum
JV access to Storage - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: JV access to Storage (/showthread.php?tid=200)



JV access to Storage - Pawel - 17.01.2016

Hi, 
I know that you are working at simpler using js in visualization. Unfortunately I use HL instead of LM, so that update isn't for me. 

So i have a question: how to get access to variable storage memory, saved by lua script command storage.get/storage.set.

I found that you have some command, storage, but p.storage.get didn't get any data from variable saved by lua. any suggestions? I want to save data from visualization dynamically.


RE: JV access to Storage - admin - 18.01.2016

Current stable version does not provide any method of getting storage variables from JavaScript, it's not even sent in any way.


RE: JV access to Storage - Pawel - 18.01.2016

maybe You have some idea how to save variable containing table, from js, of course on HomeLYnk.


RE: JV access to Storage - admin - 18.01.2016

Another approach is to use "255 byte string" object data type, should be enough in most cases.


RE: JV access to Storage - Sandstrand - 20.01.2016

@admin

Would it be possible to use os.execute('echo %s >> /home/ftp/myfile.txt', mystring) to do this and then parse myfile?
With os commands you can also access the variables in the following location:  /var/gs-storage/nameofmyvariable

Have this script run every minute, then create a file on user ftp space. On some action parse it and show in a iframe or something.


RE: JV access to Storage - Pawel - 20.01.2016

writing file to LM/HL can be done easily by:


Code:
io.writefile(filename, text_of_file)
or read:



Code:
local f = assert(io.open(filename, "r"))
local t = f:read("*all")


but how write/read this file from javascript?

ps. great idea Sandstrand Smile