Neumática#

Introducción#

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;.

Constructores de clases#

pneumatic( 
  int32_t index );

Instructor de clase#

Destroys the pneumatic object and releases associated resources.

~pneumatic();

Parámetros#

Parámetro

Tipo

Descripción

index

int32_t

El puerto inteligente al que está conectado el solenoide neumático CTE (por ejemplo, PORT1).

Notas#

  • Los comandos de CTE Pneumatic solo funcionarán con las piezas de CTE Pneumatic.

  • You must manually import the CTE module: using namespace cte;.

  • El sistema puede controlar hasta 4 cilindros individualmente o todos a la vez.

Ejemplo#

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);

Funciones de los miembros#

extender#

Extiende un cilindro neumático.

Available Functions
void extend( 
  cylinderType id );

Parameters

Parámetro

Tipo

Descripción

id

cylinderType

The cylinder to extend:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Esta función no devuelve ningún valor.

Examples
// Extend cylinder 1
ctePneumatic1.extend(cylinder1);

// Extend all cylinders
ctePneumatic1.extend(cylinderAll);

retraer#

Retrae un cilindro neumático.

Available Functions
void retract( 
  cylinderType id );

Parameters

Parámetro

Tipo

Descripción

id

cylinderType

The cylinder to retract:

  • cylinder1
  • cylinder2
  • cylinder3
  • cylinder4
  • cylinderAll – All 4 cylinders

Return Values

Esta función no devuelve ningún valor.

Examples
// Retract cylinder 2
ctePneumatic1.retract(cylinder2);

// Retract all cylinders
ctePneumatic1.retract(cylinderAll);

bomba encendida#

Enciende la bomba de aire.

Available Functions
void pump_on();

Parameters

Esta función no tiene parámetros.

Return Values

Esta función no devuelve ningún valor.

Examples
// Turn on the air pump
ctePneumatic1.pump_on();

bomba_apagada#

Apaga la bomba de aire.

Available Functions
void pump_off();

Parameters

Esta función no tiene parámetros.

Return Values

Esta función no devuelve ningún valor.

Examples
// Turn off the air pump
ctePneumatic1.pump_off();

bomba#

Controla el estado de la bomba de aire.

Available Functions
void pump( 
  bool state );

Parameters

Parámetro

Tipo

Descripción

state

bool

The air pump state:

  • true – Turn the air pump on
  • false – Turn the air pump off

Return Values

Esta función no devuelve ningún valor.

Examples
// Turn the pump on
ctePneumatic1.pump(true);

// Turn the pump off
ctePneumatic1.pump(false);

instalado#

Indica si el solenoide neumático CTE está conectado al cerebro.

Available Functions
bool installed();

Parameters

Esta función no tiene parámetros.

Return Values

Devuelve un valor booleano que indica si el solenoide está conectado al sistema de control o no.

  • true if the solenoid is connected to the Brain.

  • false if the solenoid is not connected to the Brain.

Examples
// Check if the pneumatic solenoid is connected
if (ctePneumatic1.installed()) {
  // Pneumatic system is ready
  ctePneumatic1.pump_on();
}