jtaseff Posted August 28, 2017 Share Posted August 28, 2017 Hi there, We're testing out using fsave/fload instead of our implementation of something similar. Couple of questions. Is there a way to deal with csglobal variables? I tried putting this in the .tpl file: &1 csvar1 &2 csvar1 And in the .cfg file, I only get this, which won't work to reload to the correct coordinate systems: Q1024 = 10 Q1024 = 20 Additionally, is there any way to have it work with variable names? For example, if I always have it fsave a global by name, myvar1 gets stored as P1111. But if I update the project to add a new global before that, myvar1 is now in P1112, and the next fload will put the saved value into the wrong place in P1111. Link to comment Share on other sites More sharing options...
steve.milici Posted August 29, 2017 Share Posted August 29, 2017 Use the Non-Saved Setup Data Structure Elements Coord[x].Q. Link to comment Share on other sites More sharing options...
jtaseff Posted August 29, 2017 Author Share Posted August 29, 2017 Is there a way to do it by name when accessing Coord[x].Q, or a way to programatically find the Q-number of a named variable? Would much rather be able to save by name if the project changes around, instead of tracking Q numbers around by hand Link to comment Share on other sites More sharing options...
steve.milici Posted August 29, 2017 Share Posted August 29, 2017 Not at this time. We will have this in the 4.x.x.x version of the IDE. Link to comment Share on other sites More sharing options...
jtaseff Posted August 30, 2017 Author Share Posted August 30, 2017 For anyone else trying this, I did find a way around the csglobal problem: In the .tpl file, I can have it run this to output the currently addressed CS: &1 Ldata.coord csvar1 csvar2 &2 Ldata.coord csvar1 csvar2 This produces the following in the .cfg file on fsave, which seems to load things in properly on fload. Ldata.coord=1 Q1024=10 Q1025=20 Ldata.coord=2 Q1024=30 Q1025=40 Link to comment Share on other sites More sharing options...
steve.milici Posted August 30, 2017 Share Posted August 30, 2017 Yes – this is the “valid” correct mechanism to use. I was testing this yesterday as a possibility but wanted to verify with the firmware programmes that the “tpl” file will be processed in the order the command are presented (they did verify this). Link to comment Share on other sites More sharing options...
Recommended Posts