Class: Toyopuc

Toyopuc

Provides methods and properties for creating an object that can be used to communicate with a Toyopuc PLC using the 'PC' port. This object can be accessed by loading the plugin 'toyopuc'. A single object is returned when loading the plugin, which is a Toyopuc.


Example
var toyopuc = $wat.load('toyopuc')[0];

Methods


createDevice(host [, port] [, name])

Create a new instance of a toyopuc.ToyopucDevice using the supplied host name.

The object created will be cleaned up automatically, but only when the page reloads. If these objects are re-created without reloading the page, then they must be deleted using deleteDevice, otherwise a memory leak will occur.

Parameters:
Name Type Argument Default Description
host string

The name of the host (e.g. IP address) to connect to.

port number <optional>
2007

The TCP port on the host to connect to. Typically the default is used, as this is the 'PC' port number on a Toyopuc.

name string <optional>
""

If specified, the object returned will also be accessible as a property of this object, with the same name as the new device.

Since:
  • 0.1 (WAT 1.4)
Returns:
Type
toyopuc.ToyopucDevice

deleteDevice(dev)

Delete a previously created Toyopuc connection.

Parameters:
Name Type Description
dev toyopuc.ToyopucDevice

The device to delete.

Since:
  • 0.1 (WAT 1.4)