abb-rws-client 0.1.9 → 0.2.0
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/README.md +33 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,14 @@ A typed TypeScript/Node.js HTTP and WebSocket client for **ABB IRC5 robot contro
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## VS Code Extension
|
|
11
|
+
|
|
12
|
+
Prefer a GUI? The companion VS Code extension gives you live status, joint positions, RAPID control, and module management directly from the sidebar — no code required.
|
|
13
|
+
|
|
14
|
+
**[ABB Robot (RWS) — VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=merajsafari.abb-rws-vscode)**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
10
18
|
## Features
|
|
11
19
|
|
|
12
20
|
- HTTP Digest Authentication (RFC 2617) — no external auth libraries
|
|
@@ -108,6 +116,7 @@ try {
|
|
|
108
116
|
| `password` | `string` | `'robotics'` | RWS password |
|
|
109
117
|
| `requestIntervalMs` | `number` | `55` | Minimum ms between requests (enforces < 20 req/sec) |
|
|
110
118
|
| `timeout` | `number` | `5000` | Request timeout in ms |
|
|
119
|
+
| `sessionCookie` | `string` | — | Saved cookie string to reuse an existing session slot (avoids the 70-session controller limit) |
|
|
111
120
|
|
|
112
121
|
---
|
|
113
122
|
|
|
@@ -117,6 +126,7 @@ try {
|
|
|
117
126
|
|---|---|---|
|
|
118
127
|
| `connect()` | `Promise<void>` | Establish session and authenticate |
|
|
119
128
|
| `disconnect()` | `Promise<void>` | Close subscriptions and clear session |
|
|
129
|
+
| `getSessionCookie()` | `string \| null` | Current session cookie — save and pass as `sessionCookie` on next start to reuse the slot |
|
|
120
130
|
|
|
121
131
|
---
|
|
122
132
|
|
|
@@ -156,7 +166,9 @@ try {
|
|
|
156
166
|
|---|---|---|
|
|
157
167
|
| `uploadModule(remotePath, content)` | `Promise<void>` | Upload RAPID `.mod` source to controller filesystem |
|
|
158
168
|
| `loadModule(taskName, modulePath)` | `Promise<void>` | Load an uploaded module into a RAPID task |
|
|
169
|
+
| `unloadModule(taskName, moduleName)` | `Promise<void>` | Unload a module from a task (RAPID must be stopped) |
|
|
159
170
|
| `listModules(taskName)` | `Promise<string[]>` | Names of all loaded modules in a task |
|
|
171
|
+
| `readFile(remotePath)` | `Promise<string>` | Download a file from the controller filesystem as a string |
|
|
160
172
|
|
|
161
173
|
---
|
|
162
174
|
|
|
@@ -235,6 +247,27 @@ try {
|
|
|
235
247
|
|
|
236
248
|
---
|
|
237
249
|
|
|
250
|
+
## Session Persistence
|
|
251
|
+
|
|
252
|
+
The IRC5 controller allows a maximum of **70 concurrent RWS sessions**. To avoid exhausting this limit across process restarts, persist the session cookie:
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import fs from 'fs';
|
|
256
|
+
|
|
257
|
+
// After connecting — save the cookie
|
|
258
|
+
const cookie = client.getSessionCookie();
|
|
259
|
+
if (cookie) fs.writeFileSync('.rws-session', cookie, 'utf8');
|
|
260
|
+
|
|
261
|
+
// On next start — reuse it
|
|
262
|
+
let sessionCookie: string | undefined;
|
|
263
|
+
try { sessionCookie = fs.readFileSync('.rws-session', 'utf8'); } catch {}
|
|
264
|
+
|
|
265
|
+
const client = new RwsClient({ host, username, password, sessionCookie });
|
|
266
|
+
await client.connect(); // reuses the existing slot, no new session created
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
238
271
|
## Compatibility
|
|
239
272
|
|
|
240
273
|
| Feature | RobotWare 6.x (RWS 1.0) | RobotWare 7.x (RWS 2.0) |
|