npm-inco-pkg
v1.3.0
Published
INCO communication
Readme
npm-inco-pkg
The callback API provides init, getVariable, putVariable and parameterless
callProcedure for an INCO controller over IPv4 UDP.
Legacy controller size limit
Version 1.3.0 enforces a maximum 494-byte complete encoded INCO UDP message, including headers, checksums, DLE escaping and terminators. Ethernet/IP/UDP headers are outside this count. This conservatively treats the controller's legacy 494-byte frame limit as a wire-message limit, not a 494-byte data allowance.
Outgoing buffers hold 494 bytes. Encoding counts every byte, including escape
bytes; oversized requests fail via the callback with code
INCO_FRAME_TOO_LARGE before any packet is sent. The mutex is released so later
requests can proceed. Incoming messages over 494 bytes are also rejected.
Receive storage accommodates the limit plus a local NUL padding byte.
There is no fixed character limit for paths. The available space depends on operation type, numeric payload, frame number, checksums and escaping. Plugins must pass the complete requested name (including operation suffixes) to this library, and propagate callback errors. Names must be non-empty ASCII without embedded NUL. Parameterized procedures remain unsupported.
Receive handling rejects incomplete, mismatched, short numeric and invalid responses instead of returning old buffer contents. Socket failures and exhausted retries report errors exactly once and release the mutex. Retries retain the same encoded message. The existing single-controller singleton API is preserved.
Run node --test test.js for mocked UDP boundary and failure tests. No real
controller is contacted by these tests.
