Class: AnybusSettings

AnybusSettings

Provides generic properties for configuring anybus devices


Members


mmap :string

Gets/sets the xml description of the memory map. When anybus.Anybus#load is called, this description is used to create an object tree that can be used to directly access the attributes from JavaScript.

This is typically set using AJAX to retrieve an xml memory map file.

Type:
  • string
Since:
  • 1.0 (WAT 2.4)
See:
Example
var dev = $wat.load(abType)[0];

function init(mmap)
{
   dev.settings.mmap = mmap;
   // set up the other settings here

   if (dev.load() == false)
   {
      alert("Failed to load memory map");
      return;
   }
}

// called after the page loads, for example in the body onload
function getXML()
{
   xmlhttp = new XMLHttpRequest();
   xmlhttp.open("GET", "mmap.xml", true);
   xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
         init(xmlhttp.responseText);
      }
   }
   xmlhttp.send("");
}

mmapFile :string

The name of a file in the file system of the uP device (e.g. /wat/mmap.xml) to read the memory map from if mmap is empty when anybus.Anybus#load is called.

It is often more convenient to use AJAX and mmap to load a memory map.

Type:
  • string
Since:
  • 1.0 (WAT 2.4)
See:

offlineAction :number|null

Gets/sets the memory map policy when offline.

Type:
  • number | null
Since:
  • 1.0 (WAT 2.4)
See:

OfflineAction :object

Available options for offlineAction.

Type:
  • object
Properties:
Name Type Description
Zero number

Clear all of the memory map to zero when offline (0)

Freeze number

Freeze the memory map in the current state when offline (1)

Set number

Set all bits in the memory map to one when offline (2)

Since:
  • 1.0 (WAT 2.4)
See:

Events


mmapChanged

Indicates that the mmap property has changed.

Since:
  • 1.0 (WAT 2.4)

mmapFileChanged

Indicates that the mmapFile property has changed.

Since:
  • 1.0 (WAT 2.4)

offlineActionChanged

Indicates that the offlineAction property has changed.

Since:
  • 1.0 (WAT 2.4)