Upload files to "/"
This commit is contained in:
parent
b9b2c6ef79
commit
5c17941140
61
README.md
Normal file
61
README.md
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
# Sick Encoder CAN Monitor
|
||||||
|
|
||||||
|
Ứng dụng giám sát encoder Sick qua giao tiếp CAN (PCAN-USB), hiển thị vị trí thời gian thực, trạng thái node, heartbeat, PDO, và hỗ trợ thay đổi bitrate / node ID runtime.
|
||||||
|
|
||||||
|
## 🎯 Mục tiêu chính
|
||||||
|
- Đọc và hiển thị vị trí encoder Sick (mm) từ PDO TPDO1 theo thời gian thực
|
||||||
|
- Giám sát trạng thái node (Bootup, Pre-Operational, Operational, Stopped, Timeout)
|
||||||
|
- Hỗ trợ thay đổi **bitrate** và **Node ID** runtime (bao gồm unlock + save to EEPROM)
|
||||||
|
- Giao diện web đơn giản, responsive bằng **Blazor**
|
||||||
|
|
||||||
|
## 🏗️ Kiến trúc
|
||||||
|
┌─────────────────────┐
|
||||||
|
│ Blazor Web App │ (UI: Start/Stop, Bitrate, NodeID, Table frames)
|
||||||
|
└──────────┬──────────┘
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
┌─────────────────────┐
|
||||||
|
│ PcanCanService │ (.NET service xử lý PCAN-Basic)
|
||||||
|
│ - Init/Uninit │
|
||||||
|
│ - Read loop │
|
||||||
|
│ - NMT commands │
|
||||||
|
│ - Apply bitrate │
|
||||||
|
│ - Apply node ID │
|
||||||
|
└──────────┬──────────┘
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
┌─────────────┐
|
||||||
|
│ Sick Encoder│ CAN (PCAN-USB)
|
||||||
|
└─────────────┘
|
||||||
|
|
||||||
|
## 🚀 Công nghệ sử dụng
|
||||||
|
- **Backend**: .NET 10 (LTS)
|
||||||
|
- **Frontend**: Blazor Web App (Server hoặc WebAssembly tùy chọn)
|
||||||
|
- **CAN Driver**: Peak PCAN-Basic (PCAN-USB)
|
||||||
|
- **Dependency Injection**: Microsoft.Extensions.Options
|
||||||
|
- **OS hỗ trợ**: Windows (PC phát triển), có thể port sang Linux (mono hoặc .NET runtime)
|
||||||
|
|
||||||
|
## 📂 Cấu trúc thư mục (hiện tại)
|
||||||
|
SickBlazorApp/
|
||||||
|
├── SickBlazorApp/ # Project Blazor chính
|
||||||
|
│ ├── Components/ # (nếu có reusable components)
|
||||||
|
│ ├── Models/ # PositionPdo, CanFrame, CanNodeState, ...
|
||||||
|
│ ├── Options/ # CanBusOptions
|
||||||
|
│ ├── Services/ # PcanCanService + interface
|
||||||
|
│ ├── Pages/ # sick.razor (trang chính)
|
||||||
|
│ └── Program.cs
|
||||||
|
├── docs/ # Tài liệu
|
||||||
|
└── README.md
|
||||||
|
|
||||||
|
## 🚦 Trạng thái hiện tại
|
||||||
|
- Đã hoàn thành:
|
||||||
|
- Kết nối PCAN-USB + đọc CAN frame liên tục
|
||||||
|
- Parse heartbeat (node state + auto resume)
|
||||||
|
- Xử lý Position PDO (raw → mm)
|
||||||
|
- Thay đổi bitrate runtime (unlock + save EEPROM + reset)
|
||||||
|
- Thay đổi Node ID runtime (unlock + save + reset)
|
||||||
|
- UI Blazor hiển thị bảng frame, trạng thái node, vị trí mm
|
||||||
|
- Đang phát triển:
|
||||||
|
- Cải thiện UI/UX (loading state, error message, reconnect)
|
||||||
|
- Thêm logging chi tiết
|
||||||
|
- Hỗ trợ nhiều channel PCAN (nếu cần)
|
||||||
BIN
SickEncoderDocument.pdf
Normal file
BIN
SickEncoderDocument.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user