User Tools

Site Tools


xmlscripting-en

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
xmlscripting-en [2019/05/12 10:17] – [clock] rjversluisxmlscripting-en [2024/02/15 10:43] (current) – [Commands] rjversluis
Line 1: Line 1:
-====== XML Scripting ======+====== XMLScript ======
 [[:english#objects|{{  :objects.png}}]][[:english|{{  :rocrail-logo-35.png}}]] [[:english#objects|{{  :objects.png}}]][[:english|{{  :rocrail-logo-35.png}}]]
 [[:english|Content]] -> [[:english#objects|Objects]] ->   [[timed-actions-en|Actions]] [[:english|Content]] -> [[:english#objects|Objects]] ->   [[timed-actions-en|Actions]]
-  * [[:actions-en|Action Setup]] | [[:actionctrl-en|Action Control]] | [[:actionctrl-en#system-actions|System Actions]] | [[:actioncond-en|Action Condition]] | **[[:xmlscripting-en|XML Scripting]]** | [[action-example-en|Example]] +  * [[:actions-en|Action Setup]] | [[:actionctrl-en|Action Control]] | [[:actionctrl-en#system-actions|System Actions]] | [[:actioncond-en|Action Condition]] | **[[:xmlscripting-en|XMLScript]]** | [[action-example-en|Example]] 
-    * [[:xmlscripting:course-en|Quick Start Guide XML Scripting]]+    * [[:xmlscripting:course-en|Quick Start Guide XMLScript]]
     * [[:text-en#variables|Text variables]]     * [[:text-en#variables|Text variables]]
     * Examples:     * Examples:
-      * [[:xmlscripting:xmldb-en|General]] | [[:micha68:virtualfbscript-en|Virtual Sensors]] | [[:micha68:extkeyboardscript-en|External keyboard]]  | [[:micha68:ampelscript-de|Traffic light (DE)]] | [[:users:nice2have:shuntingexample-de|Shunting (DE)]]+      * [[:xmlscripting:xmldb-en|General]] | [[:userpages:micha68:virtualfbscript-en|Virtual Sensors]] | [[:userpages:micha68:extkeyboardscript-en|External keyboard]]  | [[:userpages:micha68:ampelscript-de|Traffic light (DE)]] | [[:userpages:nice2have:shuntingexample-de|Shunting (DE)]] 
 + 
 + 
 +| [[:supportkey-en|{{:icons:key.png}}]] //XMLScript can only be used if a valid __**[[:supportkey-en|Support Key]]**__ is provided.// |
  
- \\ 
 {{:xmlscripting.png}}\\ {{:xmlscripting.png}}\\
 +^  NOT FOR NOVICE USERS !!!  ^ 
 +=====Warning=====
 +  - Do not replace standard Rocrail functions with XMLScript.
 +  - Do not try to mangle the automatic Rocrail engine.
 +  - The scripts are executed asynchrone, and needs multithreading programming know how.
 +  - If encountering unexpected behaviour: Turn off XMLScript actions.
 +  - If uncertain: Do not use XMLScript, or ask for help in the __**[[https://forum.rocrail.net/viewforum.php?f=112|Forum]]**__.
 +  - Do not use the same variables in multiple XMLScripts, which will be set to new values, to avoid unexpected results including Server crashes.
  
- \\ 
  
 +__**[[start#rocrail_-_disclaimer|D I S C L A I M E R]]**__\\
 +
 +
 + \\
 =====Introduction===== =====Introduction=====
-XML scripting can be used in combination with __**[[:actions-en#types_commands_parameters|run ext. program]]**__ action.\\+:!: Check basic Rocrail functionality before inventing the wheel again with XMLScript.\\ 
 + 
 +XMLScript can be used in combination with __**[[:actions-en#types_commands_parameters|run ext. program]]**__ action.\\
 Its primary goal is to simplify and to reduce the number of actions and conditions.\\ Its primary goal is to simplify and to reduce the number of actions and conditions.\\
-The XML used for the scripting is the same as used in the __**[[https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__.\\+The XML used for XMLScript is the same as used in the __**[[https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__.\\
  
  \\  \\
Line 28: Line 43:
  
 =====Recommendation===== =====Recommendation=====
-  * Keep the XmlScripts short and without long sleeps and long loops; It will block the calling object from processing events and commands if it is not defined as __**[[:actions-en#definition|Asynchrone]]**__.+  * Keep the XMLScript short and without long sleeps and long loops; It will block the calling object from processing events and commands if it is not defined as __**[[:actions-en#definition|Asynchrone]]**__.
   * Do not try to outsmart the automatic mode; Post a feature request in the forum instead if something basic is missing.   * Do not try to outsmart the automatic mode; Post a feature request in the forum instead if something basic is missing.
   * Object IDs with blanks are not supported; Use underscores instead.   * Object IDs with blanks are not supported; Use underscores instead.
Line 38: Line 53:
 //Blanks in path or filename are not supported!//\\ //Blanks in path or filename are not supported!//\\
  
-  - Create a XmlScript and save it in a file. (See: __**[[#simple_example|Simple Example]]**__)+  - Create a XMLScript and save it in a file. (See: __**[[#simple_example|Simple Example]]**__)
   - Create a "run ext. program" action.   - Create a "run ext. program" action.
-  - Select the XmlScript file. (If the script file is in the workspace directory a path is not necessary.)+  - Select the XMLScript file. (If the script file is in the workspace directory a path is not necessary.)
   - Ready to use this action on any Rocrail object.   - Ready to use this action on any Rocrail object.
 {{:xmlscript:xmlscript-action-en.png}}\\ {{:xmlscript:xmlscript-action-en.png}}\\
Line 56: Line 71:
  \\  \\
 =====Edit on the Server===== =====Edit on the Server=====
-To create and edit XmlScripts on the Server the Action Dialog can be used:\\+To create and edit an XMLScript on the Server the Action Dialog can be used:\\
 | {{:xmlscript:xmlscript-edit-en.png?400}} | {{:xmlscript:xmlscript-edit-error-en.png?400}} |  | {{:xmlscript:xmlscript-edit-en.png?400}} | {{:xmlscript:xmlscript-edit-error-en.png?400}} | 
 |  Open the editor.  |  Parser error detected after validate or save.  | \\ |  Open the editor.  |  Parser error detected after validate or save.  | \\
-If the XmlScript does not already exist on the Server a XmlScript skeleton will be created:\\+If the XMLScript does not already exist on the Server a XMLScript skeleton will be created:\\
 <code xml> <code xml>
 <?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
Line 66: Line 81:
 </xmlscript> </xmlscript>
 </code> </code>
-> The XmlScript editor can also be opened by a double click on the Index.+> The XMLScript editor can also be opened by a double click on the Index.
 \\ \\
 If "<xmlscript>" is amended with the description "<desc="xxx">" (e. g. script name), the description will be displayed in the trace. E. g.  If "<xmlscript>" is amended with the description "<desc="xxx">" (e. g. script name), the description will be displayed in the trace. E. g. 
Line 97: Line 112:
 %% %%
  \\  \\
-__**This will make the XmlScript invalid.**__ \\+__**This will make the XMLScript invalid.**__ \\
  
  
 + \\
 +=====Calling Parameters=====
 +Calling parameters can be accessed by variables with the naming of "%param1%...%paramN%".\\
 +See: __**[[:actionctrl-en#parameter|ActionControl Parameter]]**__ \\
 +Snippet:
 +<code xml>
 +<xmlscript>
 +  <if condition="%frombkid% # %param1%">
 +    <then>
 +    </then>
 +  </if>
 +</xmlscript>
 +</code>
  
  \\  \\
Line 161: Line 189:
 </xmlscript> </xmlscript>
 </code> </code>
-If the while loop is endless it will be stopped by the max attribute which is default 100.\\+If the while loop is endless it will be stopped by the max attribute which is default 10.\\ 
 +Higher max values than 100 will be truncated to 100 to avoid server blocking and crashing automatically running locomotives.\\
  
  
Line 228: Line 257:
 </code> </code>
  
 +// Multiple case values are deprecated, and are strongly discourage to use.//\\
 A case may have multiple integer values in the following format:\\ A case may have multiple integer values in the following format:\\
 <code xml> <code xml>
Line 255: Line 285:
 Call the function with the wanted ID: ''<call id="doeIets"/>''\\ Call the function with the wanted ID: ''<call id="doeIets"/>''\\
 Multiple functions are allowed.\\  Multiple functions are allowed.\\ 
 +Parameters can be accessed by %subparam1%...%subparamN%.\\
 +
 <code xml> <code xml>
 <xmlscript> <xmlscript>
Line 267: Line 299:
     <default>     <default>
       <sys cmd="stop"/>       <sys cmd="stop"/>
-      <call id="doeIets"/>+      <call id="doeIets" param="test1,test2"/>
     </default>     </default>
   </switch>   </switch>
Line 278: Line 310:
  
 ====exit==== ====exit====
-Exit the XmlScript. The cmt="reason" can be used for tracing\\+Exit the XMLScript. The cmt="reason" can be used for tracing\\
 <code xml> <code xml>
 <xmlscript> <xmlscript>
Line 291: Line 323:
  \\  \\
 ====break==== ====break====
-Ends a foreach loop with or without condition. The cmt="reason" can be used for tracing.\\+Ends a foreach and while loop with or without condition. The cmt="reason" can be used for tracing.\\
 This statement has no effect if its not within a foreach loop.\\ This statement has no effect if its not within a foreach loop.\\
 <code xml> <code xml>
Line 307: Line 339:
  \\  \\
 ====trace==== ====trace====
-XmlScript traces will be in green color in Rocview.+XMLScript traces will be in green color in Rocview.
 <code xml> <code xml>
 <xmlscript> <xmlscript>
Line 334: Line 366:
  
 ====sub==== ====sub====
-Call another XmlScript with file="script.xml" and function id="functionName"\\+Call another XMLScript with file="script.xml" and function id="functionName"\\
 <code xml> <code xml>
 <xmlscript> <xmlscript>
-  <sub file="lib1.xml" id="doeIets"/>+  <sub file="lib1.xml" id="doeIets" param="test1,test2"/>
 </xmlscript> </xmlscript>
 </code> </code>
 If the function ID is set to underscore, id="_", then the whole XMLScript will be executed excluding function definitions.((12.545+))\\ If the function ID is set to underscore, id="_", then the whole XMLScript will be executed excluding function definitions.((12.545+))\\
 If no function ID is set the %oid% will be used to find a fitting function.\\ If no function ID is set the %oid% will be used to find a fitting function.\\
 +Parameters can be accessed by %subparam1%...%subparamN%.\\
  \\  \\
 Library example **lib1.xml**: Library example **lib1.xml**:
Line 353: Line 386:
  
  
-The function ID must be used to call functions from a XmlScript library file.\\ +The function ID must be used to call functions from a XMLScript library file.\\ 
-Most helpfull if more then one XmlScript share common functions.\\  +Most helpfull if more then one XMLScript share common functions.\\  
  \\  \\
  
 ====query==== ====query====
 With the query statement a variable can be used to get the attribute text and integer value of a certain object.\\ With the query statement a variable can be used to get the attribute text and integer value of a certain object.\\
 +A query does only provide object properties and no run time information.\\
 <code xml> <code xml>
   <query vr="var1" table="waybilllist" id="%oid%" get="cartype"/>   <query vr="var1" table="waybilllist" id="%oid%" get="cartype"/>
Line 369: Line 403:
 </code> </code>
 Instead of the subidx the subid can also be used if the sub node has an ID.\\ Instead of the subidx the subid can also be used if the sub node has an ID.\\
 +
 +| Query variables must be XMLScript unique to avoid unexpected results. :!: |
    
 ===Function example=== ===Function example===
Line 381: Line 417:
  \\  \\
 ====set==== ====set====
-With the set statement a variable can be used to set the attribute text or integer value of a certain object.\\+With the set statement a variable can be used to set the attribute text or integer value, depending of setint, of a certain object.\\
 <code xml> <code xml>
   <set vr="var1" table="waybilllist" id="%oid%" set="cartype" setint="false"/>   <set vr="var1" table="waybilllist" id="%oid%" set="cartype" setint="false"/>
Line 399: Line 435:
 </code> </code>
 three variables will be updated. three variables will be updated.
-Name ^ Value ^ Text ^+Variable name ^ Value ^ Text ^
 | modeltime | hour * 3600 + minute * 60 + seconds | hh:mm.ss | | modeltime | hour * 3600 + minute * 60 + seconds | hh:mm.ss |
 | realtime | hour * 3600 + minute * 60 + seconds | hh:mm.ss | | realtime | hour * 3600 + minute * 60 + seconds | hh:mm.ss |
 | systemtick | count of 10ms since Rocrail server start | - | | systemtick | count of 10ms since Rocrail server start | - |
 +The systemtick will overflow at 4294967295(119.3 hours) on 32bit and 18446744073709551615 on 64bit systems.\\
  
  \\  \\
- 
 =====Condition format===== =====Condition format=====
 | value | comparator | value |\\ | value | comparator | value |\\
Line 425: Line 461:
 | > | greater than number | | > | greater than number |
 | < | smaller than number | | < | smaller than number |
 +| ~ | contains text (@var_1 ~ @var_2 is true, when text of var_1 contains complete text of var_2) - since version 2.1.1010|
  
 ====alltrue==== ====alltrue====
Line 460: Line 497:
 | Sensor | fb | true, false, on, off | true = on, false = off | | Sensor | fb | true, false, on, off | true = on, false = off |
 | Output | co | on, off, active | | | Output | co | on, off, active | |
 +| Location | location | free | The 'free' state will check if the loco is allowed and if a location block is free. |
 | Block | bk | free, occupied, closed, open, reserved | | | Block | bk | free, occupied, closed, open, reserved | |
 | Turntable | tt | free, occupied, closed, open, reserved, #, pending | The # represents the current bridge position. \\ If state pending is true the bridge is moving. | | Turntable | tt | free, occupied, closed, open, reserved, #, pending | The # represents the current bridge position. \\ If state pending is true the bridge is moving. |
Line 465: Line 503:
 | System | sys | go, stop | | | System | sys | go, stop | |
 | Automode | auto | on, off | | | Automode | auto | on, off | |
-| Locomotive | lc | fwd, rev, +, -, min, mid, cruise, max, block, "//blockID//", steam, diesel, electric, automobile, idle, wait, automatic, f0...f28, home | **block** is true if the loco is in a block \\ "**//blockID//**" is true if the loco is in a block with this "//blockID//"+| Locomotive | lc | fwd, rev, +, -, min, mid, cruise, max, block, "//blockID//", steam, diesel, electric, automobile, idle, wait, automatic, shunting, f0...f28, home, shunting, train, !train | **block** is true if the loco is in a block \\ "**//blockID//**" is true if the loco is in a block with this "//blockID//" \\ **train** is true if a train is assigned to the loco \\ **!train** is true if no train is assigned to the loco
-| Car | car | empty, loaded, maintenance, cartype, waybill, "//blockID//" | See locomotive |+| Car | car | empty, loaded, maintenance, cartype, waybill, f0...f28, "//blockID//" | See locomotive |
 | Waybill | waybill | waiting, shipping, delivered, "//destinationID//", "//originID//" |  | | Waybill | waybill | waiting, shipping, delivered, "//destinationID//", "//originID//" |  |
 +| Text | tx | on, off | In case the toggle switch option is set. |
  
 ====Class Objects==== ====Class Objects====
Line 479: Line 518:
 =====Commands===== =====Commands=====
 Note: \\ Note: \\
-  * With "**Commands All**" all the object commands specified in the  __**[[https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__ are supported.+  * With "**Commands All**" all the object commands specified in the  __**[[https://wiki.rocrail.net/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__ are supported.
   * The special implemented action commands are listed separately.   * The special implemented action commands are listed separately.
  
Line 485: Line 524:
  \\  \\
 ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^ ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^
-| Loco | lc | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#lc | | The bkid attribute can be used to get a loco ID from a block. \\ Command %%"regularreset"%% is the same as %%"softreset"%% but removes the assigned schedule too. | +| Loco | lc | All https://wiki.rocrail.net/rocrail-snapshot/rocrail/wrapper-en.html#lc | | The bkid attribute can be used to get a loco ID from a block. \\ Command %%"regularreset"%% is the same as %%"softreset"%% but removes the assigned schedule too. | 
-| Function | fn | All and fndesc, fncmd | | The fnchanged or the fndesc, function description, attribute  signals which function has been changed: f0...f28 (true/false). \\ The fncmd can be used for on/off/flip. | %%<fn id="loco1" fndesc="Horn" fncmd="flip"/>%% |+| Function | fn | All and fndesc, fncmd, group 1..7 | | The fnchanged or the fndesc, function description, attribute  signals which function has been changed: f0...f28 (true/false). \\ The fncmd can be used for on/off/flip.| %%<fn id="loco1" fndesc="Horn" fncmd="flip" group="2"/>%% \\ F1-F4 group="1" \\ F5-F8 group="2" \\ ... \\ F25-F28 group="7" |
 | Switch | sw | All | | | Switch | sw | All | |
 | Signal | sg | All | | | Signal | sg | All | |
Line 495: Line 534:
 | Sensor | fb | All, on, off, flip | | | Sensor | fb | All, on, off, flip | |
 | Route | st | go, lock, free, classset, classadd, classdel | open, closed | The lock and free command needs the extra attribute **locid**="myLoco" | %%<st id="x" state="closed"/>%% | | Route | st | go, lock, free, classset, classadd, classdel | open, closed | The lock and free command needs the extra attribute **locid**="myLoco" | %%<st id="x" state="closed"/>%% |
-| Text | tx | showon, showoff | | Update event by format attribute. \\ The optional **bkid** and **lcid** may be used in the command also. | %%<tx id="tx1" format="the loco id is %lcid%"/>%% | +| Text | tx | showon, showoff, blink, on, off, click | | Update event by format attribute. \\ The optional **bkid** and **lcid** may be used in the command also. | %%<tx id="tx1" format="the loco id is %lcid%"/>%% \\ <text id="xyz" cmd="blink" blink="true"/> 
-| Variable | vr | random, start, stop \\ start, length (for substring) | | Set by attribute: %%value="0" text="zero"%% \\ To make it temporary set %%generated="true"%%| %%<vr id="var1" text="Rocrail"/>%% \\ %%<vr id="var2" text="@var1-XML-Scripting." tokeniser="-"/>%% \\ %%<vr id="var2" text="@var1" start="1" length="3"/>%% |+| Variable | vr | random, start, stop \\ start, length (for substring) | | Set by attribute: %%value="0" text="zero"%% \\ To make it temporary set %%generated="true"%% \\ **Update:** with 2.1.3268+ this is the default value \\ To make it static set %%generated="false"%%| %%<vr id="var1" text="Rocrail"/>%% \\ %%<vr id="var2" text="@var1-XML-Scripting." tokeniser="-"/>%% \\ %%<vr id="var2" text="@var1" start="1" length="3"/>%% |
 | Action control | actionctrl |  | | The id in the actionctrl is a reference to an existing action. Condition child nodes may be added. | | Action control | actionctrl |  | | The id in the actionctrl is a reference to an existing action. Condition child nodes may be added. |
 | Operator | operator | emptycar, loadcar, addcar, leavecar | | In the carids attribute a list of cars must be specified. | | Operator | operator | emptycar, loadcar, addcar, leavecar | | In the carids attribute a list of cars must be specified. |
 | System | sys | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sys | | | System | sys | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sys | |
 | Automat | auto | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#auto | | | Automat | auto | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#auto | |
-| Car | car | empty, loaded, maintenance, assignwaybill, resetwaybill, loco & function | empty, loaded, maintenance, cartype, location | %%<car id="test" cmd="assignwaybill" waybill="testbill"/>%% |+| Car | car | empty, loaded, maintenance, assignwaybill, resetwaybill, loco & function | empty, loaded, maintenance, cartype, location | %%<car id="test" cmd="assignwaybill" waybill="testbill"/>%% |
 | Staging block | sb | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sb | | | Staging block | sb | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sb | |
 | Fiddle Yard | seltab | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#seltab | | | Fiddle Yard | seltab | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#seltab | |
 | Location | location | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#location | | | %%<location id="Blaak" cmd="info" svalue="tx1"/>%% | | Location | location | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#location | | | %%<location id="Blaak" cmd="info" svalue="tx1"/>%% |
-| Clock | clock | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#clock | |   // Set clock on System time: // \\  %%<clock divider="1" hour="%syshour%" minute="%sysmin%"/>%%  |+| Clock | clock | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#clock | | //Set clock on System time:// \\  %%<clock divider="1" hour="%syshour%" minute="%sysmin%"/>%%  |
 | Turntable | tt | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#tt | | | Turntable | tt | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#tt | |
 | External | ext | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#ext | | | External | ext | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#ext | |
-| Weather | weather | setweather, weathertheme | | +| Weather | weather | setweather, weathertheme, go, stop | | 
-| Light | light | flip, enable, disable | Enable a light from LightControl. | +| Light | light | flip, enable, disable | Enable a light from LightControl. 
-| Model | model | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#model | With modify the sub nodes may contain attributes which will be merged in the objects. | %%<model cmd="change">%% \\ %%<tx id="x" backred="255" backgreen="0" backblue="0"/>%% \\ %%</model>%% | +| LightControl | lightctrl | go, stop | | Enable / disable LightControl. | %%<lightctrl cmd="go"/>%% \\ %%<lightctrl cmd="stop"/>%% 
 +| Model | model | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#model | | The modify is not supported, use change instead. | %%<model cmd="change">%% \\ %%<tx id="x" backred="255" backgreen="0" backblue="0"/>%% \\ %%</model>%% |  
 +| MVTrack | mv | reset, sets1, sets2, setdistance, setdistanceR | | | <mv cmd="sets2" s2="fb4712"/> |
  
 ====Attribute values==== ====Attribute values====
Line 541: Line 582:
  \\  \\
  
 +===== System variables =====
 +see: [[https://wiki.rocrail.net/doku.php?id=text-gen-en#variable]] \\
 =====Variable Format===== =====Variable Format=====
 With the format attribute it is possible to format variable content in the same way as printf.\\ With the format attribute it is possible to format variable content in the same way as printf.\\
Line 564: Line 607:
  
  \\  \\
 +=====Variable Names=====
 +Within the limits described above, variable names can be freely named; but as soon as two scripts with the same variable name run at the same time the scripts may not work correctly. In those cases a script specific prefix added to the name of the variable may avoid any confusion: 
 +  * change the original variable name from "vr_idx" \\
 +  * within script "MyScriptNumber1.xml" to the variable name "vr_MSN1_idx" and \\
 +  * within script "MyScriptNumber2.xml" to the variable name "vr_MSN2_idx" and so on. \\
 +
 +=====Variables defined as "Generated"=====
 +In order to store a variable from runtime to runtime in Rocrail, these variables must be defined as "generated" "false": \\
 +====Example====
 +<code xml>
 +<xmlscript>
 +  <vr id="vr_MSN3_lastUsedLocomotive" value="0" text="br89" generated="false"/>
 +  <vr id="vr_MSN3_tmp" value="0" text=""/>
 +</xmlscript>
 +</code>
 +The variable "vr_MSN3_lastUsedLocomotive" will be stored within the Rocrail plan file. \\
 +The variable "vr_MSN3_tmp" will be deleted when Rocrail is finished and will not be stored within the Rocrail plan file. 
 +
 +\\
 +
 =====Tips===== =====Tips=====
 ====XML Well Formed==== ====XML Well Formed====
xmlscripting-en.1557649036.txt.gz · Last modified: 2019/05/12 10:17 by rjversluis