Shared Variables

When running multiple copies of modules, each will keep a separate copy of its own variables. Prefixing a variable definition with the keyword "Shared" makes that variable a shared variable. Now when multiple copies of a module are running, and use this shared variable, all copies use the same value. For example, if one module writes the value 4 to a shared variable, all other copies of that module will see the value 4 in that variable. This is because only one variable is present in RAM; each module does not make its own copy of shared variables. Shared variables are deleted only when the application stops running.