Creates an instance of the class with the specified base URL.
The base URL for accessing the device API.
Readonly
baseThe base URL for accessing the device API.
Private
Readonly
headersDefault headers for all requests to the Integro device web server.
Optional
parametersA collection of previously retrieved device parameters. These cached parameters assist in determining the correct data type and decoding parameter values during parameter upload. They are also used to identify the list of PDO entries and their configurations.
Optional
rxCached RxPDO entries used to determine the type and size when sending PDO values.
Optional
txCached TxPDO entries used to determine the type and size when receiving PDO values.
Downloads the specified parameter value to the device.
Command Code: CMD=0x02
A promise that resolves when the download is complete.
The index of the parameter to be downloaded.
The subindex of the parameter to be downloaded.
The value to set for the parameter.
Optional
uid: stringAn optional unique identifier for the request.
Retrieves the cached parameters. If the parameters are not cached, a request is made to the device to fetch them.
A promise that resolves to an array of cached parameters.
Retrieves and caches PDO entries, including index, subindex, bit length, and data type, for efficient reuse in operations like sending and receiving PDO values.
Note that requests to NetX must be made sequentially; otherwise, a fetch call in Node.js may time out, resulting in a 'ConnectTimeoutError'.
A promise that resolves to an array of cached PDO entries.
Specifies which PDO entries to retrieve ('rxPdoEntries' or 'txPdoEntries').
Retrieves the list of available parameters on the device.
Command Code: CMD=0x05
A promise that resolves to the list of available parameters.
Optional
uid: stringAn optional unique identifier for the request.
Retrieves the EtherCAT-compatible state of the device as defined by EthercatState.
Command Code: CMD=0x06
A promise that resolves to the current state as a number.
Optional
uid: stringAn optional unique identifier for the request.
Parses a single entry (array of strings) representing information about a parameter from the GET /odl endpoint. For example, the following entry corresponds to "0x2111:1" (Encoder 1 feedback - Raw position): [ "2111", // Index in hexadecimal format "1", // Subindex in decimal format "Raw position", // Parameter name "0", // Object code "7", // Value type "87" // Flags ]
An object of type EthernetDeviceParameter containing the parsed values.
An array of strings containing the parameter information.
Reads a file from the specified device.
Command Code: CMD=0x03
Implement the function to fetch the file data from the device.
A promise that resolves to a Uint8Array containing the file data.
The name of the file to be read.
Optional
uid: stringAn optional unique identifier for the request.
Receives PDO values from the device.
The device sends an array of bytes, and this function processes the parameters, their data types, and the PDO entries to convert the byte array into an array of received PDO entry values.
Command Code: CMD=0x0A
An array of received PDO entry values.
Optional
uid: stringAn optional unique identifier for the request.
Resets or restarts both NetX firmware components: COM and CORE. This operation is typically performed after completing a firmware installation.
Note that the device will respond before the actual restart occurs, so please allow a few seconds for the restart to complete.
Command Code: CMD=0x09
A promise that resolves when the reset request is complete.
Optional
clearCache: boolean = trueSpecifies whether to clear the parameters and PDO entries cache during the reset.
Sets the EtherCAT-compatible state of the device as defined by EthercatState.
Command Code: CMD=0x07
A promise that resolves when the state has been successfully set.
The target state to set for the device, based on the EthercatState enumeration.
Optional
uid: stringAn optional unique identifier for the request.
Updates the firmware by uploading it to the device and restarting the NetX.
This function has not been tested. Verify its functionality by uploading a firmware file.
The firmware data to upload.
The name of the firmware file.
Uploads a single parameter value from the device.
Command Code: CMD=0x01
The index of the parameter to upload.
The subindex of the parameter to upload.
Optional
uid: stringAn optional unique identifier for the request.
Uploads the firmware file to the device. Call the reset method to apply the changes.
This function has not been tested. Verify its functionality by uploading a firmware file.
A promise that resolves when the upload is complete.
The firmware data to upload.
The name of the firmware file.
Writes the specified file content to the device.
Command Code: CMD=0x04
Implement the function to write the file content to the device.
A promise that resolves when the file has been successfully written.
The name of the file to be created or overwritten on the device.
The file content to be written, provided as a Uint8Array.
Optional
uid: stringAn optional unique identifier for the request.
Generated using TypeDoc
Represents a single Ethernet device. Each Ethernet device hosts a web server, and the base URL uniquely identifies the device.