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 {
95 bool getBoolInput(uint32_t address);
113 int setBoolInput(uint32_t address,
bool value);
141 int getInt32Input(uint32_t address);
159 int setInt32Input(uint32_t address,
int value);
187 float getFloatInput(uint32_t address);
205 int setFloatInput(uint32_t address,
float value);
219 double getDoubleInput(uint32_t address);
237 int setDoubleInput(uint32_t address,
double value);
266 bool getBoolOutput(uint32_t address);
282 int setBoolOutput(uint32_t address,
bool value);
311 int getInt32Output(uint32_t address);
327 int setInt32Output(uint32_t address,
int value);
355 float getFloatOutput(uint32_t address);
371 int setFloatOutput(uint32_t address,
float value);
385 double getDoubleOutput(uint32_t address);
401 int setDoubleOutput(uint32_t address,
double value);
416 int16_t getInt16Register(uint32_t address);
432 int setInt16Register(uint32_t address, int16_t value);
440 bool hasNamedVariable(
const std::string &key);
448 std::string getNamedVariableType(
const std::string &key);
465 bool variableUpdated(
const std::string &key, uint64_t since);
481 bool getBool(
const std::string &key,
bool default_value);
497 int setBool(
const std::string &key,
bool value);
514 std::vector<char> getVecChar(
const std::string &key,
515 const std::vector<char> &default_value);
532 int setVecChar(
const std::string &key,
const std::vector<char> &value);
548 int getInt32(
const std::string &key,
int default_value);
564 int setInt32(
const std::string &key,
int value);
581 std::vector<int32_t> getVecInt32(
const std::string &key,
582 const std::vector<int32_t> &default_value);
599 int setVecInt32(
const std::string &key,
const std::vector<int32_t> &value);
616 float getFloat(
const std::string &key,
float default_value);
632 int setFloat(
const std::string &key,
float value);
649 std::vector<float> getVecFloat(
const std::string &key,
650 const std::vector<float> &default_value);
667 int setVecFloat(
const std::string &key,
const std::vector<float> &value);
684 double getDouble(
const std::string &key,
double default_value);
701 int setDouble(
const std::string &key,
double value);
718 std::vector<double> getVecDouble(
const std::string &key,
719 const std::vector<double> &default_value);
736 int setVecDouble(
const std::string &key,
const std::vector<double> &value);
752 std::string getString(
const std::string &key,
753 const std::string &default_value);
769 int setString(
const std::string &key,
const std::string &value);
784 int clearNamedVariable(
const std::string &key);
800 int setWatchDog(
const std::string &key,
double timeout,
int action);
808 int getWatchDogAction(
const std::string &key);
816 int getWatchDogTimeout(
const std::string &key);
893 int modbusAddSignal(
const std::string &device_info,
int slave_number,
894 int signal_address,
int signal_type,
895 const std::string &signal_name,
bool sequential_mode);
913 int modbusDeleteSignal(
const std::string &signal_name);
920 int modbusDeleteAllSignals();
942 int modbusGetSignalStatus(
const std::string &signal_name);
949 std::vector<std::string> modbusGetSignalNames();
956 std::vector<int> modbusGetSignalTypes();
963 std::vector<int> modbusGetSignalValues();
970 std::vector<int> modbusGetSignalErrors();
1049 int modbusSendCustomCommand(
const std::string &device_info,
1050 int slave_number,
int function_code,
1051 const std::vector<uint8_t> &data);
1077 int modbusSetDigitalInputAction(
const std::string &robot_name,
1078 const std::string &signal_name,
1089 int modbusSetOutputRunstate(
const std::string &robot_name,
1090 const std::string &signal_name,
1113 int modbusSetOutputSignal(
const std::string &signal_name, uint16_t value);
1135 int modbusSetOutputSignalPulse(
const std::string &signal_name,
1136 uint16_t value,
double duration);
1160 int modbusSetSignalUpdateFrequency(
const std::string &signal_name,
1161 int update_frequency);
1169 int modbusGetSignalIndex(
const std::string &signal_name);
1177 int modbusGetSignalError(
const std::string &signal_name);
1192 int getModbusDeviceStatus(
const std::string &device_name);
1200 #define RegisterControl_DECLARES \ 1201 _FUNC(RegisterControl, 1, getBoolInput, address) \ 1202 _INST(RegisterControl, 2, setBoolInput, address, value) \ 1203 _FUNC(RegisterControl, 1, getInt32Input, address) \ 1204 _INST(RegisterControl, 2, setInt32Input, address, value) \ 1205 _FUNC(RegisterControl, 1, getFloatInput, address) \ 1206 _INST(RegisterControl, 2, setFloatInput, address, value) \ 1207 _FUNC(RegisterControl, 1, getDoubleInput, address) \ 1208 _INST(RegisterControl, 2, setDoubleInput, address, value) \ 1209 _FUNC(RegisterControl, 1, getBoolOutput, address) \ 1210 _INST(RegisterControl, 2, setBoolOutput, address, value) \ 1211 _FUNC(RegisterControl, 1, getInt32Output, address) \ 1212 _INST(RegisterControl, 2, setInt32Output, address, value) \ 1213 _FUNC(RegisterControl, 1, getFloatOutput, address) \ 1214 _INST(RegisterControl, 2, setFloatOutput, address, value) \ 1215 _FUNC(RegisterControl, 1, getDoubleOutput, address) \ 1216 _INST(RegisterControl, 2, setDoubleOutput, address, value) \ 1217 _FUNC(RegisterControl, 1, getInt16Register, address) \ 1218 _INST(RegisterControl, 2, setInt16Register, address, value) \ 1219 _FUNC(RegisterControl, 2, variableUpdated, key, since) \ 1220 _FUNC(RegisterControl, 1, hasNamedVariable, key) \ 1221 _FUNC(RegisterControl, 1, getNamedVariableType, key) \ 1222 _FUNC(RegisterControl, 2, getBool, key, default_value) \ 1223 _INST(RegisterControl, 2, setBool, key, value) \ 1224 _FUNC(RegisterControl, 2, getVecChar, key, default_value) \ 1225 _INST(RegisterControl, 2, setVecChar, key, value) \ 1226 _FUNC(RegisterControl, 2, getInt32, key, default_value) \ 1227 _INST(RegisterControl, 2, setInt32, key, value) \ 1228 _FUNC(RegisterControl, 2, getVecInt32, key, default_value) \ 1229 _INST(RegisterControl, 2, setVecInt32, key, value) \ 1230 _FUNC(RegisterControl, 2, getFloat, key, default_value) \ 1231 _INST(RegisterControl, 2, setFloat, key, value) \ 1232 _FUNC(RegisterControl, 2, getVecFloat, key, default_value) \ 1233 _INST(RegisterControl, 2, setVecFloat, key, value) \ 1234 _FUNC(RegisterControl, 2, getDouble, key, default_value) \ 1235 _INST(RegisterControl, 2, setDouble, key, value) \ 1236 _FUNC(RegisterControl, 2, getVecDouble, key, default_value) \ 1237 _INST(RegisterControl, 2, setVecDouble, key, value) \ 1238 _FUNC(RegisterControl, 2, getString, key, default_value) \ 1239 _INST(RegisterControl, 2, setString, key, value) \ 1240 _INST(RegisterControl, 1, clearNamedVariable, key) \ 1241 _INST(RegisterControl, 3, setWatchDog, key, timeout, action) \ 1242 _FUNC(RegisterControl, 1, getWatchDogAction, key) \ 1243 _FUNC(RegisterControl, 1, getWatchDogTimeout, key) \ 1244 _INST(RegisterControl, 6, modbusAddSignal, device_info, slave_number, signal_address, signal_type, signal_name, sequential_mode) \ 1245 _INST(RegisterControl, 1, modbusDeleteSignal, signal_name) \ 1246 _INST(RegisterControl, 0, modbusDeleteAllSignals) \ 1247 _FUNC(RegisterControl, 1, modbusGetSignalStatus, signal_name) \ 1248 _FUNC(RegisterControl, 0, modbusGetSignalNames) \ 1249 _FUNC(RegisterControl, 0, modbusGetSignalTypes) \ 1250 _FUNC(RegisterControl, 0, modbusGetSignalValues) \ 1251 _FUNC(RegisterControl, 0, modbusGetSignalErrors) \ 1252 _INST(RegisterControl, 4, modbusSendCustomCommand, IP, slave_number, function_code, data) \ 1253 _INST(RegisterControl, 3, modbusSetDigitalInputAction, robot_name, signal_name, action) \ 1254 _INST(RegisterControl, 3, modbusSetOutputRunstate, robot_name, signal_name, runstate) \ 1255 _INST(RegisterControl, 2, modbusSetOutputSignal, signal_name, value) \ 1256 _INST(RegisterControl, 3, modbusSetOutputSignalPulse, signal_name, value, duration) \ 1257 _INST(RegisterControl, 2, modbusSetSignalUpdateFrequency, signal_name, update_frequency) \ 1258 _FUNC(RegisterControl, 1, modbusGetSignalIndex, signal_name) \ 1259 _FUNC(RegisterControl, 1, modbusGetSignalError, signal_name) \ 1260 _FUNC(RegisterControl, 1, getModbusDeviceStatus, device_name) 1265 #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)...