Scrip for nozzle Tip Tray

119 views
Skip to first unread message

kevin

unread,
Oct 5, 2019, 9:00:40 AM10/5/19
to OpenPnP
Hi everybody

I have plan to build the nozzle tip tray with solenoid to lock and unlock the cover of nozzle tip tray. 
It means that before the nozzle tip changing, the solenoid will trigger to unlock the cover tray, and lock it again when finished.
I tried to test with the scrip as name below but nothing happen.

NozzleTip.BeforeLoad

NozzleTip.Loaded

NozzleTip.BeforeUnload

NozzleTip.Unloaded


Pls help to advise

Thank you
Kevin

spanner888

unread,
Oct 5, 2019, 9:21:55 AM10/5/19
to OpenPnP
Hi Kevin

Have you looked at OpenPnP log? Maybe turn on debug or trace levels. There should be entries there if the scripts are found in the script/event directories.

Please post your script/s and also confirm what directory they are located in.

It would also be good to give us an overview of the status of your build, eg moving, picking, pipelines OK etc.

Spanner

John

unread,
Oct 5, 2019, 9:25:09 AM10/5/19
to OpenPnP
Hi kevin,


I am using NozzleTop.Loaded.js (in /scripts/events) to run a actuator:


/* Script for action after NozzleTip loading */

load(scripting.getScriptsDirectory().toString() + '/Examples/JavaScript/Utility.js');

// Import some OpenPnP classes we'll use
var imports = new JavaImporter(org.openpnp.model, org.openpnp.util);

// Using the imports from above, do some work.
with (imports) {
  var l = head.getParkLocation();
  var c = head.getDefaultCamera();
  var act = head.getActuatorByName("Home-Z");
       
  // move to park location
  c.moveTo(l);

  // home Z (g-code)
  if (act) act.actuate(true);
}


John



Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

John

unread,
Oct 5, 2019, 12:31:16 PM10/5/19
to OpenPnP
Hi Kevin

  1. You click in OpenPnP at "Scripts" (it is a top menu item)
  2. Then click "Open Scripts Directory"
  3. Use a text-editor and copy/paste above code (blue lines) into a new file and save it in folder "Events" as "NozzleTip.Loaded.js"
  4. Finally you click "Refresh Scripts"

The script with ending ".js" is called javascript. But OpenPnP allows you to use python scripts too.


John
Reply all
Reply to author
Forward
0 new messages