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 {
1196 bool getBool(
const std::string &key,
bool default_value);
1298 const std::vector<char> &default_value);
1349 int setVecChar(
const std::string &key,
const std::vector<char> &value);
1399 int getInt32(
const std::string &key,
int default_value);
1501 const std::vector<int32_t> &default_value);
1552 int setVecInt32(
const std::string &key,
const std::vector<int32_t> &value);
1603 float getFloat(
const std::string &key,
float default_value);
1706 const std::vector<float> &default_value);
1757 int setVecFloat(
const std::string &key,
const std::vector<float> &value);
1808 double getDouble(
const std::string &key,
double default_value);
1911 const std::vector<double> &default_value);
1962 int setVecDouble(
const std::string &key,
const std::vector<double> &value);
2013 const std::string &default_value);
2063 int setString(
const std::string &key,
const std::string &value);
2252 int signal_address,
int signal_type,
2253 const std::string &signal_name,
bool sequential_mode);
2608 int slave_number,
int function_code,
2609 const std::vector<uint8_t> &data);
2667 const std::string &signal_name,
2703 const std::string &signal_name,
2810 uint16_t value,
double duration);
2862 int update_frequency);
2981 const std::string &signal_name);
3002 const std::string &key);
float getFloatOutput(uint32_t address)
Reads the float from one of the output registers, which can also be accessed by a FieldBus.
int setVecChar(const std::string &key, const std::vector< char > &value)
Set or update the variable value
int getInt32Output(uint32_t address)
Reads the integer from one of the output registers, which can also be accessed by a FieldBus.
int setBool(const std::string &key, bool value)
Set or update the variable value
int deleteVirtualEncoder(int encoder_id)
Delete virtual encoder
int setVecFloat(const std::string &key, const std::vector< float > &value)
Set or update the variable value
int setVecInt32(const std::string &key, const std::vector< int32_t > &value)
Set or update the variable value
int getModbusDeviceStatus(const std::string &device_name)
Get the connection status of the specified modbus device
virtual ~RegisterControl()
bool getBoolInput(uint32_t address)
Reads the boolean from one of the input registers, which can also be accessed by a Field bus.
bool getBool(const std::string &key, bool default_value)
Get variable value
std::vector< double > getVecDouble(const std::string &key, const std::vector< double > &default_value)
Get variable value
int modbusDeleteAllSignals()
Delete all modbus signals
std::vector< int > modbusGetSignalErrors()
Get the error status of all signal requests (0: no error, others: error) as a collection
double getDoubleOutput(uint32_t address)
Reads the double value from one of the output registers.
std::vector< int32_t > getVecInt32(const std::string &key, const std::vector< int32_t > &default_value)
Get variable value
int modbusGetSignalIndex(const std::string &signal_name)
Get the index of the specified modbus signal, starting from 0.
int setInt32(const std::string &key, int value)
Set or update the variable value
std::vector< std::string > modbusGetSignalNames()
Get the collection of all signal names
int modbusAddSignal(const std::string &device_info, int slave_number, int signal_address, int signal_type, const std::string &signal_name, bool sequential_mode)
Adds a new modbus signal for the controller to supervise.
int getWatchDogTimeout(const std::string &key)
Get the watchdog timeout value
int getInt32Input(uint32_t address)
Reads the integer from one of the input registers, which can also be accessed by a FieldBus.
int setVecDouble(const std::string &key, const std::vector< double > &value)
Set or update the variable 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)
Whether the named variable exists
int getWatchDogAction(const std::string &key)
Get the watchdog action
std::string getNamedVariableType(const std::string &key)
Get the type of a named variable
std::vector< int > modbusGetSignalTypes()
Get the collection of all signal types
int16_t getInt16Register(uint32_t address)
Used for Modbus Slave
int setInt32Input(uint32_t address, int value)
int getInt32(const std::string &key, int default_value)
Get variable value
int modbusSetOutputSignal(const std::string &signal_name, uint16_t value)
Sets the output register signal identified by the given name to the given value.
int setString(const std::string &key, const std::string &value)
Set or update the variable value
int modbusGetSignalError(const std::string &signal_name)
Get the error status of the specified modbus signal
int setFloat(const std::string &key, float value)
Set or update the variable value
int setDouble(const std::string &key, double value)
Set or update the variable value
int setWatchDog(const std::string &key, double timeout, int action)
Set the watchdog
int modbusSetOutputRunstate(const std::string &robot_name, const std::string &signal_name, StandardOutputRunState runstate)
Set Modbus signal output action
int modbusSetOutputSignalPulse(const std::string &signal_name, uint16_t value, double duration)
Set modbus signal output pulse (only supports coil output type)
double getDouble(const std::string &key, double default_value)
Get variable value
bool getBoolOutput(uint32_t address)
Reads the boolean from one of the output registers, which can also be accessed by a Field bus.
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)
Sends a command specified by the user to the modbus unit located on the specified IP address.
bool variableUpdated(const std::string &key, uint64_t since)
Whether the named variable has been updated
std::vector< float > getVecFloat(const std::string &key, const std::vector< float > &default_value)
Get variable value
std::vector< int > modbusGetSignalValues()
Get the collection of all signal values
int addInt32RegEncoder(int encoder_id, int range_id, const std::string &key)
Add a virtual encoder for an Int32 register
std::string getString(const std::string &key, const std::string &default_value)
Get variable value
int modbusGetSignalStatus(const std::string &signal_name)
Reads the current value of a specific signal.
int addModbusEncoder(int encoder_id, int range_id, const std::string &signal_name)
Use a modbus register signal as an encoder
double getDoubleInput(uint32_t address)
Reads the double value from one of the input registers, which can also be accessed by a FieldBus.
int clearNamedVariable(const std::string &key)
Clear variable
int modbusSetSignalUpdateFrequency(const std::string &signal_name, int update_frequency)
Sets the frequency with which the robot will send requests to the Modbus controller to either read or...
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)
Deletes the signal identified by the supplied 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)
Sets the selected digital input signal to either a "default" or "freedrive" action.
std::vector< char > getVecChar(const std::string &key, const std::vector< char > &default_value)
Get variable value
float getFloat(const std::string &key, float default_value)
Get variable value
std::shared_ptr< RegisterControl > RegisterControlPtr
StandardInputAction
The StandardInputAction enum.
StandardOutputRunState
Standard Output Run State.
@ 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.