Coder Social home page Coder Social logo

Comments (5)

terjeio avatar terjeio commented on June 30, 2024

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.

Nick507 avatar Nick507 commented on June 30, 2024

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.

terjeio avatar terjeio commented on June 30, 2024

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.

Nick507 avatar Nick507 commented on June 30, 2024

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.

terjeio avatar terjeio commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.