blow.actuate(true); /* BLOW on */
print('waiting....'); /* any better way? Thread.sleep() is not available? */
for(i=0; i<100000; i++) {
j++;
}
blow.actuate(false); /* BLOW off */
That realtime synchronisation 'works', but obviously is not ideal. Any better way?I tried to use Thread.sleep(), but this was not availble?
function waitms(ms) {
var ms1 = new Date().getTime() + ms;
var loop = true;
while (loop) {
var ms2 = new Date().getTime();
if (ms2 > ms1) loop = false;
}
}
java.lang.Thread.sleep(100);
I use Gcode driver
java.lang.Thread.sleep(100);
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ba78dea6-250a-4296-b9f0-9a1f220b05c1%40googlegroups.com.
java.lang.Thread.sleep(100);
Thread.sleep(50)
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/78b06c3d-6792-4b52-8baf-284aea80c7a8%40googlegroups.com.
It's strange Erich, I always write only short Thread.sleep(value); and it works. But the fact is that all my scripts are .bsh, maybe it makes a difference so.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1b944aa0-cfb1-45a9-aac2-dace707db5f1%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/132aba72-56e2-439f-81b3-5633f8da7d80%40googlegroups.com.
Säli Erich
Marek may have an example. :-)
I was just speaking from a conceptual point. There are several places where OpenPNP currently uses a Thread sleep, where it should use a controller dwell instead.
It is currently irrelevant because OpenPNP waits for each command
to complete. But that is one of the reasons why OpenPNP is slow
compared to commercial PnPs. It should send commands to the
controller asynchronously and let the controller execute the
commands in sequence, in real-time, using a queue to decouple the
two systems and their latencies. The controller can execute a
move, then open a valve, then dwell a few milliseconds, then
measure the vacuum pressure etc. all in sequence and all decoupled
from OpenPNP (that might in turn be bogged down with optimizing
the next planner move, for instance). There are only very few
occasions, where the two need to be in sync. Actually I'm only
aware of one situation and that's when computer vision needs to
capture an image.
Some things can be done in overlaps, such sending the controller a command to read a vacuum value and then moving the nozzle to the next location. If the vacuum level turns out faulty, the move will have been in vain, but because this is a rare event, it is still a winner, overall.
https://en.wikipedia.org/wiki/Speculative_execution
So it was from this thought process, that I made my initial
remark here :-)
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAOT%3DhsDOorBGpmmuJGzdTUjb9xvT-_QmOXM2hiQjZA_CTRUU4g%40mail.gmail.com.