Cleanud up
This commit is contained in:
@@ -1,41 +1,37 @@
|
||||
# atMb — documented working library
|
||||
# Atom Modbus Library (`atMb`)
|
||||
|
||||
Start with `library/atMb-Documented.export`: comments-only documentation of your
|
||||
working CmpAtomModbus export, retaining its embedded C library object. It uses
|
||||
`ClientTCP`, matching the uploaded working interface.
|
||||
CODESYS library with a native C engine for Modbus TCP client, RTU client and TCP
|
||||
slave operation. Public namespace: `atMb`. No ModbusFB dependency is required.
|
||||
|
||||
Read `docs/USER-GUIDE.md` for setup and examples and `docs/API-REFERENCE.md` for
|
||||
all 95 code objects, parameters, outputs, methods and properties.
|
||||
`docs/DOCUMENTATION-VALIDATION.md` records code/payload preservation checks.
|
||||
`reference/Working-CmpAtomModbus.export` is the exact uploaded original.
|
||||
## Use the library
|
||||
|
||||
The earlier development export and generator are retained for source history.
|
||||
`library/build_native_export.py` generates the earlier migration export; it does
|
||||
not generate or supersede the newly documented working export. Do not overwrite
|
||||
working IDE changes by regenerating that migration export. The documentation
|
||||
adds no C changes; the source-to-uploaded-binary match remains unverified.
|
||||
Open `library/CmpAtomModbus.library` in CODESYS, or install it using Library
|
||||
Repository and reference it from your application. Keep its project title and
|
||||
external C interface settings intact. The development target is Raspberry Pi
|
||||
64 SL (ARM64), using CODESYS 3.5 SP22; runtime/target compatibility must be checked
|
||||
when changing platforms. Read [the user guide](docs/USER-GUIDE.md) for examples
|
||||
and [the API reference](docs/API-REFERENCE.md) for members and methods.
|
||||
|
||||
The rest of the source/build kit remains below.
|
||||
## Repository contents
|
||||
|
||||
# atMb — native Modbus for CODESYS
|
||||
| Path | Purpose |
|
||||
|---|---|
|
||||
| `library/CmpAtomModbus.library` | Working CODESYS library file; edit IEC code here |
|
||||
| `component-source/src/` | C protocol, client, serial and server implementation |
|
||||
| `component-source/component/` | Active component frame, ABI interface and makefile |
|
||||
| `component-source/tests/` | Host protocol and bridge tests |
|
||||
| `ExtensionSDK/` | Supplied SDK required for component builds |
|
||||
| `artifacts/arm64/libCmpAtomModbus.so` | Supplied ARM64 native binary |
|
||||
| `docs/BUILD-AND-USAGE.md` | Native build and deployment instructions |
|
||||
| `docs/USER-GUIDE.md` | Calling patterns, configuration and diagnostics |
|
||||
| `docs/API-REFERENCE.md` | Detailed IEC reference based on the last working export |
|
||||
| `docs/CLEANUP.md` | Removed files, preservation checks and update workflow |
|
||||
| `docs/VALIDATION.md` | Validation scope |
|
||||
| `SHA256SUMS.txt` | Current working-file snapshot checksums, excluding Git metadata |
|
||||
|
||||
Git-ready source snapshot, revision 0.9.1. Public namespace `atMb`.
|
||||
C implementation supports TCP client, RTU client and TCP slave; IEC code has
|
||||
no ModbusFB dependency. Online-change support remains future work.
|
||||
## Build on the Pi
|
||||
|
||||
## Files
|
||||
|
||||
- `component-source/`: C engine, CODESYS component frame/interface and host tests.
|
||||
- `ExtensionSDK/`: supplied SDK used by the component build.
|
||||
- `library/atMb-Native.export`: corrected IEC import; includes public status declarations.
|
||||
- `library/atMb-Native-Review.st`: readable generated IEC source.
|
||||
- `library/build_native_export.py`: reproducible export generator.
|
||||
- `reference/CmpAtomModbus-AllInOne.export`: required generator baseline, not the final import.
|
||||
- `artifacts/arm64/`: your uploaded shared object and precompile cache, preserved unchanged.
|
||||
- `docs/BUILD-AND-USAGE.md`: import, deployment, API, diagnostics and limitations.
|
||||
- `SHA256SUMS.txt`: snapshot file checksums.
|
||||
|
||||
## Build and test on the Pi
|
||||
Run from the repository root:
|
||||
|
||||
```sh
|
||||
sudo apt install build-essential m4 dos2unix python3
|
||||
@@ -44,38 +40,21 @@ make -C component-source/component SDKDIR="$(realpath ExtensionSDK)" all
|
||||
make -C component-source test
|
||||
```
|
||||
|
||||
Build natively for each Linux target architecture; the uploaded ARM64 `.so`
|
||||
cannot run on ARM32 or x86-64. Runtime/SDK compatibility must also be checked
|
||||
for each CODESYS target. The host tests exercise protocol code independently
|
||||
of the CODESYS runtime.
|
||||
Native output: `component-source/component/out/libCmpAtomModbus.so`.
|
||||
See the build guide before updating the embedded component. An ARM64 binary
|
||||
cannot run on ARM32 or x86-64; build for each architecture and verify the SDK/runtime
|
||||
combination. The supplied binary has not been proven byte-equivalent to this source.
|
||||
|
||||
## IEC export
|
||||
## Update and review
|
||||
|
||||
```sh
|
||||
python3 library/build_native_export.py
|
||||
```
|
||||
Edit the IEC library in CODESYS. After significant IEC changes, export the current
|
||||
objects and update the API reference against that export. Binary `.library` files
|
||||
cannot be reviewed as ordinary text diffs. This snapshot intentionally contains no
|
||||
old migration exports or generators that overwrite current IDE changes.
|
||||
|
||||
Import `library/atMb-Native.export` into a fresh CODESYS library project,
|
||||
namespace `atMb`, and embed the newly built `.so` in a C Implemented Library
|
||||
object. See the full instructions in `docs/BUILD-AND-USAGE.md`.
|
||||
The export is source, not a compiled `.library`. The supplied precompile cache
|
||||
is an opaque reference artifact and is not a substitute for the library project.
|
||||
This ZIP retains the existing Git history and remote metadata. Cleanup changes
|
||||
are uncommitted and unstaged. Review locally with `git status` and `git diff`,
|
||||
then stage/commit when ready. No push is performed by this package.
|
||||
|
||||
Your uploaded `.so` is ARM64 and contains RTU/server symbols. Its exact match
|
||||
to this source snapshot and its operation in the runtime have not been verified;
|
||||
rebuild from source before making a release. The older development instructions
|
||||
say no prebuilt binary is included: that applies to the earlier kit; this repo
|
||||
snapshot adds your uploaded binary under `artifacts/arm64/`.
|
||||
|
||||
## Start a repository
|
||||
|
||||
```sh
|
||||
cd atMb-repo
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial atMb native Modbus source"
|
||||
```
|
||||
|
||||
No Git history or remote is included. The SDK and baseline came from supplied
|
||||
files; review their redistribution terms before publishing a public repository.
|
||||
No new license is assigned by this snapshot.
|
||||
Online-change qualification remains future work. Keep all native calls owned by
|
||||
one IEC task. No new license is assigned to the supplied SDK/source files.
|
||||
|
||||
Reference in New Issue
Block a user