气动元件#
介绍#
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;.
类构造函数#
pneumatic(
int32_t index );
类析构函数#
Destroys the pneumatic object and releases associated resources.
~pneumatic();
参数#
范围 |
类型 |
描述 |
|---|---|---|
|
|
CTE气动电磁阀所连接的智能端口(例如,PORT1)。 |
笔记#
CTE气动指令只能与CTE气动部件配合使用。
You must manually import the CTE module:
using namespace cte;.该系统可以单独控制最多 4 个气缸,也可以同时控制所有气缸。
例子#
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);
成员功能#
延长#
伸出气缸。
Available Functionsvoid extend(
cylinderType id );
范围 |
类型 |
描述 |
|---|---|---|
|
|
The cylinder to extend:
|
此函数不返回值。
Examples// Extend cylinder 1
ctePneumatic1.extend(cylinder1);
// Extend all cylinders
ctePneumatic1.extend(cylinderAll);
缩回#
缩回气缸。
Available Functionsvoid retract(
cylinderType id );
范围 |
类型 |
描述 |
|---|---|---|
|
|
The cylinder to retract:
|
此函数不返回值。
Examples// Retract cylinder 2
ctePneumatic1.retract(cylinder2);
// Retract all cylinders
ctePneumatic1.retract(cylinderAll);
泵开启#
启动气泵。
Available Functionsvoid pump_on();
此函数没有参数。
Return Values此函数不返回值。
Examples// Turn on the air pump
ctePneumatic1.pump_on();
泵关闭#
关闭气泵。
Available Functionsvoid pump_off();
此函数没有参数。
Return Values此函数不返回值。
Examples// Turn off the air pump
ctePneumatic1.pump_off();
泵#
控制气泵状态。
Available Functionsvoid pump(
bool state );
范围 |
类型 |
描述 |
|---|---|---|
|
|
The air pump state:
|
此函数不返回值。
Examples// Turn the pump on
ctePneumatic1.pump(true);
// Turn the pump off
ctePneumatic1.pump(false);
已安装#
返回 CTE 气动螺线管是否与大脑连接。
Available Functionsbool installed();
此函数没有参数。
Return Values返回一个布尔值,指示螺线管是否连接到大脑。
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();
}