Class: DN

DN

Provides methods and attributes for configuring DeviceNet and accessing the memory map.


Fires:
Example
var dn = $wat.load('dn')[0];

Members


<readonly> cip :cip.CIPMap

The base object for accessing objects defined in the CIP memory map.

Type:
Since:
  • 1.0 (WAT 1.0)

enabled :bool

Gets/sets whether DeviceNet is enabled. The other DN settings (such as the memory map) must be configured prior to enabling. Changes made after enabling will not take effect until DN is disabled and then re-enabled.

Type:
  • bool
Since:
  • 1.0 (WAT 1.0)
See:

<readonly> input :cip.UDT

Gets an object that can be used to access the input area of the IO memory map. Note that 'input' is DN server-centric. Because this plugin is a DN client the 'input' (input to server) is actually an output and thus writable.

Type:
Since:
  • 1.0 (WAT 1.0)

<readonly> output :cip.UDT

Gets an object that can be used to access the output area of the IO memory map. Note that 'output' is DN server-centric. Because this plugin is a DN client the 'output' (output from server) is actually an input and thus read-only.

Type:
Since:
  • 1.0 (WAT 1.0)

<readonly> settings :dn.DNSettings

Gets an object that can be used to read and write the DeviceNet settings. The values in this object must be configured prior to enabling DeviceNet.

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

Methods


input( [index])

Gets the IO memory map input defined by index. Currently only a single input is supported, e.g. input(0).

Parameters:
Name Type Argument Default Description
index number <optional>
0

the index of the input to get (currently must be 0)

Since:
  • 1.0 (WAT 1.0)
See:
Returns:
Type
cip.CIPVar

load()

Loads the memory map that has been set using dn.DNSettings#mmap or dn.DNSettings#mmapFile and creates an object tree to access the defined instances and attributes.

Since:
  • 1.0 (WAT 1.0)

output( [index])

Gets the IO memory map output defined by index. Currently only a single input is supported, e.g. output(0).

Parameters:
Name Type Argument Default Description
index number <optional>
0

the index of the input to get (currently must be 0)

Since:
  • 1.0 (WAT 1.0)
See:
Returns:
Type
cip.CIPVar

update()

Forces the output assembly to re-read the memory map and update the attributes. If the value of any attribute changes as a result, the valueChanged signal for that attribute will be emitted.

It is not necessary for the application to call this method, as it will be called automatically when the memory map has changed.

Since:
  • 1.0 (WAT 1.0)

Events


assemblyWritten

Indicates that the output assembly has been written to by the server.

In most cases, it is not necessary to use this event. Instead, it is more convenient to attach to the valueChanged signal from an attribute or instance, as this fires any time the value has changed as a result of the assembly being written.

Since:
  • 1.0 (WAT 1.0)