State: TwinCAT kit shipped (ADS, against a router model). CODESYS modelled (against a model of the engineering host). S7-1500 kit shipped (web API, against a model of the CPU's web server). Watching never writes and never changes the controller's state.
TwinCAT watches
With a TwinCAT target connected (see Connect to controllers), use the Watch view (PLC container):
- Add Watch (title button or Command Palette) adds a symbol of the uploaded table.
- Remove Watch (context menu) and Delete remove one; Clear Watches removes all.
Each row shows name, type, value and a state: OK, Reading, Not connected, Unknown symbol, Read failed (with the ADS error) or Cannot decode. Structs expand to members and arrays to elements. Enumerations, strings and times are decoded with the target's own type table. The watch list is kept per workspace.
Values are read by index group and offset every neuralInverse.plc.watch.intervalMs milliseconds (default 500, at least 100), never with more than one read outstanding, and only while the view is visible and the target connected.
When the runtime's symbol version changes (an online change or a download), the Watch view stops reading and keeps its last values marked stale, and the symbols are uploaded again. If the device cannot report the version, values read "Read; change detection unavailable" with the reason instead of "OK".
LDATE, LDT, LTOD, pointers and references are not decoded.
CODESYS watches
- Log in with a CODESYS online action (see CODESYS online actions).
- Run Add CODESYS Watch... (also a Watch view title button): pick the project file and application, then type IEC expressions separated by commas, such as
PLC_PRG.nSetpoint, GVL.bRun. At most 256 are kept. - The Watch view shows a row "<application> on <device>", labelled "Read through the CODESYS scripting session", with its expressions below it.
Values are read through the CODESYS scripting session (up to 64 per request, at the watch interval but at least once a second, one request at a time in the project's queue with its builds and actions), only while the view is visible and the Editor knows the application is logged in (after a CODESYS login in this window, in the session that is still open, on the project file as it was). A read never opens a CODESYS session or project.
| Row says | Meaning |
|---|---|
| OK, read <age> | The value as CODESYS formats it, and how long ago the read returned |
| No value: | CODESYS's reason |
| Read failed: | The read failed |
| Not current: read <age>; the next read is overdue | The read waits in the project's queue behind builds or actions |
| Not current: read <age>, before the view was hidden; reading again | Shown again after the view was hidden, until the next read |
| Not trustworthy | CODESYS reports the controller does not run the project's application |
While the application is not known to be logged in, nothing is read and the application row says why.
S7-1500 watches
- Connect an S7-1500 target (see Connect to controllers).
- Run Add S7-1500 Watch and name a variable as the web API names it, its parents separated by dots, for example
"DataBlock"."Variable". - The S7-1500 Watch (Web API) view reads each in turn at the watch interval, one request at a time, while it is visible.
Each row shows the name, the value as the CPU returned it and "OK (web API)", or "Read failed:" with the CPU's error. The view and every row say they were read through the S7-1500 web API, read only. Remove S7-1500 Watch and Clear S7-1500 Watches remove them. There is no write, force or mode command for S7-1500.
Not verified
- TwinCAT: any real runtime; code pages other than 1252 and 65001.
- CODESYS: everything against CODESYS and a controller, including whether reading needs monitoring switched on in a session without a user interface.
- S7-1500: any real CPU, and how each data type is returned.