@synapticon/motion-master-client 6.0.0-alpha.27 → 6.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/Api.d.ts +27 -26
- package/dist/generated/Api.js +28 -13
- package/dist/generated/data-contracts.d.ts +27 -0
- package/package.json +1 -1
package/dist/generated/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlStatusCode, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, Monitoring, ObjectDataTypeInfo, ParameterCacheEntry, ProcessDataWatchdog, ProcessImageObject, SlaveConfig, SlaveInformationInterface } from "./data-contracts.js";
|
|
1
|
+
import { AlStatusCode, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, ProcessDataWatchdog, ProcessImageObject, SlaveConfig, SlaveInformationInterface } from "./data-contracts.js";
|
|
2
2
|
import { HttpClient, RequestParams } from "./http-client.js";
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -265,31 +265,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
265
265
|
*/
|
|
266
266
|
serialNumber: number;
|
|
267
267
|
}, void>>;
|
|
268
|
-
/**
|
|
269
|
-
* @description Performs a live AL-state read for the device and reports whether its CoE/SDO mailbox is active — i.e. it is in PRE-OP, SAFE-OP, or OP. This is independent of the AL error indicator: a device in SAFE-OP+error still answers mailbox requests. Only INIT (no mailbox) and BOOT (FoE-only mailbox) report inactive. The device must already be known from a prior scan. Reading one device at a time means a single missing device reports inactive without failing the others.
|
|
270
|
-
*
|
|
271
|
-
* @name GetDeviceMailboxActive
|
|
272
|
-
* @summary Check whether a device's mailbox is active
|
|
273
|
-
* @request GET:/api/devices/{slavePosition}/mailbox
|
|
274
|
-
*/
|
|
275
|
-
getDeviceMailboxActive: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
|
|
276
|
-
/**
|
|
277
|
-
* 1-based position on the fieldbus
|
|
278
|
-
* @example 1
|
|
279
|
-
*/
|
|
280
|
-
slavePosition: number;
|
|
281
|
-
/**
|
|
282
|
-
* True when the device's CoE/SDO mailbox is active (AL state PRE-OP, SAFE-OP, or OP, regardless of the error indicator); false otherwise.
|
|
283
|
-
* @example true
|
|
284
|
-
*/
|
|
285
|
-
mailboxActive: boolean;
|
|
286
|
-
}, void | {
|
|
287
|
-
/**
|
|
288
|
-
* Human-readable error message from the driver
|
|
289
|
-
* @example "FPRD slave 1: wkc=0"
|
|
290
|
-
*/
|
|
291
|
-
error: string;
|
|
292
|
-
}>>;
|
|
293
268
|
/**
|
|
294
269
|
* @description Constructs the requested fieldbus driver, opens the network interface, and makes the driver available for subsequent calls to /api/scan. The driver defaults to SOEM when omitted. SOEM has no adapter auto-detect: a network adapter must be supplied, otherwise init fails.
|
|
295
270
|
*
|
|
@@ -413,6 +388,20 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
413
388
|
*/
|
|
414
389
|
error: string;
|
|
415
390
|
}>>;
|
|
391
|
+
/**
|
|
392
|
+
* @description Re-reads the value of every readable parameter already loaded for the device at `slavePosition`, leaving the parameter list itself intact (it does not re-enumerate the object dictionary — use `POST …/parameters/init` for that). Each value is read PDO-aware: from the live process image when the device is exchanging and the object is PDO-mapped, otherwise via an SDO upload over the mailbox. Write-only objects are skipped. Best-effort: an entry that fails to read keeps its cached value and the call still succeeds. Returns the refreshed list, ordered by `(index, subindex)`.
|
|
393
|
+
*
|
|
394
|
+
* @name ReadAllDeviceParameters
|
|
395
|
+
* @summary Refresh the cached value of every parameter without re-enumerating the dictionary
|
|
396
|
+
* @request POST:/api/devices/{slavePosition}/parameters/read
|
|
397
|
+
*/
|
|
398
|
+
readAllDeviceParameters: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<DeviceParameter[], void | {
|
|
399
|
+
/**
|
|
400
|
+
* Human-readable error message from the driver
|
|
401
|
+
* @example "FPRD slave 1: wkc=0"
|
|
402
|
+
*/
|
|
403
|
+
error: string;
|
|
404
|
+
}>>;
|
|
416
405
|
/**
|
|
417
406
|
* @description Returns the parameter list populated by the most recent call to `POST /api/devices/{slavePosition}/parameters/init`. Empty before the first call. Entries are ordered ascending by `(index, subindex)`.
|
|
418
407
|
*
|
|
@@ -937,6 +926,18 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
937
926
|
*/
|
|
938
927
|
error: string;
|
|
939
928
|
}>>;
|
|
929
|
+
/**
|
|
930
|
+
* @description Stages many output (RxPDO) objects at once — the "send all" action of the Process Data page. Each value is coerced to the object's declared data type and, when the object is output-mapped and its device is exchanging (SAFE-OP/OP), written into the output image so it is sent on the next real-time cycle and re-sent every cycle thereafter (set-once, sent-continuously). The batch is best-effort atomic: values are staged sequentially, so a batch can straddle two consecutive ~1 ms cycles. The request never fails as a whole — each object gets its own result, so the client can flag any object that was not cyclically staged (unknown device, coercion failure, object not output-mapped, or bus not exchanging; in the last two cases the value is still written via SDO/cache, just not cyclically driven).
|
|
931
|
+
*
|
|
932
|
+
* @name StageProcessDataOutputs
|
|
933
|
+
* @summary Stage a batch of output values into the process image
|
|
934
|
+
* @request POST:/api/process-data/outputs
|
|
935
|
+
*/
|
|
936
|
+
stageProcessDataOutputs: (data: any[][], params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
|
|
937
|
+
results: OutputStageResult[];
|
|
938
|
+
}, {
|
|
939
|
+
error: string;
|
|
940
|
+
}>>;
|
|
940
941
|
/**
|
|
941
942
|
* @description Returns the static ESC configuration the master programmed into every slave during the last scan: station/alias addresses, mapped process-data sizes, the mailbox transport windows, the distributed-clock setup, and the configured Sync Managers and FMMUs. Read from cached state with no bus I/O and valid once the bus has been scanned. The list is empty before any scan, or when the active transport has no ESC (e.g. SPoE). Numeric fields (SM/FMMU type, mailbox protocol bits, SM flags) are raw register values; the client decodes them. `deviceName` is empty when no known device occupies the slave.
|
|
942
943
|
*
|
package/dist/generated/Api.js
CHANGED
|
@@ -102,19 +102,6 @@ export class Api extends HttpClient {
|
|
|
102
102
|
format: "json",
|
|
103
103
|
...params,
|
|
104
104
|
});
|
|
105
|
-
/**
|
|
106
|
-
* @description Performs a live AL-state read for the device and reports whether its CoE/SDO mailbox is active — i.e. it is in PRE-OP, SAFE-OP, or OP. This is independent of the AL error indicator: a device in SAFE-OP+error still answers mailbox requests. Only INIT (no mailbox) and BOOT (FoE-only mailbox) report inactive. The device must already be known from a prior scan. Reading one device at a time means a single missing device reports inactive without failing the others.
|
|
107
|
-
*
|
|
108
|
-
* @name GetDeviceMailboxActive
|
|
109
|
-
* @summary Check whether a device's mailbox is active
|
|
110
|
-
* @request GET:/api/devices/{slavePosition}/mailbox
|
|
111
|
-
*/
|
|
112
|
-
getDeviceMailboxActive = (slavePosition, params = {}) => this.request({
|
|
113
|
-
path: `/api/devices/${slavePosition}/mailbox`,
|
|
114
|
-
method: "GET",
|
|
115
|
-
format: "json",
|
|
116
|
-
...params,
|
|
117
|
-
});
|
|
118
105
|
/**
|
|
119
106
|
* @description Constructs the requested fieldbus driver, opens the network interface, and makes the driver available for subsequent calls to /api/scan. The driver defaults to SOEM when omitted. SOEM has no adapter auto-detect: a network adapter must be supplied, otherwise init fails.
|
|
120
107
|
*
|
|
@@ -234,6 +221,19 @@ export class Api extends HttpClient {
|
|
|
234
221
|
format: "json",
|
|
235
222
|
...params,
|
|
236
223
|
});
|
|
224
|
+
/**
|
|
225
|
+
* @description Re-reads the value of every readable parameter already loaded for the device at `slavePosition`, leaving the parameter list itself intact (it does not re-enumerate the object dictionary — use `POST …/parameters/init` for that). Each value is read PDO-aware: from the live process image when the device is exchanging and the object is PDO-mapped, otherwise via an SDO upload over the mailbox. Write-only objects are skipped. Best-effort: an entry that fails to read keeps its cached value and the call still succeeds. Returns the refreshed list, ordered by `(index, subindex)`.
|
|
226
|
+
*
|
|
227
|
+
* @name ReadAllDeviceParameters
|
|
228
|
+
* @summary Refresh the cached value of every parameter without re-enumerating the dictionary
|
|
229
|
+
* @request POST:/api/devices/{slavePosition}/parameters/read
|
|
230
|
+
*/
|
|
231
|
+
readAllDeviceParameters = (slavePosition, params = {}) => this.request({
|
|
232
|
+
path: `/api/devices/${slavePosition}/parameters/read`,
|
|
233
|
+
method: "POST",
|
|
234
|
+
format: "json",
|
|
235
|
+
...params,
|
|
236
|
+
});
|
|
237
237
|
/**
|
|
238
238
|
* @description Returns the parameter list populated by the most recent call to `POST /api/devices/{slavePosition}/parameters/init`. Empty before the first call. Entries are ordered ascending by `(index, subindex)`.
|
|
239
239
|
*
|
|
@@ -536,6 +536,21 @@ export class Api extends HttpClient {
|
|
|
536
536
|
format: "json",
|
|
537
537
|
...params,
|
|
538
538
|
});
|
|
539
|
+
/**
|
|
540
|
+
* @description Stages many output (RxPDO) objects at once — the "send all" action of the Process Data page. Each value is coerced to the object's declared data type and, when the object is output-mapped and its device is exchanging (SAFE-OP/OP), written into the output image so it is sent on the next real-time cycle and re-sent every cycle thereafter (set-once, sent-continuously). The batch is best-effort atomic: values are staged sequentially, so a batch can straddle two consecutive ~1 ms cycles. The request never fails as a whole — each object gets its own result, so the client can flag any object that was not cyclically staged (unknown device, coercion failure, object not output-mapped, or bus not exchanging; in the last two cases the value is still written via SDO/cache, just not cyclically driven).
|
|
541
|
+
*
|
|
542
|
+
* @name StageProcessDataOutputs
|
|
543
|
+
* @summary Stage a batch of output values into the process image
|
|
544
|
+
* @request POST:/api/process-data/outputs
|
|
545
|
+
*/
|
|
546
|
+
stageProcessDataOutputs = (data, params = {}) => this.request({
|
|
547
|
+
path: `/api/process-data/outputs`,
|
|
548
|
+
method: "POST",
|
|
549
|
+
body: data,
|
|
550
|
+
type: ContentType.Json,
|
|
551
|
+
format: "json",
|
|
552
|
+
...params,
|
|
553
|
+
});
|
|
539
554
|
/**
|
|
540
555
|
* @description Returns the static ESC configuration the master programmed into every slave during the last scan: station/alias addresses, mapped process-data sizes, the mailbox transport windows, the distributed-clock setup, and the configured Sync Managers and FMMUs. Read from cached state with no bus I/O and valid once the bus has been scanned. The list is empty before any scan, or when the active transport has no ESC (e.g. SPoE). Numeric fields (SM/FMMU type, mailbox protocol bits, SM flags) are raw register values; the client decodes them. `deviceName` is empty when no known device occupies the slave.
|
|
541
556
|
*
|
|
@@ -130,6 +130,33 @@ export interface ProcessImageObject {
|
|
|
130
130
|
*/
|
|
131
131
|
bitLength: number;
|
|
132
132
|
}
|
|
133
|
+
export interface OutputStageResult {
|
|
134
|
+
/**
|
|
135
|
+
* 1-based bus position of the owning device (echoes the request)
|
|
136
|
+
* @example 1
|
|
137
|
+
*/
|
|
138
|
+
slavePosition: number;
|
|
139
|
+
/**
|
|
140
|
+
* CoE object index (echoes the request)
|
|
141
|
+
* @example 24698
|
|
142
|
+
*/
|
|
143
|
+
index: number;
|
|
144
|
+
/**
|
|
145
|
+
* CoE object subindex (echoes the request)
|
|
146
|
+
* @example 0
|
|
147
|
+
*/
|
|
148
|
+
subindex: number;
|
|
149
|
+
/**
|
|
150
|
+
* True when the value landed in the published output image and will be sent on the next exchange cycle
|
|
151
|
+
* @example true
|
|
152
|
+
*/
|
|
153
|
+
staged: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Empty on success; otherwise why the object was not cyclically staged (unknown device, coercion failure, object not output-mapped, or the bus not exchanging)
|
|
156
|
+
* @example ""
|
|
157
|
+
*/
|
|
158
|
+
error: string;
|
|
159
|
+
}
|
|
133
160
|
export interface SyncManagerConfig {
|
|
134
161
|
/**
|
|
135
162
|
* Sync Manager number (0–7)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapticon/motion-master-client",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.29",
|
|
4
4
|
"description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|