Pneumatics#
Introduction#
The pneumatic class provides control for the CTE Pneumatic system, which uses an air pump and solenoid to control compressed air for moving cylinders. This class enables precise control of pneumatic actuators in automated workcell applications.
Note: CTE Pneumatic commands require the CTE module. Import it using using namespace cte;.
Class Constructors#
pneumatic(
int32_t index );
Class Destructor#
Destroys the pneumatic object and releases associated resources.
~pneumatic();
Parameters#
Parameter |
Type |
Description |
|---|---|---|
|
|
The Smart Port that the CTE Pneumatic Solenoid is connected to (e.g., PORT1). |
Notes#
CTE Pneumatic commands will only work with the CTE Pneumatic parts.
You must manually import the CTE module:
using namespace cte;.The system can control up to 4 cylinders individually or all at once.
Example#
using namespace cte;
// Create a CTE Pneumatic Solenoid in Port 1
pneumatic ctePneumatic1 = pneumatic(PORT1);
// Turn on the pump and extend cylinder 1
ctePneumatic1.pump_on();
ctePneumatic1.extend(cylinder1);
Member Functions#
extend#
Extends a pneumatic cylinder.
Available Functionsvoid extend(
cylinderType id );
Parameter |
Type |
Description |
|---|---|---|
|
|
The cylinder to extend:
|
This function does not return a value.
Examples// Extend cylinder 1
ctePneumatic1.extend(cylinder1);
// Extend all cylinders
ctePneumatic1.extend(cylinderAll);
retract#
Retracts a pneumatic cylinder.
Available Functionsvoid retract(
cylinderType id );
Parameter |
Type |
Description |
|---|---|---|
|
|
The cylinder to retract:
|
This function does not return a value.
Examples// Retract cylinder 2
ctePneumatic1.retract(cylinder2);
// Retract all cylinders
ctePneumatic1.retract(cylinderAll);
pump_on#
Turns the air pump on.
Available Functionsvoid pump_on();
This function does not have parameters.
Return ValuesThis function does not return a value.
Examples// Turn on the air pump
ctePneumatic1.pump_on();
pump_off#
Turns the air pump off.
Available Functionsvoid pump_off();
This function does not have parameters.
Return ValuesThis function does not return a value.
Examples// Turn off the air pump
ctePneumatic1.pump_off();
pump#
Controls the air pump state.
Available Functionsvoid pump(
bool state );
Parameter |
Type |
Description |
|---|---|---|
|
|
The air pump state:
|
This function does not return a value.
Examples// Turn the pump on
ctePneumatic1.pump(true);
// Turn the pump off
ctePneumatic1.pump(false);
installed#
Returns whether the CTE Pneumatic Solenoid is connected to the Brain.
Available Functionsbool installed();
This function does not have parameters.
Return ValuesReturns a Boolean indicating whether the solenoid is connected to the Brain or not.
trueif the solenoid is connected to the Brain.falseif the solenoid is not connected to the Brain.
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
// Pneumatic system is ready
ctePneumatic1.pump_on();
}