Radiation detector send to trigger lights
This tutorial covers the use of include() https://support.troikatronix.c...
read() is easier, it takes what ever text is in the file and stores it in memory, you can then assign it to a variable.
var myText = read("path/to/data/file.txt");
this line of code will read the file.txt file and store its contents in myText.
var objData = JSON.parse(myText);
The tutorial linked above also covers some basics of JSON, so it may be helpful in understanding what JSON.parse() does as well.
You should however limit the speed at which this file is being read (determined by how the code is constructed). Also, depending on how this external text file is created/written to, you may experience a file lock.
@dusx- Thank you! Right now we are reading our .text file as an array with the DataArray actor and getting excellent results. I will look at the tutorial if we decide to go this route.
Just did a quick test, and reading a txt file at 120hz (not suggested) that contained a single number.
Where I had the txt file open in a text editor and manually changed and saved the file numerous times caused 0 issues, so the file lock consideration seems minimal (and would be the same for the data array).
the code used for loading a single value in a text file called read.txt:
var i = read('read.txt');
Then the code will be run each time the pulse triggers the JS actor.