Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The Sleep method  The Int_var method Next page


The Itv_var method sets and returns the values of global variables.

Syntax for method invocation:

function Itv_var (globalvar : String) : String
  1. Globalvar is a required argument. It specifies the name of the global variable. Possible values: String type that meets the requirements for valid names of String parameters of the Windows registry.

Note

Global variables are stored in the Windows registry to maintain their values after Windows restart. All global variables are stored in the registry branch HKEY_USERS\S-1-5-21-…\Software\VMSScript\VMSSCRIPT and HKEY_CURRENT_USER\Software\VMSScript\VMSSCRIPT. To access a global variable directly from the registry, search the registry for it by its name.

Example. On macro 1, save the value of the bright parameter of camera 10 to the cam10bright global variable. On macro 2, set the bright parameter of the cameras 1 to 4 to the value of the cam10bright global variable.

if (Event.SourceType == "MACRO" && Event.Action == "RUN")
{
 if(Event.SourceId == "1")
 {
  Itv_var("cam10bright") = GetObjectParam("CAM", "10", "bright");
 }
 if (Event.SourceId == "2")
 {
  var cam10bright = Itv_var("cam10bright");
  for(i=1; i<=4; i=i+1)
  {
   SetObjectParam("CAM", i, "bright", cam10bright);
  }
 }
}