Class: TMCT

TMCT

Provides methods and properties for creating an object that can be used to communicate with a device using the TMC Torque protocol. This object can be accessed by loading the plugin 'tmct'. A single object is returned when loading the plugin, which is a TMCT.


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

Members


<readonly> nakCodes :object

A list of possible NAK codes that can appear in tmct.TMCTDevice#event:qualityData.

Type:
  • object
Properties:
Name Type Description
noError number

'0' (0x30)

startError number

'1' (0x31)

endError number

'2' (0x32)

sumError number

'3' (0x33)

parityError number

'4' (0x34)

framingError number

'5' (0x35)

overrunError number

'6' (0x36)

timeoutError number

'7' (0x37)

cmdError number

'8' (0x38)

lengthError number

'9' (0x39)

progNumError number

'A' (0x41)

vehicleDataError number

'B' (0x42)

otherError number

'X' (0x58)

tighteningError number

'Y' (0x59)

countError number

'Z' (0x5A)

Since:
  • 1.0 (WAT 1.0)

Methods


createDevice(port [, name])

Create a new instance of a tmct.TMCTDevice using the supplied serial port.

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
port wat.SerialPort

The serial port to use for communications.

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:
  • 1.0 (WAT 1.0)
Returns:
Type
tmct.TMCTDevice

deleteDevice(dev)

Delete a previously created device.

Parameters:
Name Type Description
dev tmct.TMCTDevice

The device to delete.

Since:
  • 1.0 (WAT 1.0)

judgementString(judgment)

Converts a judgement result from tmct.TMCTDevice#event:qualityData to a string.

Parameters:
Name Type Description
judgment number

Judgment value from the quality result.

Since:
  • 1.0 (WAT 1.0)
Returns:

A string representation of the result.

Type
string