Type alias DeviceRef

DeviceRef: number | string

There are multiple ways to uniquely identify a device. The Motion Master API, specifically the messages exchanged between Motion Master and its clients, uses the device address. Device addresses uniquely identify devices but are volatile—they change whenever the devices reinitialize (e.g., after a power cycle). To handle this, the client library introduces DeviceRef, which can be one of the following:

  • Device Address
  • Device Serial Number
  • Device Position

Since both address and position are numbers, differentiation is made by checking whether the DeviceRef is higher than 0xFFFF. If it's higher, it's considered a device address, as device addresses tend to be large numbers. If it's lower, it's treated as a device position, since the EtherCAT network can enumerate up to 65,535 devices.

Generated using TypeDoc