hi how are you, i'm working with a Kuka lbr iiwa robot and i'm trying to turn on the LED only in a part of the routine, i was reading about background tasks but i couldn't achieve it and i already tried to read the manual example but no it works, does anyone have an example or documentation on controlling this peripheral?
KUKA iiwa lbr 14
- Rigoberto
- Thread is Unresolved
-
-
using io and using background process are two different things.
about IO:
before you can use I/O, you need to make sure it is configured and mapped correctly using WorkVisual.
beware that you must ensure you are using correct version of WorkVisual (this is critical) and apply patch if version requires it. (check forum for details)
Code
Display Morepublic class demo_IO extends RoboticsAPIApplication { @Inject private LBR lBR; @Inject ECATIOGroup myIO; // inject IO group you created with WoV @Override public void initialize() { // initialize your application here } @Override public void run() { myIO.setO_05(false); // turn output 5 off myIO.setO_05(true); // turn output 5 on if (myIO.getI_01()){ getLogger().info("input 1 is TRUE"); } else { getLogger().info("input 1 is FALSE"); } }
about background task:
Java
Display Morepackage backgroundTask; import static com.kuka.roboticsAPI.motionModel.BasicMotions.ptp; import javax.inject.Inject; import java.util.concurrent.TimeUnit; //import com.kuka.generated.ioAccess.MediaFlangeIOGroup; import com.kuka.roboticsAPI.applicationModel.tasks.CycleBehavior; import com.kuka.roboticsAPI.applicationModel.tasks.RoboticsAPICyclicBackgroundTask; import com.kuka.roboticsAPI.controllerModel.Controller; import com.kuka.roboticsAPI.deviceModel.LBR; public class bg_iiwa_training_ik extends RoboticsAPICyclicBackgroundTask { @Inject private LBR lBR; //@Inject MediaFlangeIOGroup ioFLANGE; @Override public void initialize() { // initialize your task here initializeCyclic(0, TicToc, TimeUnit.MILLISECONDS, CycleBehavior.BestEffort); // setRGB(1); } @Override public void runCyclic() { // your task execution starts here } }
Create an account or sign in to comment
You need to be a member in order to leave a comment