Comments (5)
Currently it works, just because modbus_poll is called from modbus_send_rtu, but this is very dangerous - in other conditions modbus_poll can be called by core main thread, because it hooks grbl.on_execute_realtime.
The risk is, IMO, low since grblHAL in essence is single threaded. I'll add your test anyway since the state transition is also taken care of when the blocking loop exits.
Additionally, I didn't find on_rx_exception callback for timeout case for async packet.
This is deliberate, async packets is intended for querying the device status and is typically sent when the real time status is requested. But since the API may be used for other devices than VFDs is should be added? And perhaps support for async timeouts should be added to the VFD drivers too?
from plugins_spindle.
This is deliberate, async packets is intended for querying the device status and is typically sent when the real time status is requested
My understanding was that async call differs from sync call just by non-blocking waiting for result, but result of operation is important and must be equal for async/sync from API perspective.
Using async in VFD to request current speed (when TO result is not important) is just a particular use case.
Anyway, I just pointed that, and I think it will be better to create a separate issue, if you agree.
from plugins_spindle.
A new issue is ok - provinding the timeout callback is easy, how it should be handled is another story. Retry or not? Generate an alarm and in which circumstances? ...
from plugins_spindle.
Is your concern about request speed case or in general?
I think that for request speed you can leave it as it is now - do not add any additional handling. Alarm will be raised after VFD_RETRIES according to current code.
In general - it depends on what user needs, this is not a question for modbus API.
from plugins_spindle.
I did not add the async timeout callback since I did not (and still do not) have a clear idea how to handle it at the client side.
BTW my plan is to move the RTU code to the core to make the API generally available, not bound to the spindle plugin.
from plugins_spindle.
Related Issues (18)
- modbus is a universal interface? HOT 2
- Spindle load feedback with multiple spindles HOT 8
- Speed tolerance based on present speed instead of top speed HOT 1
- Spindle speed tolerance limits math
- Huanyang FC01 VFD (new model) HOT 7
- Spindle refactoring, issue with original Huanyang logic HOT 10
- Move modbus code to separate folder? HOT 18
- RP2040 Locks When Parameters are Printed with Modbus Added HOT 1
- VFD as default spindle ($395) does not expose VFD settings HOT 5
- H100 VFD HOT 7
- $465 and $466 HOT 5
- error in code modvfd.c HOT 1
- Stream claiming logic with MODBUS_RTU_STREAM defined HOT 4
- modbus_rtu receives zero length packet HOT 1
- Stepper Spindle Enable signal to be isolated from axis enable HOT 8
- AC Servo Spindle HOT 4
- Spindle RPM override not taking effect. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugins_spindle.