Class: TMCTDevice

TMCTDevice

Provides properties and methods for accessing a device implementing the TMC Torque protocol.

Members


<readonly> connected :bool

Gets whether a device has been successfully connected to or is in the process of being connected to.

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

Methods


close()

Closes the connection to the device.

Since:
  • 1.0 (WAT 1.0)

open()

Opens the serial port and start connecting to a device.

Since:
  • 1.0 (WAT 1.0)
Returns:

True if the connection is started. Does not indicate if the device has actually been connected to.

Type
bool

sendForcedWorkComplete( [id])

Sends a 'cancel' to the remote side to stop current work. Usually sent if the operator forces a stop from the UI.

Parameters:
Name Type Argument Default Description
id number <optional>
-1

An optional ID, that when non-negative, will be used in events to indicate if the message was successfully received by the remote side.

Since:
  • 1.0 (WAT 1.0)
Returns:

Indicates if the complete was successfully sent. Does not indicate if it was successfully received. User the id argument for that.

Type
bool

sendNormalWorkComplete( [id])

Sends a confirmation to the remote side that work has completed normally. Must be sent after the expected number of quality results have been received.

Parameters:
Name Type Argument Default Description
id number <optional>
-1

An optional ID, that when non-negative, will be used in events to indicate if the message was successfully received by the remote side.

Since:
  • 1.0 (WAT 1.0)
Returns:

Indicates if the complete was successfully sent. Does not indicate if it was successfully received. User the id argument for that.

Type
bool

sendProductionOrder(asn, vin, toolid, tightening [, id])

Sends a command to the remote device to begin a production order.

Parameters:
Name Type Argument Default Description
asn number

The ASN to use.

vin string

The VIN to use.

toolid number

The Tool ID to use.

tightening Array.<number>

An array of up to 16 values between 1 and 15 to use as PSets.

id number <optional>
-1

An optional ID, that when non-negative, will be used in events to indicate if the message was successfully received by the remote side.

Since:
  • 1.0 (WAT 1.0)
Returns:

Indicates if the production order was successfully sent. Does not indicate if it was successfully received. Use the id argument for that.

Type
bool

Events


closed

Emitted whenever the serial port is closed. It can be closed as a result of an error or explicitly by the application.

Since:
  • 1.0 (WAT 1.0)

commandError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)

commError

Emitted whenever a message has not been ACK'd after all retry attempts.

Since:
  • 1.0 (WAT 1.0)

countError

Emitted whenever message has been NAK'd with this value.


gotAck

Emitted for messages sent with a non-zero ID, indicating that the message has been ACK'd by the remote device.

Parameters:
Name Type Description
id number

The ID supplied when the message was sent.

Since:
  • 1.0 (WAT 1.0)

gotNak

Emitted for messages sent with a non-zero ID, indicating that the message has been NAK'd by the remote device.

Parameters:
Name Type Description
id number

The ID supplied when the message was sent.

nak number

The NAK code. See tmct.TMCT#nakCodes.

Since:
  • 1.0 (WAT 1.0)

lengthError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)

otherError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)

programError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)

qualityData

Emitted when quality data for a joint (PSet) is received.

Parameters:
Name Type Description
data object
Properties:
Name Type Description
program number
overall number
comprehensive number

Same as overall

ok bool
torqueJudgement number
torqueOk bool
angleJudgement number
angleOk bool
freerunningJudgement number
freerunningOk bool
timeJudgement number
timeOk bool
almightyJudgement number
almightyOk bool
torque number
angle number
freerunning number
time number
almighty number
nak number

NAK code, see tmct.TMCT#nakCodes

Since:
  • 1.0 (WAT 1.0)

tighteningError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)

vehicleDataError

Emitted whenever message has been NAK'd with this value.

Since:
  • 1.0 (WAT 1.0)