Files
UKSI_TEST/AllLibs/Modbus/Doc/latex/modbus__master_8c.tex
2025-12-16 17:57:59 +03:00

144 lines
20 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\doxysection{E\+:/.WORK/\+STM32/\+Diod\+\_\+\+Test/diode\+\_\+tester/\+Core/\+Modbus/\+Src/modbus\+\_\+master.c File Reference}
\hypertarget{modbus__master_8c}{}\label{modbus__master_8c}\index{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/modbus\_master.c@{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/modbus\_master.c}}
Модуль для реализации мастера MODBUS.
{\ttfamily \#include "{}modbus.\+h"{}}\newline
Include dependency graph for modbus\+\_\+master.\+c\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{modbus__master_8c__incl}
\end{center}
\end{figure}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_g_s___a_p_i_ga86160c23899d6ece041e3680ba863019}{MB\+\_\+\+Resp\+Get\+\_\+\+Register\+All}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint16\+\_\+t \texorpdfstring{$\ast$}{*}reg\+\_\+arr)
\begin{DoxyCompactList}\small\item\em Получить значение ВСЕХ регистров в ответе \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_g_s___a_p_i_ga1f80317087624a23f84224c6f2c1d596}{MB\+\_\+\+Resp\+Get\+\_\+\+Register\+Value}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint16\+\_\+t reg\+\_\+addr, uint16\+\_\+t \texorpdfstring{$\ast$}{*}reg\+\_\+value)
\begin{DoxyCompactList}\small\item\em Получить значение регистра в ответе по его адресу \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___c_o_i_l_s___a_p_i_ga14750bad3976a9fcc6bdece1c800dbf5}{MB\+\_\+\+Resp\+Get\+\_\+\+Coil\+All}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, int \texorpdfstring{$\ast$}{*}coil\+\_\+arr)
\begin{DoxyCompactList}\small\item\em Получить состояние ВСЕХ coil в ответе \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___c_o_i_l_s___a_p_i_ga643a0be1ccd587a6dfe544d9fd5ed018}{MB\+\_\+\+Resp\+Get\+\_\+\+Coil\+State}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint16\+\_\+t coil\+\_\+addr, int \texorpdfstring{$\ast$}{*}coil\+\_\+state)
\begin{DoxyCompactList}\small\item\em Получить состояние coil в ответе по его адресу \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga16b90d4a74a249514161aa4576724d1c}{MB\+\_\+\+Resp\+Get\+\_\+\+Number\+Of\+Objects}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg)
\begin{DoxyCompactList}\small\item\em Получить количество объектов в сообщении \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga0dc4119c008af34d5997eab339c437be}{MB\+\_\+\+Resp\+Get\+\_\+\+Object\+By\+Id}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint8\+\_\+t obj\+\_\+id, char \texorpdfstring{$\ast$}{*}obj\+\_\+data, uint8\+\_\+t \texorpdfstring{$\ast$}{*}obj\+\_\+length)
\begin{DoxyCompactList}\small\item\em Найти объект по ID в сообщении \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga3fc5fc5abfe4f8767ccee5c11ea3d5d5}{MB\+\_\+\+Resp\+Get\+\_\+\+Object\+By\+Index}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, int index, uint8\+\_\+t \texorpdfstring{$\ast$}{*}obj\+\_\+id, char \texorpdfstring{$\ast$}{*}obj\+\_\+data, uint8\+\_\+t \texorpdfstring{$\ast$}{*}obj\+\_\+length)
\begin{DoxyCompactList}\small\item\em Получить объект по индексу в сообщении \end{DoxyCompactList}\item
int \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q___d_i_a_g___a_p_i_ga46a9650ec68832e6f95eda579f4d9ded}{MB\+\_\+\+Resp\+Get\+\_\+\+Diagnostic}} (\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint16\+\_\+t \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em Получить данные диагностики из сообщения (Mb\+Data\mbox{[}1\mbox{]}) \end{DoxyCompactList}\item
static int \mbox{\hyperlink{modbus__master_8c_a79e3f84b9daba8a42c8ca6026133acc5}{MB\+\_\+\+Define\+\_\+\+Size\+\_\+of\+\_\+\+Function}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}hmodbus, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg)
\begin{DoxyCompactList}\small\item\em Определить размер модбас запроса (МАСТЕР версия). \end{DoxyCompactList}\item
\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___m_a_s_t_e_r_ga096d2790ab887eb815e17d8cd9ede125}{MB\+\_\+\+Master\+\_\+\+Collect\+\_\+\+Message}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}hmodbus, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint8\+\_\+t \texorpdfstring{$\ast$}{*}modbus\+\_\+uart\+\_\+buff)
\begin{DoxyCompactList}\small\item\em Сбор сообщения в буфер UART в режиме мастер (фрейм мастера из msg -\/\texorpdfstring{$>$}{>} uart). \end{DoxyCompactList}\item
\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___m_a_s_t_e_r_ga461e77fe31ce64c7ee5f1a932dc1183f}{MB\+\_\+\+Master\+\_\+\+Parse\+\_\+\+Message}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}hmodbus, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}modbus\+\_\+msg, uint8\+\_\+t \texorpdfstring{$\ast$}{*}modbus\+\_\+uart\+\_\+buff)
\begin{DoxyCompactList}\small\item\em Парс сообщения в режиме мастер (фрейм слейва из uart -\/\texorpdfstring{$>$}{>} msg). \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gadb1b59bd6832b017b7ff4f5d694f59aa}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+COILS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на чтение коилов \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga85028c4de63ca63cb04e332a3fdcd676}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+DISCRETE\+\_\+\+INPUTS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на чтение дискретных регистров \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga4a4798a15608f3aac04150115a628f8e}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+HOLDING\+\_\+\+REGS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на чтение холдинг регистров \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga72f91a70586546171fe9190a4e0e5518}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+INPUT\+\_\+\+REGS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на чтение инпут регистров \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga1ac5f38ac244039a63b2714044778ffc}{MB\+\_\+\+REQUEST\+\_\+\+WRITE\+\_\+\+SINGLE\+\_\+\+COIL}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t coil\+\_\+addr, uint8\+\_\+t value)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на запись одного коила \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga0126cfaf44c73d84d521b16c0f6ab7b6}{MB\+\_\+\+REQUEST\+\_\+\+WRITE\+\_\+\+SINGLE\+\_\+\+REG}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t reg\+\_\+addr, uint16\+\_\+t value)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на запись одного регистра \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga92c7c61bc6b3e249350d93d20b530fa3}{MB\+\_\+\+REQUEST\+\_\+\+WRITE\+\_\+\+MULTIPLE\+\_\+\+COILS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity, uint8\+\_\+t \texorpdfstring{$\ast$}{*}coils\+\_\+data)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на запись нескольких регистров \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga9b89a034f1c5ed96572621b2ebe7f6af}{MB\+\_\+\+REQUEST\+\_\+\+WRITE\+\_\+\+MULTIPLE\+\_\+\+REGS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t start\+\_\+addr, uint16\+\_\+t quantity, uint16\+\_\+t \texorpdfstring{$\ast$}{*}regs\+\_\+data)
\begin{DoxyCompactList}\small\item\em Сформировать запрос на запись нескольких коилов \end{DoxyCompactList}\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga426c984872d854c539fd8c238d63771b}{MB\+\_\+\+REQUEST\+\_\+\+DIAGNOSTIC\+\_\+\+QUERY}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t sub\+\_\+function, uint16\+\_\+t data)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga6480ddbb52591379806a4772b1e0314c}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+QUERY\+\_\+\+DATA}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gaac4012ed36456d42a4ab43bafa464c5d}{MB\+\_\+\+REQUEST\+\_\+\+RESTART\+\_\+\+COMMUNICATIONS}} (uint8\+\_\+t slave\+\_\+addr, uint16\+\_\+t data)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga2273cca5ebb04144c64531fd0c0694ed}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+DIAGNOSTIC\+\_\+\+REGISTER}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gae6530484fa78fb3e02755b300f0c2b02}{MB\+\_\+\+REQUEST\+\_\+\+FORCE\+\_\+\+LISTEN\+\_\+\+ONLY\+\_\+\+MODE}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gada53cc333c773842805b95d9a87a65db}{MB\+\_\+\+REQUEST\+\_\+\+CLEAR\+\_\+\+COUNTERS\+\_\+\+AND\+\_\+\+DIAGNOSTIC\+\_\+\+REGISTER}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gacb5228130ea1b22b88c19887d92f7be0}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+BUS\+\_\+\+MESSAGE\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gadd99de894b4454ca996f62e7087c0189}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+BUS\+\_\+\+COMMUNICATION\+\_\+\+ERROR\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga389ab419af02c8c3c5d4aae28fb17101}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+SLAVE\+\_\+\+EXCEPTION\+\_\+\+ERROR\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga9c40062ec23c64144688aa7828eccd23}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+SLAVE\+\_\+\+MESSAGE\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga5300643a1bf60cf0a78d594c9abc1b0e}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+SLAVE\+\_\+\+NO\+\_\+\+RESPONSE\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gacb578b9c708617fc0223d462ae3749c0}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+SLAVE\+\_\+\+NAK\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga72c99bd3d8ee2de2e6748086f66a6955}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+SLAVE\+\_\+\+BUSY\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga9fa3920579485c7a23927748a7fcf4c0}{MB\+\_\+\+REQUEST\+\_\+\+RETURN\+\_\+\+BUS\+\_\+\+CHARACTER\+\_\+\+OVERRUN\+\_\+\+COUNT}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_gaaccf0865d45ec20438b06698d7fa1810}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+DEVICE\+\_\+\+ID\+\_\+\+BASIC}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga016ad086488ff121aa6354ed6e617255}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+DEVICE\+\_\+\+ID\+\_\+\+REGULAR}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga8ace1339daa02649df909e5cd1b9143c}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+DEVICE\+\_\+\+ID\+\_\+\+EXTENDED}} (uint8\+\_\+t slave\+\_\+addr)
\item
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \mbox{\hyperlink{group___m_o_d_b_u_s___r_e_q_u_e_s_t___m_s_g_ga4c00a4432ea240d6f6629a9bead0c5b8}{MB\+\_\+\+REQUEST\+\_\+\+READ\+\_\+\+DEVICE\+\_\+\+ID\+\_\+\+SPECIFIC}} (uint8\+\_\+t slave\+\_\+addr, uint8\+\_\+t object\+\_\+id)
\end{DoxyCompactItemize}
\doxysubsection{Detailed Description}
Модуль для реализации мастера MODBUS.
Файл содержит реализацию функций для работы Modbus в режиме мастера.\hypertarget{modbus__master_8c_mast}{}\doxysubsection{\texorpdfstring{Функции и макросы}{Функции и макросы}}\label{modbus__master_8c_mast}
\begin{DoxyItemize}
\item \doxylink{group___m_o_d_b_u_s___r_e_g_s___a_p_i_ga86160c23899d6ece041e3680ba863019}{MB\+\_\+\+Resp\+Get\+\_\+\+Register\+All()} — Считать все регистра из ответа
\item \doxylink{group___m_o_d_b_u_s___r_e_g_s___a_p_i_ga1f80317087624a23f84224c6f2c1d596}{MB\+\_\+\+Resp\+Get\+\_\+\+Register\+Value()} — Считать один регистр из ответа
\item \doxylink{group___m_o_d_b_u_s___r_e_q___c_o_i_l_s___a_p_i_ga14750bad3976a9fcc6bdece1c800dbf5}{MB\+\_\+\+Resp\+Get\+\_\+\+Coil\+All()} — Считать все коилы из ответа
\item \doxylink{group___m_o_d_b_u_s___r_e_q___c_o_i_l_s___a_p_i_ga643a0be1ccd587a6dfe544d9fd5ed018}{MB\+\_\+\+Resp\+Get\+\_\+\+Coil\+State()} — Считать один коил из ответа
\item \doxylink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga16b90d4a74a249514161aa4576724d1c}{MB\+\_\+\+Resp\+Get\+\_\+\+Number\+Of\+Objects()} — Считать количество принятых объектов идентификатора
\item \doxylink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga0dc4119c008af34d5997eab339c437be}{MB\+\_\+\+Resp\+Get\+\_\+\+Object\+By\+Id()} — Считать объект идентификатора по его ID
\item \doxylink{group___m_o_d_b_u_s___r_e_q___d_e_f_i_d___a_p_i_ga3fc5fc5abfe4f8767ccee5c11ea3d5d5}{MB\+\_\+\+Resp\+Get\+\_\+\+Object\+By\+Index()} — Считать объект идентификатора по порядковому номеру в сообщении
\item \doxylink{group___m_o_d_b_u_s___r_e_q___d_i_a_g___a_p_i_ga46a9650ec68832e6f95eda579f4d9ded}{MB\+\_\+\+Resp\+Get\+\_\+\+Diagnostic()} — Считать запрошенный диагностический счетчик
\item \doxylink{group___m_o_d_b_u_s___m_a_s_t_e_r_ga096d2790ab887eb815e17d8cd9ede125}{MB\+\_\+\+Master\+\_\+\+Collect\+\_\+\+Message()}Сбор сообщения в режиме мастера
\item \doxylink{group___m_o_d_b_u_s___m_a_s_t_e_r_ga461e77fe31ce64c7ee5f1a932dc1183f}{MB\+\_\+\+Master\+\_\+\+Parse\+\_\+\+Message()} — Парс сообщения в режиме мастера
\end{DoxyItemize}
Definition in file \mbox{\hyperlink{modbus__master_8c_source}{modbus\+\_\+master.\+c}}.
\label{doc-func-members}
\Hypertarget{modbus__master_8c_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{modbus__master_8c_a79e3f84b9daba8a42c8ca6026133acc5}\index{modbus\_master.c@{modbus\_master.c}!MB\_Define\_Size\_of\_Function@{MB\_Define\_Size\_of\_Function}}
\index{MB\_Define\_Size\_of\_Function@{MB\_Define\_Size\_of\_Function}!modbus\_master.c@{modbus\_master.c}}
\doxysubsubsection{\texorpdfstring{MB\_Define\_Size\_of\_Function()}{MB\_Define\_Size\_of\_Function()}}
{\footnotesize\ttfamily \label{modbus__master_8c_a79e3f84b9daba8a42c8ca6026133acc5}
int MB\+\_\+\+Define\+\_\+\+Size\+\_\+of\+\_\+\+Function (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{hmodbus}{, }\item[{\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{modbus\+\_\+msg}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
Определить размер модбас запроса (МАСТЕР версия).
\begin{DoxyParams}{Parameters}
{\em h\+RS} & Указатель на хендлер RS. \\
\hline
{\em rx\+\_\+data\+\_\+size} & Указатель на переменную для записи кол-\/ва байт для принятия. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
RS\+\_\+\+RES Статус о корректности рассчета кол-\/ва байт для принятия.
\end{DoxyReturn}
Определение сколько байтов надо принять по протоколу.
Definition at line \mbox{\hyperlink{modbus__master_8c_source_l00326}{326}} of file \mbox{\hyperlink{modbus__master_8c_source}{modbus\+\_\+master.\+c}}.