Environment variables transfer information between the client (Spock) and the MacroServer. Once an environment variable is defined it remains valid for the next Spock sessions.
An environment variable is set with the senv command:
p09/door/exp.01 [2]: senv ScanFile "FirstTest.fio" ScanFile = FirstTest.fio
The command lsenv lists all available environment variables:
p09/door/exp.01 [1]: lsenv Name Value Type --------------------- ---------------------------------------------------------------------------------- ------ ScanID 279 int ScanFile FirstTest.fio str PreScanSnapshot [] list JsonRecorder True bool ActiveMntGrp mg1 str var 123 int DataCompressionRank 0 int ScanHistory [{'endts': 1346249829.4525681, 'title': 'ascan exp_mot65 0.0 0.1 5 0.1', ' [...] list ScanDir /home/kracht/temp str
The command usenv deletes an environment variable:
p09/door/exp.01 [4]: senv var 123 var = 123 p09/door/exp.01 [5]: usenv var Success!
Here is the complete list of commands related to environment variables:
p09/door/exp.01 [16]: senv scalarVar 12 scalarVar = 12 p09/door/exp.01 [17]: senv listVar "[ 1, 'a']" listVar = [1, 'a'] p09/door/exp.01 [18]: senv dictVar {\"position\":2.2,\"comment\":\"It works\",\"mylist\":[1,2,4,5]} dictVar = {'comment': 'It, works', 'position': 2.2, 'mylist': [1, 2, 4, 5]}
Section 13.3.4 explains how they are used in a macro.
lsenv Scan.*
Lists all environment variables beginning with 'Scan'.