Hi,
Intern here, trying to make the LEDs work on iiwa R820 (Flange Touch Pneumatic).
* All is configured in WV and exported back to the project.
* I can turn on/off all three LEDs on the smartpad, so the I/O setup must be working.
* When calling the setLEDColor in the program, I get this exception error on the smartpad:
Level Content
-----------------------------------------------------------
[Error] Stopping task due to the following error:
java.lang.NullPointerException
at com.kuka.roboticsAPI.ioModel.Output.SendRequest
(Output.java.171)
at
com.kuka.roboticsAPI.ioModel.Output.setBooleanValue
(Output.java.129)
at
com.kuka.roboticsAPI.ioModel.AbstractIOGroup.setDigitalOutput
(AbstractIOGroup.java:198)
at com.kuka.generated.ioAccess.LEDIOGroup.setLEDBlue
(LEDIOGroup.java:157)
at application.IO_02.run(IO_02.java:64)
Display More
This is my program (printing "First part" on the smartpad, then the above error message appears):
package application;
import javax.inject.Inject;
import com.kuka.common.ThreadUtil;
import com.kuka.generated.ioAccess.LEDIOGroup;
import com.kuka.generated.ioAccess.MediaFlangeIOGroup;
import com.kuka.generated.ioAccess.LEDIOGroup;
import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
import static com.kuka.roboticsAPI.motionModel.BasicMotions.*;
import com.kuka.roboticsAPI.controllerModel.Controller;
import com.kuka.roboticsAPI.deviceModel.LBR;
public class IO_02 extends RoboticsAPIApplication {
@Inject
private LBR lBR_iiwa_14_R820_1;
private Controller controller;
private LEDIOGroup LEDIO;
@Override
public void initialize() {
// initialize your application here
LEDIO = new LEDIOGroup(controller);
}
@Override
public void run() {
// -------------------------------------------
getLogger().info("First part");
LEDIO.setLEDBlue(true);
}
}
Display More
Attached is a screenshot of my project setup.
Please, can anyone help?
I really am stuck here, been trying to solve this for two days now.
From my perspective, the program looks exactly like what the manual says it should...
//Daniel
::EDIT::
I have come as far as understanding that the program doesn't like what is on line 157 in LEDIOGroup.java .
Below is the code from that, but the exact line says "setDigitalOutput("LEDBlue", value);".
In context it looks like this:
Here is the entire LEDIOGroup code:
package com.kuka.generated.ioAccess;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.kuka.roboticsAPI.controllerModel.Controller;
import com.kuka.roboticsAPI.ioModel.AbstractIOGroup;
import com.kuka.roboticsAPI.ioModel.IOTypes;
/**
* Automatically generated class to abstract I/O access to I/O group <b>LED</b>.<br>
* <i>Please, do not modify!</i>
* <p>
* <b>I/O group description:</b><br>
* ./.
*/
@Singleton
public class LEDIOGroup extends AbstractIOGroup
{
/**
* Constructor to create an instance of class 'LED'.<br>
* <i>This constructor is automatically generated. Please, do not modify!</i>
*
* @param controller
* the controller, which has access to the I/O group 'LED'
*/
@Inject
public LEDIOGroup(Controller controller)
{
super(controller, "LED");
addDigitalOutput("LEDGreen", IOTypes.BOOLEAN, 1);
addDigitalOutput("LEDRed", IOTypes.BOOLEAN, 1);
addDigitalOutput("LEDBlue", IOTypes.BOOLEAN, 1);
}
/**
* Gets the value of the <b>digital output '<i>LEDGreen</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @return current value of the digital output 'LEDGreen'
*/
public boolean getLEDGreen()
{
return getBooleanIOValue("LEDGreen", true);
}
/**
* Sets the value of the <b>digital output '<i>LEDGreen</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @param value
* the value, which has to be written to the digital output 'LEDGreen'
*/
public void setLEDGreen(java.lang.Boolean value)
{
setDigitalOutput("LEDGreen", value);
}
/**
* Gets the value of the <b>digital output '<i>LEDRed</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @return current value of the digital output 'LEDRed'
*/
public boolean getLEDRed()
{
return getBooleanIOValue("LEDRed", true);
}
/**
* Sets the value of the <b>digital output '<i>LEDRed</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @param value
* the value, which has to be written to the digital output 'LEDRed'
*/
public void setLEDRed(java.lang.Boolean value)
{
setDigitalOutput("LEDRed", value);
}
/**
* Gets the value of the <b>digital output '<i>LEDBlue</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @return current value of the digital output 'LEDBlue'
*/
public boolean getLEDBlue()
{
return getBooleanIOValue("LEDBlue", true);
}
/**
* Sets the value of the <b>digital output '<i>LEDBlue</i>'</b>.<br>
* <i>This method is automatically generated. Please, do not modify!</i>
* <p>
* <b>I/O direction and type:</b><br>
* digital output
* <p>
* <b>User description of the I/O:</b><br>
* ./.
* <p>
* <b>Range of the I/O value:</b><br>
* [false; true]
*
* @param value
* the value, which has to be written to the digital output 'LEDBlue'
*/
public void setLEDBlue(java.lang.Boolean value)
{
setDigitalOutput("LEDBlue", value);
}
}
Display More
As said before, it seems weird that I can toggle all three colors from the smartpad (from the group LEDIO), but not call the same commands from the program.
::EDIT_2::
Attached is an image of the sub classes to com.kuka.roboticsAPI.ioModel.
Could this be the culprit? I don't know why it's red, but to me that indicates a broken package.
I uninstalled KSWB, rebooted, updated Java, reinstalled KSWB and still the same problem.
Any ideas?