16 #include "qextserialport.h"
40 FRONIUS_CMD_GET_VERSION = 0x01,
41 FRONIUS_CMD_GET_DEVICE_TYPE = 0x02,
42 FRONIUS_CMD_GET_DATE_TIME = 0x03,
43 FRONIUS_CMD_GET_ACTIVE_INVERTOR_NUMBER = 0x04,
44 FRONIUS_CMD_GET_POWER_NOW = 0x10,
45 FRONIUS_CMD_GET_ENERGY_TOTAL = 0x11,
46 FRONIUS_CMD_GET_ENERGY_DAY = 0x12,
47 FRONIUS_CMD_GET_ENERGY_YEAR = 0x13,
48 FRONIUS_CMD_GET_AC_CURRENT_NOW = 0x14,
49 FRONIUS_CMD_GET_AC_VOLTAGE_NOW = 0x15,
50 FRONIUS_CMD_GET_AC_FREQUENCY_NOW = 0x16,
51 FRONIUS_CMD_GET_DC_CURRENT_NOW = 0x17,
52 FRONIUS_CMD_GET_DC_VOLTAGE_NOW = 0x18,
53 FRONIUS_CMD_GET_YIELD_DAY = 0x19,
54 FRONIUS_CMD_GET_MAXIMUM_POWER_DAY = 0x1a,
55 FRONIUS_CMD_GET_MAXIMUM_AC_VOLTAGE_DAY = 0x1b,
56 FRONIUS_CMD_GET_MINIMUM_AC_VOLTAGE_DAY = 0x1c,
57 FRONIUS_CMD_GET_MAXIMUM_DC_VOLTAGE_DAY = 0x1d,
58 FRONIUS_CMD_GET_OPERATING_HOURS_DAY = 0x1e,
59 FRONIUS_CMD_GET_YIELD_YEAR = 0x20,
60 FRONIUS_CMD_GET_MAXIMUM_POWER_TOTAL = 0x26,
61 FRONIUS_CMD_GET_MAXIMUM_AC_VOLTAGE_TOTAL = 0x27,
62 FRONIUS_CMD_GET_MINIMUM_AC_VOLTAGE_TOTAL = 0x28,
63 FRONIUS_CMD_GET_MAXIMUM_DC_VOLTAGE_TOTAL = 0x29,
64 FRONIUS_CMD_GET_OPERATING_HOURS_TOTAL = 0x2a,
65 FRONIUS_CMD_GET_INVERTOR_STATUS = 0x37,
66 FRONIUS_CMD_GET_TEMPERATURE_1 = 0xE0,
67 FRONIUS_CMD_GET_TEMPERATURE_2 = 0xE1,
68 FRONIUS_CMD_GET_IRRADIANCE = 0xE2
77 FRONIUS_PROTOCOL_ERROR_UNKNOWN_COMMAND = 0x01,
78 FRONIUS_PROTOCOL_ERROR_TIMEOUT = 0x02,
79 FRONIUS_PROTOCOL_ERROR_INCORRECT_DATA_STRUCTURE =0x03,
80 FRONIUS_PROTOCOL_ERROR_COMMAND_QUEUE_FULL = 0x04,
81 FRONIUS_PROTOCOL_ERROR_DEVICE_OR_OPTION_NA = 0x05,
82 FRONIUS_PROTOCOL_ERROR_NO_RESPONSE = 0x06,
83 FRONIUS_PROTOCOL_ERROR_SENSOR_ERROR = 0x07,
84 FRONIUS_PROTOCOL_ERROR_SENSOR_NOT_ACTIVE = 0x08,
85 FRONIUS_PROTOCOL_ERROR_INCORRECT_COMMAND = 0x09,
86 FRONIUS_PROTOCOL_ERROR_DEVICE_ID_COLLISION = 0x0a
90 FRONIUS_STATUS_STARTUP = 0x01,
91 FRONIUS_STATUS_OPERATION = 0x02,
92 FRONIUS_STATUS_MANUAL_STANDBY = 0x03,
93 FRONIUS_STATUS_FAILURE = 0x04
103 static const int FRONIUS_ERROR = 0x0e;
void loop()
Loops the invertors's list.
QString decodeError(FRONIUS::Error)
Converts fronius error code to text description.
void readInvertor()
Reads values from current invertor.
Response from fronius invertor.
void open()
Opens serial port.
void checkData(const DBT_DATA &)
Basic data check.
Error
List of all fronius error codes.
FRONIUS()
Constructor. The very basic initializations.
int m_current_invertor_index
Current index in INVERTOR::m_invertors list.
Class describing database table DATA.
QVariant readValue(FRONIUS::Command)
Reads one value from invertor.
QTimer * m_timer
Timer for main loop.
Communicates with invertors using serial port.
QextSerialPort * m_port
Serial port device.
void readResponse(FRONIUS_response &)
Reads and checks response read from invertor.
QVariant decodeResponse(FRONIUS_response &, FRONIUS::Command)
Decode response from invertor and returnsi retrieved value.
QString decodeStatus(FRONIUS::Status)
Converts fronius error code to text description.
Virtual class for invertor communication.
Command m_command
Current command processed.
QString decodeCommand(FRONIUS::Command)
Converts fronius command code to text description.
void slotInit()
Function called within running thread to initialize all needed child objects.
Command
List of all fronius commands.