4 #ifndef AUBO_SDK_REGISTER_CONTROL_INTERFACE_H 5 #define AUBO_SDK_REGISTER_CONTROL_INTERFACE_H 12 #include <aubo/global_config.h> 58 namespace common_interface {
101 bool getBoolInput(uint32_t address);
125 int setBoolInput(uint32_t address,
bool value);
159 int getInt32Input(uint32_t address);
183 int setInt32Input(uint32_t address,
int value);
217 float getFloatInput(uint32_t address);
241 int setFloatInput(uint32_t address,
float value);
261 double getDoubleInput(uint32_t address);
285 int setDoubleInput(uint32_t address,
double value);
320 bool getBoolOutput(uint32_t address);
342 int setBoolOutput(uint32_t address,
bool value);
377 int getInt32Output(uint32_t address);
399 int setInt32Output(uint32_t address,
int value);
433 float getFloatOutput(uint32_t address);
455 int setFloatOutput(uint32_t address,
float value);
475 double getDoubleOutput(uint32_t address);
497 int setDoubleOutput(uint32_t address,
double value);
518 int16_t getInt16Register(uint32_t address);
540 int setInt16Register(uint32_t address, int16_t value);
555 bool hasNamedVariable(
const std::string &key);
570 std::string getNamedVariableType(
const std::string &key);
587 bool variableUpdated(
const std::string &key, uint64_t since);
609 bool getBool(
const std::string &key,
bool default_value);
631 int setBool(
const std::string &key,
bool value);
654 std::vector<char> getVecChar(
const std::string &key,
655 const std::vector<char> &default_value);
678 int setVecChar(
const std::string &key,
const std::vector<char> &value);
700 int getInt32(
const std::string &key,
int default_value);
722 int setInt32(
const std::string &key,
int value);
745 std::vector<int32_t> getVecInt32(
const std::string &key,
746 const std::vector<int32_t> &default_value);
769 int setVecInt32(
const std::string &key,
const std::vector<int32_t> &value);
792 float getFloat(
const std::string &key,
float default_value);
814 int setFloat(
const std::string &key,
float value);
837 std::vector<float> getVecFloat(
const std::string &key,
838 const std::vector<float> &default_value);
861 int setVecFloat(
const std::string &key,
const std::vector<float> &value);
884 double getDouble(
const std::string &key,
double default_value);
907 int setDouble(
const std::string &key,
double value);
930 std::vector<double> getVecDouble(
const std::string &key,
931 const std::vector<double> &default_value);
954 int setVecDouble(
const std::string &key,
const std::vector<double> &value);
976 std::string getString(
const std::string &key,
977 const std::string &default_value);
999 int setString(
const std::string &key,
const std::string &value);
1020 int clearNamedVariable(
const std::string &key);
1036 int setWatchDog(
const std::string &key,
double timeout,
int action);
1044 int getWatchDogAction(
const std::string &key);
1052 int getWatchDogTimeout(
const std::string &key);
1136 int modbusAddSignal(
const std::string &device_info,
int slave_number,
1137 int signal_address,
int signal_type,
1138 const std::string &signal_name,
bool sequential_mode);
1162 int modbusDeleteSignal(
const std::string &signal_name);
1176 int modbusDeleteAllSignals();
1204 int modbusGetSignalStatus(
const std::string &signal_name);
1218 std::vector<std::string> modbusGetSignalNames();
1232 std::vector<int> modbusGetSignalTypes();
1246 std::vector<int> modbusGetSignalValues();
1260 std::vector<int> modbusGetSignalErrors();
1345 int modbusSendCustomCommand(
const std::string &device_info,
1346 int slave_number,
int function_code,
1347 const std::vector<uint8_t> &data);
1379 int modbusSetDigitalInputAction(
const std::string &robot_name,
1380 const std::string &signal_name,
1398 int modbusSetOutputRunstate(
const std::string &robot_name,
1399 const std::string &signal_name,
1428 int modbusSetOutputSignal(
const std::string &signal_name, uint16_t value);
1456 int modbusSetOutputSignalPulse(
const std::string &signal_name,
1457 uint16_t value,
double duration);
1487 int modbusSetSignalUpdateFrequency(
const std::string &signal_name,
1488 int update_frequency);
1503 int modbusGetSignalIndex(
const std::string &signal_name);
1518 int modbusGetSignalError(
const std::string &signal_name);
1539 int getModbusDeviceStatus(
const std::string &device_name);
1547 #define RegisterControl_DECLARES \ 1548 _FUNC(RegisterControl, 1, getBoolInput, address) \ 1549 _INST(RegisterControl, 2, setBoolInput, address, value) \ 1550 _FUNC(RegisterControl, 1, getInt32Input, address) \ 1551 _INST(RegisterControl, 2, setInt32Input, address, value) \ 1552 _FUNC(RegisterControl, 1, getFloatInput, address) \ 1553 _INST(RegisterControl, 2, setFloatInput, address, value) \ 1554 _FUNC(RegisterControl, 1, getDoubleInput, address) \ 1555 _INST(RegisterControl, 2, setDoubleInput, address, value) \ 1556 _FUNC(RegisterControl, 1, getBoolOutput, address) \ 1557 _INST(RegisterControl, 2, setBoolOutput, address, value) \ 1558 _FUNC(RegisterControl, 1, getInt32Output, address) \ 1559 _INST(RegisterControl, 2, setInt32Output, address, value) \ 1560 _FUNC(RegisterControl, 1, getFloatOutput, address) \ 1561 _INST(RegisterControl, 2, setFloatOutput, address, value) \ 1562 _FUNC(RegisterControl, 1, getDoubleOutput, address) \ 1563 _INST(RegisterControl, 2, setDoubleOutput, address, value) \ 1564 _FUNC(RegisterControl, 1, getInt16Register, address) \ 1565 _INST(RegisterControl, 2, setInt16Register, address, value) \ 1566 _FUNC(RegisterControl, 2, variableUpdated, key, since) \ 1567 _FUNC(RegisterControl, 1, hasNamedVariable, key) \ 1568 _FUNC(RegisterControl, 1, getNamedVariableType, key) \ 1569 _FUNC(RegisterControl, 2, getBool, key, default_value) \ 1570 _INST(RegisterControl, 2, setBool, key, value) \ 1571 _FUNC(RegisterControl, 2, getVecChar, key, default_value) \ 1572 _INST(RegisterControl, 2, setVecChar, key, value) \ 1573 _FUNC(RegisterControl, 2, getInt32, key, default_value) \ 1574 _INST(RegisterControl, 2, setInt32, key, value) \ 1575 _FUNC(RegisterControl, 2, getVecInt32, key, default_value) \ 1576 _INST(RegisterControl, 2, setVecInt32, key, value) \ 1577 _FUNC(RegisterControl, 2, getFloat, key, default_value) \ 1578 _INST(RegisterControl, 2, setFloat, key, value) \ 1579 _FUNC(RegisterControl, 2, getVecFloat, key, default_value) \ 1580 _INST(RegisterControl, 2, setVecFloat, key, value) \ 1581 _FUNC(RegisterControl, 2, getDouble, key, default_value) \ 1582 _INST(RegisterControl, 2, setDouble, key, value) \ 1583 _FUNC(RegisterControl, 2, getVecDouble, key, default_value) \ 1584 _INST(RegisterControl, 2, setVecDouble, key, value) \ 1585 _FUNC(RegisterControl, 2, getString, key, default_value) \ 1586 _INST(RegisterControl, 2, setString, key, value) \ 1587 _INST(RegisterControl, 1, clearNamedVariable, key) \ 1588 _INST(RegisterControl, 3, setWatchDog, key, timeout, action) \ 1589 _FUNC(RegisterControl, 1, getWatchDogAction, key) \ 1590 _FUNC(RegisterControl, 1, getWatchDogTimeout, key) \ 1591 _INST(RegisterControl, 6, modbusAddSignal, device_info, slave_number, signal_address, signal_type, signal_name, sequential_mode) \ 1592 _INST(RegisterControl, 1, modbusDeleteSignal, signal_name) \ 1593 _INST(RegisterControl, 0, modbusDeleteAllSignals) \ 1594 _FUNC(RegisterControl, 1, modbusGetSignalStatus, signal_name) \ 1595 _FUNC(RegisterControl, 0, modbusGetSignalNames) \ 1596 _FUNC(RegisterControl, 0, modbusGetSignalTypes) \ 1597 _FUNC(RegisterControl, 0, modbusGetSignalValues) \ 1598 _FUNC(RegisterControl, 0, modbusGetSignalErrors) \ 1599 _INST(RegisterControl, 4, modbusSendCustomCommand, IP, slave_number, function_code, data) \ 1600 _INST(RegisterControl, 3, modbusSetDigitalInputAction, robot_name, signal_name, action) \ 1601 _INST(RegisterControl, 3, modbusSetOutputRunstate, robot_name, signal_name, runstate) \ 1602 _INST(RegisterControl, 2, modbusSetOutputSignal, signal_name, value) \ 1603 _INST(RegisterControl, 3, modbusSetOutputSignalPulse, signal_name, value, duration) \ 1604 _INST(RegisterControl, 2, modbusSetSignalUpdateFrequency, signal_name, update_frequency) \ 1605 _FUNC(RegisterControl, 1, modbusGetSignalIndex, signal_name) \ 1606 _FUNC(RegisterControl, 1, modbusGetSignalError, signal_name) \ 1607 _FUNC(RegisterControl, 1, getModbusDeviceStatus, device_name) 1612 #endif // AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
MODBUS unit disconnected.
Specialized use in conjunction with programming commands sent to the remote MODBUS unit...
Specialized use in conjunction with programming commands sent to the remote MODBUS unit...
StandardOutputRunState
标准输出运行状态
The function code received in the query is not an allowable action for the server (or slave)...
MODBUS unit not initiallized.
A value contained in the query data field is not an allowable value for server (or slave)...
An unrecoverable error occurred while the server (or slave) was attempting to perform the requested a...
std::shared_ptr< RegisterControl > RegisterControlPtr
StandardInputAction
The StandardInputAction enum.
The function code received in the query is not an allowable action for the server (or slave)...