4#ifndef AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
5#define AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
12#include <aubo/global_config.h>
58namespace common_interface {
1050 bool getBool(
const std::string &key,
bool default_value);
1140 const std::vector<char> &default_value);
1185 int setVecChar(
const std::string &key,
const std::vector<char> &value);
1229 int getInt32(
const std::string &key,
int default_value);
1319 const std::vector<int32_t> &default_value);
1364 int setVecInt32(
const std::string &key,
const std::vector<int32_t> &value);
1409 float getFloat(
const std::string &key,
float default_value);
1500 const std::vector<float> &default_value);
1545 int setVecFloat(
const std::string &key,
const std::vector<float> &value);
1590 double getDouble(
const std::string &key,
double default_value);
1681 const std::vector<double> &default_value);
1726 int setVecDouble(
const std::string &key,
const std::vector<double> &value);
1771 const std::string &default_value);
1815 int setString(
const std::string &key,
const std::string &value);
1992 int signal_address,
int signal_type,
1993 const std::string &signal_name,
bool sequential_mode);
2330 int slave_number,
int function_code,
2331 const std::vector<uint8_t> &data);
2383 const std::string &signal_name,
2419 const std::string &signal_name,
2514 uint16_t value,
double duration);
2560 int update_frequency);
2679 const std::string &signal_name);
2700 const std::string &key);
float getFloatOutput(uint32_t address)
从一个输出寄存器中读取浮点数,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setVecChar(const std::string &key, const std::vector< char > &value)
设置/更新变量值
int getInt32Output(uint32_t address)
从一个输出寄存器中读取整数值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setBool(const std::string &key, bool value)
设置/更新变量值
int deleteVirtualEncoder(int encoder_id)
删除虚拟编码器
int setVecFloat(const std::string &key, const std::vector< float > &value)
设置/更新变量值
int setVecInt32(const std::string &key, const std::vector< int32_t > &value)
设置/更新变量值
int getModbusDeviceStatus(const std::string &device_name)
获取指定 modbus 设备的连接状态
virtual ~RegisterControl()
bool getBoolInput(uint32_t address)
从一个输入寄存器中读取布尔值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
bool getBool(const std::string &key, bool default_value)
获取变量值
std::vector< double > getVecDouble(const std::string &key, const std::vector< double > &default_value)
获取变量值
int modbusDeleteAllSignals()
删除所有modbus信号
std::vector< int > modbusGetSignalErrors()
获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合
double getDoubleOutput(uint32_t address)
从一个输出寄存器中读取双精度浮点数。
std::vector< int32_t > getVecInt32(const std::string &key, const std::vector< int32_t > &default_value)
获取变量值
int modbusGetSignalIndex(const std::string &signal_name)
获取指定 modbus 信号索引,从0开始,不能存在则返回-1
int setInt32(const std::string &key, int value)
设置/更新变量值
std::vector< std::string > modbusGetSignalNames()
获取所有信号的名字集合
int modbusAddSignal(const std::string &device_info, int slave_number, int signal_address, int signal_type, const std::string &signal_name, bool sequential_mode)
添加一个新的Modbus信号以供控制器监视。不需要返回响应。
int getWatchDogTimeout(const std::string &key)
获取看门狗超时时间
int getInt32Input(uint32_t address)
从一个输入寄存器中读取整数值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setVecDouble(const std::string &key, const std::vector< double > &value)
设置/更新变量值
int setInt16Register(uint32_t address, int16_t value)
float getFloatInput(uint32_t address)
Reads the float from one of the input registers, which can also be accessed by a Field bus.
bool hasNamedVariable(const std::string &key)
具名变量是否存在
int getWatchDogAction(const std::string &key)
获取看门狗动作
std::string getNamedVariableType(const std::string &key)
获取具名变量的类型
std::vector< int > modbusGetSignalTypes()
获取所有信号的类型集合
int16_t getInt16Register(uint32_t address)
用于 Modbus Slave
int setInt32Input(uint32_t address, int value)
int getInt32(const std::string &key, int default_value)
获取变量值
int modbusSetOutputSignal(const std::string &signal_name, uint16_t value)
将指定名称的输出寄存器信号设置为给定的值
int setString(const std::string &key, const std::string &value)
设置/更新变量值
int modbusGetSignalError(const std::string &signal_name)
获取指定 modbus 信号的错误状态
int setFloat(const std::string &key, float value)
设置/更新变量值
int setDouble(const std::string &key, double value)
设置/更新变量值
int setWatchDog(const std::string &key, double timeout, int action)
设置看门狗
int modbusSetOutputRunstate(const std::string &robot_name, const std::string &signal_name, StandardOutputRunState runstate)
设置 Modbus 信号输出动作
int modbusSetOutputSignalPulse(const std::string &signal_name, uint16_t value, double duration)
设置modbus信号输出脉冲(仅支持线圈输出类型)
double getDouble(const std::string &key, double default_value)
获取变量值
bool getBoolOutput(uint32_t address)
从一个输出寄存器中读取布尔值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setDoubleOutput(uint32_t address, double value)
int modbusSendCustomCommand(const std::string &device_info, int slave_number, int function_code, const std::vector< uint8_t > &data)
将用户指定的命令发送到指定IP地址上的Modbus单元。 由于不会接收到响应,因此不能用于请求数据。 用户负责提供对所提供的功能码有意义的数据。 内置函数负责构建Modbus帧,因此用户不需要关心命令的...
bool variableUpdated(const std::string &key, uint64_t since)
具名变量是否更新
std::vector< float > getVecFloat(const std::string &key, const std::vector< float > &default_value)
获取变量值
std::vector< int > modbusGetSignalValues()
获取所有信号的数值集合
int addInt32RegEncoder(int encoder_id, int range_id, const std::string &key)
添加Int32寄存器的虚拟编码器
std::string getString(const std::string &key, const std::string &default_value)
获取变量值
int modbusGetSignalStatus(const std::string &signal_name)
读取特定信号的当前值。
int addModbusEncoder(int encoder_id, int range_id, const std::string &signal_name)
将某个 modbus 寄存器信号作为编码器
double getDoubleInput(uint32_t address)
从一个输入寄存器中读取双精度浮点数,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int clearNamedVariable(const std::string &key)
清除变量
int modbusSetSignalUpdateFrequency(const std::string &signal_name, int update_frequency)
设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值
int setBoolInput(uint32_t address, bool value)
int setInt32Output(uint32_t address, int value)
int setFloatInput(uint32_t address, float value)
int setBoolOutput(uint32_t address, bool value)
int modbusDeleteSignal(const std::string &signal_name)
删除指定名称的信号。
int setDoubleInput(uint32_t address, double value)
int setFloatOutput(uint32_t address, float value)
int modbusSetDigitalInputAction(const std::string &robot_name, const std::string &signal_name, StandardInputAction action)
将选择的数字输入信号设置为“default”或“freedrive”
std::vector< char > getVecChar(const std::string &key, const std::vector< char > &default_value)
获取变量值
float getFloat(const std::string &key, float default_value)
获取变量值
std::shared_ptr< RegisterControl > RegisterControlPtr
StandardInputAction
The StandardInputAction enum
StandardOutputRunState
标准输出运行状态
@ MB_ERR_NOT_INIT
MODBUS unit not initiallized
@ MB_ERR_SLAVE_DEVICE_BUSY
Specialized use in conjunction with programming commands sent to the remote MODBUS unit,...
@ MB_ERR_ILLEGAL_FUNCTION
The function code received in the query is not an allowable action for the server (or slave).
@ MB_ERR_ILLEGAL_DATA_ADDRESS
The function code received in the query is not an allowable action for the server (or slave),...
@ MB_ERR_DISCONNECTED
MODBUS unit disconnected
@ MB_ERR_SLAVE_DEVICE_FAILURE
An unrecoverable error occurred while the server (or slave) was attempting to perform the requested a...
@ MB_ERR_ILLEGAL_DATA_VALUE
A value contained in the query data field is not an allowable value for server (or slave),...
@ MB_ERR_ACKNOWLEDGE
Specialized use in conjunction with programming commands sent to the remote MODBUS unit.