GE1x Series Gripper
The GE1x series grippers, such as the GE11 gripper, are a series of third-party grippers that are sold by Zaber and supported by Zaber Motion Library.
The GE1x series has two methods of control:
- Movement and configuration can be controlled using a USB/Serial connection
- Movement can be controlled using digital I/O
Zaber Motion Library allows you to control movement and configuration using USB/Serial directly. By connecting a GE1x series gripper to an X-MCC or other Zaber device with digital I/O, you can also control the gripper using the digital I/O of that Zaber device.
For information on how to connect to a GE1x series gripper, see the setup guide.
USB/Serial Control
Using a USB/Serial connection is the best way to control and configure a GE1x series gripper if you don't need precise coordinated motion and are able to make the physical USB/Serial connection to the gripper. This type of connection has the most functionality and is the easiest to get started with.
To open a connection to a gripper, first identify the port name that it is connected to. Then, open a connection:
with Ge1xGripper.open_connection("COM3") as gripper:
print("Connected to gripper!")
const gripper = await Ge1xGripper.openConnection('COM3');
try {
console.log('Connected to gripper!');
// ...
} finally {
await gripper.close();
}
using (var gripper = Ge1xGripper.OpenConnection("COM3"))
{
Console.WriteLine("Connected to gripper!");
// ...
}
try (Ge1xGripper gripper = Ge1xGripper.openConnection("COM3")) {
System.out.println("Connected to gripper!");
// ...
}
gripper = Ge1xGripper.openConnection('COM3');
try
fprintf('Connected to gripper!\n');
% ...
gripper.close();
catch exception
gripper.close();
rethrow(exception);
end
gripperDevice = Ge1xGripper.openConnection('COM3');
try
fprintf('Connected to gripper!\n');
% ...
gripperDevice.close();
catch exception
gripperDevice.close();
rethrow(exception);
end
Ge1xGripper gripper = Ge1xGripper::openConnection("COM3");
std::cout << "Connected to gripper!" << std::endl;
let gripper = try await Ge1xGripper.openConnection(portName: "COM3")
print("Connected to gripper!")
Movement
Before moving a gripper, it must be homed. Homing ensures that the gripper knows its current position by moving to one end of travel and detecting resistance:
gripper.home()
print(f"Gripper is homed: {gripper.is_homed()}")
await gripper.home();
console.log(`Gripper is homed: ${await gripper.isHomed()}`);
gripper.Home();
Console.WriteLine($"Gripper is homed: {gripper.IsHomed()}");
gripper.home();
System.out.println(String.format("Gripper is homed: %b", gripper.isHomed()));
gripper.home();
fprintf('Gripper is homed: %d\n', gripper.isHomed());
gripperDevice.home();
fprintf('Gripper is homed: %d\n', gripperDevice.isHomed());
gripper.home();
std::cout << "Gripper is homed: " << gripper.isHomed() << std::endl;
try await gripper.home()
print("Gripper is homed: \(try await gripper.isHomed())")
A gripper can be moved to the closed position, the open position, or to a percentage representing the position from 0 (closed) to 100 (open). Movement functions return only after the movement completes, but this can be optionally overridden by setting waitUntilIdle to false:
gripper.move_close()
gripper.move_open(wait_until_idle=False)
gripper.move(42.2)
await gripper.moveClose();
await gripper.moveOpen({ waitUntilIdle: false });
await gripper.move(42.2);
gripper.MoveClose();
gripper.MoveOpen(waitUntilIdle: false);
gripper.Move(42.2);
gripper.moveClose();
gripper.moveOpen(false);
gripper.move(42.2);
gripper.moveClose();
gripper.moveOpen(false);
gripper.move(42.2);
gripperDevice.moveClose();
gripperDevice.moveOpen(waitUntilIdle=false);
gripperDevice.move(42.2);
gripper.moveClose();
gripper.moveOpen(false);
gripper.move(42.2);
try await gripper.moveClose()
try await gripper.moveOpen(waitUntilIdle: false)
try await gripper.move(position: 42.2)
The force and speed can be set as a percentage. The values apply to every move until the gripper is powered off:
gripper.set_force(50)
gripper.set_speed(25)
gripper.move_close()
await gripper.setForce(50);
await gripper.setSpeed(25);
await gripper.moveClose();
gripper.SetForce(50);
gripper.SetSpeed(25);
gripper.MoveClose();
gripper.setForce(50);
gripper.setSpeed(25);
gripper.moveClose();
gripper.setForce(50);
gripper.setSpeed(25);
gripper.moveClose();
gripperDevice.setForce(50);
gripperDevice.setSpeed(25);
gripperDevice.moveClose();
gripper.setForce(50);
gripper.setSpeed(25);
gripper.moveClose();
try await gripper.setForce(force: 50)
try await gripper.setSpeed(speed: 25)
try await gripper.moveClose()
Configuration
Various settings can be set on the gripper. Settings are saved to flash and persist on power-off by default, unless otherwise specified:
# Disable auto home on power-up
gripper.set_auto_home(False)
# Change the home direction to close without saving to flash
gripper.set_home_direction(Ge1xGripperDirection.CLOSE, save_to_flash=False)
// Disable auto home on power-up
await gripper.setAutoHome(false);
// Change the home direction to close without saving to flash
await gripper.setHomeDirection(Ge1xGripperDirection.CLOSE, { saveToFlash: false });
// Disable auto home on power-up
gripper.SetAutoHome(false);
// Change the home direction to close without saving to flash
gripper.SetHomeDirection(Ge1xGripperDirection.Close, saveToFlash: false);
// Disable auto home on power-up
gripper.setAutoHome(false);
// Change the home direction to close without saving to flash
gripper.setHomeDirection(Ge1xGripperDirection.CLOSE, false);
% Disable auto home on power-up
gripper.setAutoHome(false);
% Change the home direction to close without saving to flash
gripper.setHomeDirection(Ge1xGripperDirection.CLOSE, false);
% Disable auto home on power-up
gripperDevice.setAutoHome(false);
% Change the home direction to close without saving to flash
gripperDevice.setHomeDirection(Ge1xGripperDirection.Close, saveToFlash=false);
// Disable auto home on power-up
gripper.setAutoHome(false);
// Change the home direction to close without saving to flash
gripper.setHomeDirection(Ge1xGripperDirection::CLOSE, false);
// Disable auto home on power-up
try await gripper.setAutoHome(enabled: false)
// Change the home direction to close without saving to flash
try await gripper.setHomeDirection(direction: Ge1xGripperDirection.close, saveToFlash: false)
The GE1x series gripper supports up to 4 presets that can be triggered via I/O or via the activatePreset method:
# Set preset 1 to open
gripper.set_preset(1, 100)
# Set preset 2 to close at half force
gripper.set_preset(2, 0, force=50)
# Set preset 3 to a middle position at half force and half speed
gripper.set_preset(3, 50, force=50, speed=50)
# Move the gripper to preset 2
gripper.activate_preset(2)
// Set preset 1 to open
await gripper.setPreset(1, 100);
// Set preset 2 to close at half force
await gripper.setPreset(2, 0, { force: 50 });
// Set preset 3 to a middle position at half force and half speed
await gripper.setPreset(3, 50, { force: 50, speed: 50 });
// Move the gripper to preset 2
await gripper.activatePreset(2);
// Set preset 1 to open
gripper.SetPreset(1, 100);
// Set preset 2 to close at half force
gripper.SetPreset(2, 0, force: 50);
// Set preset 3 to a middle position at half force and half speed
gripper.SetPreset(3, 50, force: 50, speed: 50);
// Move the gripper to preset 2
gripper.ActivatePreset(2);
// Set preset 1 to open
gripper.setPreset(1, 100);
// Set preset 2 to close at half force
gripper.setPreset(2, 0, 50);
// Set preset 3 to a middle position at half force and half speed
gripper.setPreset(3, 50, 50, 50);
// Move the gripper to preset 2
gripper.activatePreset(2);
% Set preset 1 to open
gripper.setPreset(1, 100);
% Set preset 2 to close at half force
gripper.setPreset(2, 0, 50);
% Set preset 3 to a middle position at half force and half speed
gripper.setPreset(3, 50, 50, 50);
% Move the gripper to preset 2
gripper.activatePreset(2);
% Set preset 1 to open
gripperDevice.setPreset(1, 100);
% Set preset 2 to close at half force
gripperDevice.setPreset(2, 0, force=50);
% Set preset 3 to a middle position at half force and half speed
gripperDevice.setPreset(3, 50, force=50, speed=50);
% Move the gripper to preset 2
gripperDevice.activatePreset(2);
// Set preset 1 to open
gripper.setPreset(1, 100);
// Set preset 2 to close at half force
gripper.setPreset(2, 0, 50);
// Set preset 3 to a middle position at half force and half speed
gripper.setPreset(3, 50, 50, 50);
// Move the gripper to preset 2
gripper.activatePreset(2);
// Set preset 1 to open
try await gripper.setPreset(presetNumber: 1, position: 100)
// Set preset 2 to close at half force
try await gripper.setPreset(presetNumber: 2, position: 0, force: 50)
// Set preset 3 to a middle position at half force and half speed
try await gripper.setPreset(presetNumber: 3, position: 50, force: 50, speed: 50)
// Move the gripper to preset 2
try await gripper.activatePreset(presetNumber: 2)
I/O Control
I/O control allows the gripper to be controlled via its 2 digital inputs. I/O control can be beneficial if you want to move the gripper as part of a Zaber controller's stream or PVT sequence, if you want to control the gripper using a Zaber controller without a separate USB/Serial connection, or if you want to control the gripper using a non-Zaber device. See the setup guide for more details.
First, configure the gripper for I/O control:
gripper.set_io_enabled(True)
# Set preset 1 to open
gripper.set_preset(1, 100)
# set preset 2 to close slowly
gripper.set_preset(2, 0, speed=10)
await gripper.setIoEnabled(true);
// Set preset 1 to open
await gripper.setPreset(1, 100);
// set preset 2 to close slowly
await gripper.setPreset(2, 0, { speed: 10 });
gripper.SetIoEnabled(true);
// Set preset 1 to open
gripper.SetPreset(1, 100);
// set preset 2 to close slowly
gripper.SetPreset(2, 0, speed: 10);
gripper.setIoEnabled(true);
// Set preset 1 to open
gripper.setPreset(1, 100);
// set preset 2 to close slowly
gripper.setPreset(2, 0, 100, 10, true);
gripper.setIoEnabled(true);
% Set preset 1 to open
gripper.setPreset(1, 100);
% set preset 2 to close slowly
gripper.setPreset(2, 0, 100, 10, true);
gripperDevice.setIoEnabled(true);
% Set preset 1 to open
gripperDevice.setPreset(1, 100);
% set preset 2 to close slowly
gripperDevice.setPreset(2, 0, speed=10);
gripper.setIoEnabled(true);
// Set preset 1 to open
gripper.setPreset(1, 100);
// set preset 2 to close slowly
gripper.setPreset(2, 0, 100, 10);
try await gripper.setIoEnabled(enabled: true)
// Set preset 1 to open
try await gripper.setPreset(presetNumber: 1, position: 100)
// set preset 2 to close slowly
try await gripper.setPreset(presetNumber: 2, position: 0, speed: 10)
Then, open a connection to the X-MCC and use it to drive the gripper's I/O:
with Connection.open_serial_port("COM4") as connection:
devices = connection.detect_devices()
mcc = devices[0]
preset_1 = [DigitalOutputAction.OFF, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP]
preset_2 = [DigitalOutputAction.ON, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP]
mcc.io.set_all_digital_outputs(preset_1)
time.sleep(2)
mcc.io.set_all_digital_outputs(preset_2)
const connection = await Connection.openSerialPort('COM4');
try {
const devices = await connection.detectDevices();
const mcc = devices[0];
const preset1 = [DigitalOutputAction.OFF, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP];
const preset2 = [DigitalOutputAction.ON, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP];
await mcc.io.setAllDigitalOutputs(preset1);
await new Promise((resolve) => setTimeout(resolve, 2000));
await mcc.io.setAllDigitalOutputs(preset2);
// ...
} finally {
await connection.close();
}
using (var connection = Connection.OpenSerialPort("COM4"))
{
var devices = connection.DetectDevices();
var mcc = devices[0];
var preset1 = new[] { DigitalOutputAction.Off, DigitalOutputAction.Off, DigitalOutputAction.Keep, DigitalOutputAction.Keep };
var preset2 = new[] { DigitalOutputAction.On, DigitalOutputAction.Off, DigitalOutputAction.Keep, DigitalOutputAction.Keep };
mcc.IO.SetAllDigitalOutputs(preset1);
Thread.Sleep(2000);
mcc.IO.SetAllDigitalOutputs(preset2);
// ...
}
try (Connection connection = Connection.openSerialPort("COM4")) {
Device[] devices = connection.detectDevices();
Device mcc = devices[0];
DigitalOutputAction[] preset1 = { DigitalOutputAction.OFF, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP };
DigitalOutputAction[] preset2 = { DigitalOutputAction.ON, DigitalOutputAction.OFF, DigitalOutputAction.KEEP, DigitalOutputAction.KEEP };
mcc.getIO().setAllDigitalOutputs(preset1);
Thread.sleep(2000);
mcc.getIO().setAllDigitalOutputs(preset2);
// ...
}
connection = Connection.openSerialPort('COM4');
try
devices = connection.detectDevices();
mcc = devices(1);
preset1 = javaArray('zaber.motion.ascii.DigitalOutputAction', 4);
preset1(1) = DigitalOutputAction.OFF;
preset1(2) = DigitalOutputAction.OFF;
preset1(3) = DigitalOutputAction.KEEP;
preset1(4) = DigitalOutputAction.KEEP;
preset2 = javaArray('zaber.motion.ascii.DigitalOutputAction', 4);
preset2(1) = DigitalOutputAction.ON;
preset2(2) = DigitalOutputAction.OFF;
preset2(3) = DigitalOutputAction.KEEP;
preset2(4) = DigitalOutputAction.KEEP;
mcc.getIO().setAllDigitalOutputs(preset1);
pause(2);
mcc.getIO().setAllDigitalOutputs(preset2);
% ...
connection.close();
catch exception
connection.close();
rethrow(exception);
end
connection = Connection.openSerialPort('COM4');
try
devices = connection.detectDevices();
mcc = devices(1);
preset1 = [DigitalOutputAction.Off, DigitalOutputAction.Off, DigitalOutputAction.Keep, DigitalOutputAction.Keep];
preset2 = [DigitalOutputAction.On, DigitalOutputAction.Off, DigitalOutputAction.Keep, DigitalOutputAction.Keep];
mcc.IO.setAllDigitalOutputs(preset1);
pause(2);
mcc.IO.setAllDigitalOutputs(preset2);
% ...
connection.close();
catch exception
connection.close();
rethrow(exception);
end
Connection connection = Connection::openSerialPort("COM4");
std::vector<Device> devices = connection.detectDevices();
Device mcc = devices[0];
std::vector<DigitalOutputAction> preset1 = { DigitalOutputAction::OFF, DigitalOutputAction::OFF, DigitalOutputAction::KEEP, DigitalOutputAction::KEEP };
std::vector<DigitalOutputAction> preset2 = { DigitalOutputAction::ON, DigitalOutputAction::OFF, DigitalOutputAction::KEEP, DigitalOutputAction::KEEP };
mcc.getIO().setAllDigitalOutputs(preset1);
std::this_thread::sleep_for(std::chrono::seconds(2));
mcc.getIO().setAllDigitalOutputs(preset2);
let connection = try await Connection.openSerialPort(portName: "COM4")
let devices = try await connection.detectDevices()
let mcc = devices[0]
let preset1: [DigitalOutputAction] = [.off, .off, .keep, .keep]
let preset2: [DigitalOutputAction] = [.on, .off, .keep, .keep]
try await mcc.io.setAllDigitalOutputs(values: preset1)
try await Task.sleep(nanoseconds: 2_000_000_000)
try await mcc.io.setAllDigitalOutputs(values: preset2)
To control the gripper as part of a PVT sequence with one or more movable axes, I/O actions on the Zaber controller can be interleaved with PVT points:
sequence = mcc.pvt.get_sequence(1)
sequence.setup_live(1)
sequence.submit_sequence_data([
PvtPoint(
positions=[Measurement(10, Units.LENGTH_MILLIMETRES)],
velocities=[Measurement(5, Units.VELOCITY_MILLIMETRES_PER_SECOND)],
time=Measurement(1, Units.TIME_SECONDS),
relative=False,
),
PvtSetAllDigitalOutputsAction(values=preset_1),
PvtPoint(
positions=[Measurement(0, Units.LENGTH_MILLIMETRES)],
velocities=[Measurement(0, Units.VELOCITY_MILLIMETRES_PER_SECOND)],
time=Measurement(1, Units.TIME_SECONDS),
relative=False,
),
])
const sequence = mcc.pvt.getSequence(1);
await sequence.setupLive(1);
await sequence.submitSequenceData([
{
positions: [{ value: 10, unit: Length.mm }],
velocities: [{ value: 5, unit: Velocity.MILLIMETRES_PER_SECOND }],
time: { value: 1, unit: Time.s },
relative: false,
},
{ values: preset1 },
{
positions: [{ value: 0, unit: Length.mm }],
velocities: [{ value: 0, unit: Velocity.MILLIMETRES_PER_SECOND }],
time: { value: 1, unit: Time.s },
relative: false,
},
]);
var sequence = mcc.Pvt.GetSequence(1);
sequence.SetupLive(1);
sequence.SubmitSequenceData(new PvtSequenceItem[] {
new PvtPoint {
Positions = new[] { new Measurement { Value = 10, Unit = Units.Length_Millimetres } },
Velocities = new[] { new Measurement { Value = 5, Unit = Units.Velocity_MillimetresPerSecond } },
Time = new Measurement { Value = 1, Unit = Units.Time_Seconds },
Relative = false,
},
new PvtSetAllDigitalOutputsAction { Values = preset1 },
new PvtPoint {
Positions = new[] { new Measurement { Value = 0, Unit = Units.Length_Millimetres } },
Velocities = new[] { new Measurement { Value = 0, Unit = Units.Velocity_MillimetresPerSecond } },
Time = new Measurement { Value = 1, Unit = Units.Time_Seconds },
Relative = false,
},
});
PvtSequence sequence = mcc.getPvt().getSequence(1);
sequence.setupLive(1);
sequence.submitSequenceData(new PvtSequenceItem[] {
new PvtSequenceItem(new PvtPoint(
new Measurement[] { new Measurement(10, Units.LENGTH_MILLIMETRES) },
new Measurement[] { new Measurement(5, Units.VELOCITY_MILLIMETRES_PER_SECOND) },
new Measurement(1, Units.TIME_SECONDS),
false
)),
new PvtSequenceItem(new PvtSetAllDigitalOutputsAction(preset1)),
new PvtSequenceItem(new PvtPoint(
new Measurement[] { new Measurement(0, Units.LENGTH_MILLIMETRES) },
new Measurement[] { new Measurement(0, Units.VELOCITY_MILLIMETRES_PER_SECOND) },
new Measurement(1, Units.TIME_SECONDS),
false
)),
});
sequence = mcc.getPvt().getSequence(1);
sequence.setupLive(1);
point1Positions = javaArray('zaber.motion.Measurement', 1);
point1Positions(1) = Measurement(10, Units.LENGTH_MILLIMETRES);
point1Velocities = javaArray('zaber.motion.Measurement', 1);
point1Velocities(1) = Measurement(5, Units.VELOCITY_MILLIMETRES_PER_SECOND);
point2Positions = javaArray('zaber.motion.Measurement', 1);
point2Positions(1) = Measurement(0, Units.LENGTH_MILLIMETRES);
point2Velocities = javaArray('zaber.motion.Measurement', 1);
point2Velocities(1) = Measurement(0, Units.VELOCITY_MILLIMETRES_PER_SECOND);
items = javaArray('zaber.motion.ascii.PvtSequenceItem', 3);
items(1) = PvtSequenceItem(PvtPoint(point1Positions, point1Velocities, Measurement(1, Units.TIME_SECONDS), false));
items(2) = PvtSequenceItem(PvtSetAllDigitalOutputsAction(preset1));
items(3) = PvtSequenceItem(PvtPoint(point2Positions, point2Velocities, Measurement(1, Units.TIME_SECONDS), false));
sequence.submitSequenceData(items);
sequence = mcc.Pvt.getSequence(1);
sequence.setupLive(1);
point1 = PvtPoint();
point1.Positions = [Measurement(10, Units.LENGTH_MILLIMETRES)];
point1.Velocities = [Measurement(5, Units.VELOCITY_MILLIMETRES_PER_SECOND)];
point1.Time = Measurement(1, Units.TIME_SECONDS);
point1.Relative = false;
action = PvtSetAllDigitalOutputsAction();
action.Values = preset1;
point2 = PvtPoint();
point2.Positions = [Measurement(0, Units.LENGTH_MILLIMETRES)];
point2.Velocities = [Measurement(0, Units.VELOCITY_MILLIMETRES_PER_SECOND)];
point2.Time = Measurement(1, Units.TIME_SECONDS);
point2.Relative = false;
sequence.submitSequenceData([PvtSequenceItem(point1), PvtSequenceItem(action), PvtSequenceItem(point2)]);
PvtSequence sequence = mcc.getPvt().getSequence(1);
sequence.setupLive({1});
sequence.submitSequenceData({
PvtPoint(
{ Measurement(10, Units::LENGTH_MILLIMETRES) },
{ Measurement(5, Units::VELOCITY_MILLIMETRES_PER_SECOND) },
Measurement(1, Units::TIME_SECONDS),
false
),
PvtSetAllDigitalOutputsAction(preset1),
PvtPoint(
{ Measurement(0, Units::LENGTH_MILLIMETRES) },
{ Measurement(0, Units::VELOCITY_MILLIMETRES_PER_SECOND) },
Measurement(1, Units::TIME_SECONDS),
false
),
});
let sequence = try mcc.pvt.getSequence(pvtId: 1)
try await sequence.setupLive(1)
try await sequence.submitSequenceData(sequenceData: [
.pvtPoint(PvtPoint(
positions: [Measurement(value: 10, unit: Units.lengthMillimetres)],
velocities: [Measurement(value: 5, unit: Units.velocityMillimetresPerSecond)],
time: Measurement(value: 1, unit: Units.timeSeconds),
relative: false
)),
.pvtSetAllDigitalOutputsAction(PvtSetAllDigitalOutputsAction(values: preset1)),
.pvtPoint(PvtPoint(
positions: [Measurement(value: 0, unit: Units.lengthMillimetres)],
velocities: [Measurement(value: 0, unit: Units.velocityMillimetresPerSecond)],
time: Measurement(value: 1, unit: Units.timeSeconds),
relative: false
))
])
The gripper also outputs its current state over 2 digital output pins. These can be read by an X-MCC like so:
gripper_state = mcc.io.get_all_digital_inputs()[:2]
if gripper_state == [False, False]:
print("Gripper State: Object Dropped")
elif gripper_state == [False, True]:
print("Gripper State: Idle")
elif gripper_state == [True, False]:
print("Gripper State: Object Detected")
elif gripper_state == [True, True]:
print("Gripper State: Moving")
const digitalInputState = await mcc.io.getAllDigitalInputs();
if (digitalInputState[0] === false && digitalInputState[1] === false) {
console.log('Gripper State: Object Dropped');
} else if (digitalInputState[0] === false && digitalInputState[1] === true) {
console.log('Gripper State: Idle');
} else if (digitalInputState[0] === true && digitalInputState[1] === false) {
console.log('Gripper State: Object Detected');
} else if (digitalInputState[0] === true && digitalInputState[1] === true) {
console.log('Gripper State: Moving');
}
var digitalInputState = mcc.IO.GetAllDigitalInputs();
if (digitalInputState[0] == false && digitalInputState[1] == false)
{
Console.WriteLine("Gripper State: Object Dropped");
}
else if (digitalInputState[0] == false && digitalInputState[1] == true)
{
Console.WriteLine("Gripper State: Idle");
}
else if (digitalInputState[0] == true && digitalInputState[1] == false)
{
Console.WriteLine("Gripper State: Object Detected");
}
else if (digitalInputState[0] == true && digitalInputState[1] == true)
{
Console.WriteLine("Gripper State: Moving");
}
boolean[] digitalInputState = mcc.getIO().getAllDigitalInputs();
if (digitalInputState[0] == false && digitalInputState[1] == false) {
System.out.println("Gripper State: Object Dropped");
} else if (digitalInputState[0] == false && digitalInputState[1] == true) {
System.out.println("Gripper State: Idle");
} else if (digitalInputState[0] == true && digitalInputState[1] == false) {
System.out.println("Gripper State: Object Detected");
} else if (digitalInputState[0] == true && digitalInputState[1] == true) {
System.out.println("Gripper State: Moving");
}
allInputs = mcc.getIO().getAllDigitalInputs();
gripperState = [allInputs(1), allInputs(2)];
if isequal(gripperState, [false, false])
fprintf('Gripper State: Object Dropped\n');
elseif isequal(gripperState, [false, true])
fprintf('Gripper State: Idle\n');
elseif isequal(gripperState, [true, false])
fprintf('Gripper State: Object Detected\n');
elseif isequal(gripperState, [true, true])
fprintf('Gripper State: Moving\n');
end
allInputs = mcc.IO.getAllDigitalInputs();
gripperState = [allInputs(1), allInputs(2)];
if isequal(gripperState, [false, false])
fprintf('Gripper State: Object Dropped\n');
elseif isequal(gripperState, [false, true])
fprintf('Gripper State: Idle\n');
elseif isequal(gripperState, [true, false])
fprintf('Gripper State: Object Detected\n');
elseif isequal(gripperState, [true, true])
fprintf('Gripper State: Moving\n');
end
std::vector<bool> digitalInputState = mcc.getIO().getAllDigitalInputs();
if (digitalInputState[0] == false && digitalInputState[1] == false) {
std::cout << "Gripper State: Object Dropped" << std::endl;
} else if (digitalInputState[0] == false && digitalInputState[1] == true) {
std::cout << "Gripper State: Idle" << std::endl;
} else if (digitalInputState[0] == true && digitalInputState[1] == false) {
std::cout << "Gripper State: Object Detected" << std::endl;
} else if (digitalInputState[0] == true && digitalInputState[1] == true) {
std::cout << "Gripper State: Moving" << std::endl;
}
let digitalInputState = try await mcc.io.getAllDigitalInputs()
if digitalInputState[0] == false && digitalInputState[1] == false {
print("Gripper State: Object Dropped")
} else if digitalInputState[0] == false && digitalInputState[1] == true {
print("Gripper State: Idle")
} else if digitalInputState[0] == true && digitalInputState[1] == false {
print("Gripper State: Object Detected")
} else if digitalInputState[0] == true && digitalInputState[1] == true {
print("Gripper State: Moving")
}
Resources
- GE1x Series Setup Guide
- API Reference