How do I go about this in the current version? What is the best stable version to download?
Is there a registration mechanism for these functions now and is this documented somewhere?
Thanks,
w
(*) the pause is needed when the robot runs out of tips and user needs to insert a full tip plate.
Thanks. I have not kept up with changes really in recent months - which of the changes require refactoring of the backends as well?
I implemented a Pause() in my backend and liquidhandler.py, but that is now in the old version. I have pegged that version as otherwise I end up debugging/rewriting my own stuff as well as PLR with every PLR change and lifeâs too short.
How is the âcore APIâ defined now, I had a quick peek but I donât see âALLOWED_CALLBACKSâ anymore. Ie. do I need to register or specify a Pause function in the current code somewhere, and where is that done now?
Sadly, the weekendâs just arrived - have a good one!
PS Should add - the pause literally stops the machine and passes on a message to display to the user, and they have to click âokâ. It is not an error, in that I tell the machine to pause, the machine does not tell me whatâs wrong.
I generate a list of commands in advance (as a file) and do not get interactive feedback - hence error handling might not apply here.
if you are asking about how to implement a pause in the script, there are numerous ways to do that. The easiest would be to have an input call in your protocol. I donât see how that is necessarily connected to PLR.
Regarding syncing changes, that is a choice when using open source software: do you contribute back and stay up to date with the main branch, or do you work on a diverging branch? up to the individual to decide
In my case, Pause() is a command and part of the accessible API, just like Aspirate(), Dispense(), DropTips() etc.
I have an asynchronous case where I produce a file with instructions, so it is literally a line in that file, and I need to produce it by calling the API function.
The old version pre-declared the API of accessible functions through ALLOWED_CALLBACKS I think? Is that still the case, and if so, where is that API (pre)defined?
Just doing the thought experiment of switching robots - this pause command should be robot agnostic ideally, but your suggestion of âimplementing it in a scriptâ is not?
for asynchronous waiting, you can just use await asyncio.sleep (or input for user input).
it should not be a backend method. backend methods are (aim to be) the minimal set of atomic commands (exposing all functionality of a machine at a level where they canât be split further)
if you have a program that writes âpauseâ lines to a file, you can do so from âuser-spaceâ
you mean it had a list of methods in a list of strings? that no longer exists
it wasnât complete, and didnât serve that purpose
you can look in the docs or use
[name for name, obj in inspect.getmembers(LiquidHandler, predicate=inspect.isfunction)]
pause is not a robot command. in fact i would say itâs the absence of commands.
since the plr api is interactive (send a command, it executes) (as opposed to queueing then dong all), just stop sending commands
the robot will stop doing work
â a âpauseâ command should not be part of the api
Hmm, Iâm afraid I disagree there. It is a robot command in this case unfortunately, and present in its API - it sends the head to a specified location (home, out of the way) so that the user can reach in and exchange a plate, eg. an empty tip plate; it displays a user-supplied message (like, âchange tip plateâ). I agree that this is not in the âatomicâ set of other robots which can communicate in real time.
Keep in mind this is one asynchronous - pylabrobot writes an instructions file, the file is run independently so any on-the-fly âsleepâ or wait action in real time wonât work. The command âpauseâ needs to be issued as a line in the instructions list, which is run sequentially on this SPT DC1 robot. Canât do it another wayâŚ
A way to register new and add to these atomic functions would be nice. That would allow for user-supplied ones alongside âcoreâ atomic functions. Can that be abstracted out? It would also allow for implementing higher level âshortcutsâ as well for specific applications, in the longer run, in a regimented way? (âpluginsâ, eg., for a concentration-response dispense across n wells action - it fosters reusability).
why not send the commands directly for execution (interactively) instead of writing to an intermediary file?
for backend specific functionality (since pause is not an atomic command, it will not be a frontend method), you can just call lh.backend.whatever() (this is a very common pattern, for example to get hamilton specific functionality on a star)
why not send the commands directly for execution (interactively) instead of writing to an intermediary file?
We literally have no way to do so currently. SPT Labtech ships software with the DC1 dispenser, which can import a file containing a list of commands (there are actually two file formats, and at least one of them will change following our feedback).
We have asked whether there is a more direct way and it seems that would involve a C# API. Unfortunately, life is too short to frustrate myself with C# alongside python.
for backend specific functionality (since pause is not an atomic command, it will not be a frontend method), you can just call lh.backend.whatever()
OK - thatâs what I ended up doing, but since I used an earlier version the CALLBACK requirement made me worry that I was missing something essential. Good to hear that has been simplified.
as long as the computer can communicate to the machine, you are able to replicate this yourself. Itâs just data over a wire. You can analyze this with wireshark and figure out how to send it from python.
It has not been simplified, this has literally been possible since day 1 of PLR, but nice to hear it works for you.
this is what i did for the STAR and many many other machines. Itâs a little more work up front, but definitely worth it for us. You can develop and iterate so much faster when you can use the machine interactively, you can literally have a notebook open and just develop a protocol step by step. Short iteration time (seconds) vs having to run whole scripts
plus humanidityâs solution âtreasure boxâ (i.e. Python ecosystem) available interactively
from ipywidgets for slider-accelerated parameter identification to real-time computer vision feedback of what is on your deck⌠there are no limitations in Python
Thanks. I take all these points, but as mentioned earlier - not an option.
Weâre users right now and experimentalists need this to work right now, ie. we do not have time to reinvent low-level interfaces we already pay the vendor for.
And yes, a vendor should provide these ideally, but in practice it is often proprietary information, plus potentially not well documented.
Ideally, vendors would agree on a shared interface/API for robot communication : say, a standardised ingestion of eg. JSON input; an outline format definition; and set of atomic functions, but we are far from that. PLR provides a placeholder for that but it is born from necessity.