模块-modbus模块

2.modbus主流程分析 概述 本篇主要介绍main函数以及mb.c文件,通过这两部分,我们能够从整体上分析FreeModbus。 一、从main函数说起 打开FreeModbus文件夹中的demo文件夹,该文件夹下是各个平台下的demo,这里我们选择AVR平台来分析。 打开AVR文件夹下的demo.c文件,main函数代码如下: int main( void ) { const UCHAR ucSlaveID[] = { 0xAA, 0xBB, 0xCC }; eMBErrorCode ... 阅读详情

Detailed Description详细描述

 #include "mb.h" 

This module defines the interface for the application. It contains the basic functions and types required to use the Modbus protocol stack. A typical application will want to call eMBInit() first. If the device is ready to answer network requests it must then call eMBEnable() to activate the protocol stack. In the main loop the function eMBPoll() must be called periodically. The time interval between pooling depends on the configured Modbus timeout. If an RTOS is available a separate task should be created and the task should always call the function eMBPoll().

这个模块为应用定义了接口。它包括了使用Modbus协议栈所必须的基本功能函数和类型。一个典型的应用程序将会首先调用eMBInit()函数。如果该设备需要回应网络请求,则其必须调用eMBEnable()函数来激活协议栈。在主循环中,函数eMBPoll()将会被周期性调用。两次调用的时间间隔决定于Modbus的超时时间设置。如果使用了RTOS,用户则必须创建一个独立的任务,并且该任务必须一直调用函数eMBPoll()。

 // Initialize protocol stack in RTU mode for a slave with address 10 = 0x0A
 eMBInit( MB_RTU, 0x0A, 38400, MB_PAR_EVEN );
 // Enable the Modbus Protocol Stack.
 eMBEnable(  );
 for( ;; )
 {
     // Call the main polling loop of the Modbus protocol stack.
     eMBPoll(  );
     ...
 }

 

 

Defines定义

#define 

MB_TCP_PORT_USE_DEFAULT   0

 

Enumerations枚举类型

enum  

eMBMode { MB_RTU, MB_ASCII, MB_TCP }

Modbus协议的模式:RTU ,ASCII 和TCP

enum  

eMBRegisterMode { MB_REG_READ, MB_REG_WRITE }

Modbus寄存器的模式:READ和WRITE

enum  

eMBErrorCode {
  MB_ENOERR, MB_ENOREG, MB_EINVAL, MB_EPORTERR,
  MB_ENORES, MB_EIO, MB_EILLSTATE, MB_ETIMEDOUT
}

错误码:没有错误,没有寄存器,无效,   ,   ,IO错误,无效   ,超时

enum  

eMBParity { MB_PAR_NONE, MB_PAR_ODD, MB_PAR_EVEN }

Modbus数据帧的校验类型:无校验,偶校验,奇校验

 

Functions函数

eMBErrorCode 

eMBInit (eMBMode eMode, UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity)

协议初始化函数

输入参数:

eMBMode eMode, Modubus协议模式

UCHAR ucSlaveAddress, 子模块地址

UCHAR ucPort, 端口

ULONG ulBaudRate, 波特率

eMBParity eParity 串行数据的奇偶校验

eMBErrorCode 

eMBTCPInit (USHORT usTCPPort)

如果使用了TCP协议,则用该函数进行初始化

eMBErrorCode 

eMBClose (void)

关闭Modbus协议栈

eMBErrorCode 

eMBEnable (void)

使能Modbus协议栈

eMBErrorCode 

eMBDisable (void)

禁止Modbus协议栈

eMBErrorCode 

eMBPoll (void)

周期性调用的协议处理函数

eMBErrorCode 

eMBSetSlaveID (UCHAR ucSlaveID, BOOL xIsRunning, UCHAR const *pucAdditional, USHORT usAdditionalLen)

设置子模块ID

输入参数:

UCHAR ucSlaveID, 子模块ID

BOOL xIsRunning,

UCHAR const *pucAdditional,

USHORT usAdditionalLen

eMBErrorCode 

eMBRegisterCB (UCHAR ucFunctionCode, pxMBFunctionHandler pxHandler)

Modbus协议的寄存器回调函数

输入参数:

UCHAR ucFunctionCode, 功能码

pxMBFunctionHandler pxHandler功能码对应的处理函数


Define Documentation文档

#define MB_TCP_PORT_USE_DEFAULT   0

 

 

Use the default Modbus TCP port (502).

使用缺省的ModbusTCP移植

Examples:

MCF5235TCP/demo.c, STR71XTCP/demo.c, and WIN32TCP/demo.cpp.


Enumeration Type Documentation枚举类型定义

enum eMBErrorCode

 

 

Errorcodes used by all function in the protocol stack.

在协议栈中所有函数使用的错误码

Enumeration values: 枚举值

MB_ENOERR 

no error. 没有错误

MB_ENOREG 

illegal register address. 无效的寄存器地址

MB_EINVAL 

illegal argument. 无效的参数

MB_EPORTERR 

porting layer error. 移植层错误

MB_ENORES 

insufficient resources. 资源不足

MB_EIO 

I/O error. I/O错误

MB_EILLSTATE 

protocol stack in illegal state. 协议栈状态错误

MB_ETIMEDOUT 

timeout error occurred. 超时错误

Examples: 例子:

AT91SAM7X_ROWLEY/demo.c, AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, MCF5235TCP/demo.c, MSP430/demo.c, STR71X/simple2.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.

 

enum eMBMode

 

 

Modbus serial transmission modes (RTU/ASCII).

Modubs串行传输模式

Modbus serial supports two transmission modes. Either ASCII or RTU. RTU is faster but has more hardware requirements and requires a network with a low jitter. ASCII is slower and more reliable on slower links (E.g. modems)

Modbus串行传输支持两种模式,ASCII或者是RTU。RTU模式较快但是具有较高的硬件要求并且要求网络延迟要低。ASCII模式较慢,但是在低速连接中更加可靠(如moderms)。

Enumeration values:

MB_RTU 

RTU transmission mode. RTU传输模式

MB_ASCII 

ASCII transmission mode. ASCII传输模式

MB_TCP 

TCP mode. TCP模式

 

enum eMBParity

 

 

Parity used for characters in serial mode.

串行模式中字符的极性

The parity which should be applied to the characters sent over the serial link. Please note that this values are actually passed to the porting layer and therefore not all parity modes might be available.

串行字符传输时应用的校验格式。需要注意,这个值其实是传给移植层,并且不是所有的奇偶模式都能有效。

Enumeration values:

MB_PAR_NONE 

No parity.  无奇偶校验

MB_PAR_ODD 

Odd parity. 偶校验

MB_PAR_EVEN 

Even parity. 奇校验

 

enum eMBRegisterMode

 

 

If register should be written or read.

寄存器是读还是写

This value is passed to the callback functions which support either reading or writing register values. Writing means that the application registers should be updated and reading means that the modbus protocol stack needs to know the current register values.

值将传给支持读或者写寄存器的回调函数。写意味着应用寄存器更新,读表示Modbus协议栈需要知道当前寄存器的数值。

See also:

eMBRegHoldingCB( ), eMBRegCoilsCB( ), eMBRegDiscreteCB( ) and eMBRegInputCB( ).

Enumeration values:

MB_REG_READ 

Read register values and pass to protocol stack. 读寄存器数值并且传给协议栈

MB_REG_WRITE 

Update register values. 更新寄存器数值

Examples:

AT91SAM7X_ROWLEY/demo.c, AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, MCF5235TCP/demo.c, MSP430/demo.c, STR71X/simple2.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.


Function Documentation

eMBErrorCode eMBClose

( 

void 

 

 ) 

 

 

 

Release resources used by the protocol stack.

释放协议栈使用的资源。

This function disables the Modbus protocol stack and release all hardware resources. It must only be called when the protocol stack is disabled.

该函数禁止Modbus协议栈并且释放所有的硬件资源。只有当协议栈被禁止了,才能调用这个函数。

Note: 注意

Note all ports implement this function. A port which wants to get an callback must define the macro MB_PORT_HAS_CLOSE to 1.

注意所有的移植都要实现这个函数。需要获取回调

Returns:

If the resources where released it return eMBErrorCode::MB_ENOERR. If the protocol stack is not in the disabled state it returns eMBErrorCode::MB_EILLSTATE.

如果资源释放了,该函数返回eMBErrorCode::MB_ENOERR。如果协议栈不是处于禁止状态,它返回eMBErrorCode::MB_EILLSTATE。

Examples:

LINUX/demo.c, MCF5235TCP/demo.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.

 

eMBErrorCode eMBDisable

( 

void 

 

 ) 

 

 

 

Disable the Modbus protocol stack.

禁止Modbus协议栈。

This function disables processing of Modbus frames.

这个函数禁止处理Modbus帧。

Returns: 返回

If the protocol stack has been disabled it returns eMBErrorCode::MB_ENOERR. If it was not in the enabled state it returns eMBErrorCode::MB_EILLSTATE.

Examples:

LINUX/demo.c, MCF5235TCP/demo.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.

 

eMBErrorCode eMBEnable

( 

void 

 

 ) 

 

 

 

Enable the Modbus protocol stack.

使能Modbus协议栈

This function enables processing of Modbus frames. Enabling the protocol stack is only possible if it is in the disabled state.

本函数使能Modbus帧的处理。

Returns:

If the protocol stack is now in the state enabled it returns eMBErrorCode::MB_ENOERR. If it was not in the disabled state it return eMBErrorCode::MB_EILLSTATE.

Examples:

AT91SAM7X_ROWLEY/demo.c, AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, MCF5235TCP/demo.c, MSP430/demo.c, STR71X/simple2.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.

 

eMBErrorCode eMBInit

( 

eMBMode 

eMode,

 

 

UCHAR 

ucSlaveAddress,

 

 

UCHAR 

ucPort,

 

 

ULONG 

ulBaudRate,

 

 

eMBParity 

eParity

 

) 

 

 

 

Initialize the Modbus protocol stack.

初始化Modbus协议栈

This functions initializes the ASCII or RTU module and calls the init functions of the porting layer to prepare the hardware. Please note that the receiver is still disabled and no Modbus frames are processed until eMBEnable( ) has been called.

该函数初始化为ASCII或者RTU模式,并且调用移植层的初始化函数来准备硬件。需要注意的是,接受依然是禁止的,并且Modbus数据帧都不会得到处理,除非eMBEnable( )被调用。

Parameters:

 

eMode 

If ASCII or RTU mode should be used. Modbus模式

 

ucSlaveAddress 

The slave address. Only frames sent to this address or to the broadcast address are processed. 子模块地址。只有发向本模块地址或者广播地址的数据帧能得到处理。

 

ucPort 

The port to use. E.g. 1 for COM1 on windows. This value is platform dependent and some ports simply choose to ignore it.

使用的端口。该值是硬件相关的,许多移植都会选择忽略该参数。

 

ulBaudRate 

The baudrate. E.g. 19200. Supported baudrates depend on the porting layer. 波特率,所支持的波特率决定于移植层。

 

eParity 

Parity used for serial transmission.串行传输使用的校验。

Returns:

If no error occurs the function returns eMBErrorCode::MB_ENOERR. The protocol is then in the disabled state and ready for activation by calling eMBEnable( ). Otherwise one of the following error codes is returned:

·   eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid slave addresses are in the range 1 - 247.

·   eMBErrorCode::MB_EPORTERR IF the porting layer returned an error.

如果没有错误,这个函数返回eMBErrorCode::MB_ENOERR。协议栈将处于禁止状态,可以通过调用eMBEnable( )来激活。否则,将返回下列的一个错误:

·   eMBErrorCode::MB_EINVAL 如果子模块地址无效。

·   eMBErrorCode::MB_EPORTERR 如果移植层返回一个错误。

Examples:

AT91SAM7X_ROWLEY/demo.c, AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, MSP430/demo.c, STR71X/simple2.c, and WIN32/demo.cpp.

 

eMBErrorCode eMBPoll

( 

void 

 

 ) 

 

 

 

The main pooling loop of the Modbus protocol stack.

Modbus协议栈的主轮询函数。

This function must be called periodically. The timer interval required is given by the application dependent Modbus slave timeout. Internally the function calls xMBPortEventGet() and waits for an event from the receiver or transmitter state machines.

该函数必须被周期性调用。两次调用的时间间隔决定于Modbus的超时时间设置。在函数内部调用了xMBPortEventGet()函数来等待接受或者发送状态机发出的事件。

Returns:

If the protocol stack is not in the enabled state the function returns eMBErrorCode::MB_EILLSTATE. Otherwise it returns eMBErrorCode::MB_ENOERR.

如果协议栈没有被使能,这个函数返回eMBErrorCode::MB_EILLSTATE.,否则返回eMBErrorCode::MB_ENOERR.

Examples:

AT91SAM7X_ROWLEY/demo.c, AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, MCF5235TCP/demo.c, MSP430/demo.c, STR71X/simple2.c, STR71XTCP/demo.c, WIN32/demo.cpp, and WIN32TCP/demo.cpp.

 

eMBErrorCode eMBRegisterCB

( 

UCHAR 

ucFunctionCode,

 

 

pxMBFunctionHandler 

pxHandler

 

) 

 

 

 

Registers a callback handler for a given function code.

为给定的功能码注册一个回调处理函数。

This function registers a new callback handler for a given function code. The callback handler supplied is responsible for interpreting the Modbus PDU and the creation of an appropriate response. In case of an error it should return one of the possible Modbus exceptions which results in a Modbus exception frame sent by the protocol stack.

这个函数为一个给定的功能代码注册一个新的回调函数。提供的回调函数负责解释Modbus PDU并且创建一个合适的应答。当错误发生时,这个函数会返回一个Modbus异常,该异常是由协议栈发送的Modbus异常。

Parameters: 参数

 

ucFunctionCode 

The Modbus function code for which this handler should be registers. Valid function codes are in the range 1 to 127.

注册的功能码,有效的功能码范围是1到127

 

pxHandler 

The function handler which should be called in case such a frame is received. If NULL a previously registered function handler for this function code is removed.

功能码对应的回调函数。如果为空,一个以前定义功能码回调函数将被去掉。

Returns: 返回

eMBErrorCode::MB_ENOERR if the handler has been installed. If no more resources are available it returns eMBErrorCode::MB_ENORES. In this case the values in mbconfig.h should be adjusted. If the argument was not valid it returns eMBErrorCode::MB_EINVAL.

eMBErrorCode::MB_ENOERR 如果回调函数正常安装。如果资源不足,将返回 eMBErrorCode::MB_ENORES. 在这种情况下,在 mbconfig.h 中定义的数值必须进行修改。如果参数无效,函数将返回 eMBErrorCode::MB_EINVAL.

 

eMBErrorCode eMBSetSlaveID

( 

UCHAR 

ucSlaveID,

 

 

BOOL 

xIsRunning,

 

 

UCHAR const * 

pucAdditional,

 

 

USHORT 

usAdditionalLen

 

) 

 

 

 

Configure the slave id of the device.

设置设备的ID

This function should be called when the Modbus function Report Slave ID is enabled ( By defining MB_FUNC_OTHER_REP_SLAVEID_ENABLED in mbconfig.h ).

当使用Modbus的Report Slave ID 功能时,这个函数将会被调用(通过在mbconfig.h 中定义MB_FUNC_OTHER_REP_SLAVEID_ENABLED)。

Parameters:

 

ucSlaveID 

Values is returned in the Slave ID byte of the Report Slave ID response.

 

xIsRunning 

If TRUE the Run Indicator Status byte is set to 0xFF. otherwise the Run Indicator Status is 0x00.

 

pucAdditional 

Values which should be returned in the Additional bytes of the Report Slave ID response.

 

usAdditionalLen 

Length of the buffer pucAdditonal.

Returns:

If the static buffer defined by MB_FUNC_OTHER_REP_SLAVEID_BUF in mbconfig.h is to small it returns eMBErrorCode::MB_ENORES. Otherwise it returns eMBErrorCode::MB_ENOERR.

Examples:

AVR/demo.c, LINUX/demo.c, MCF5235/demo.c, and WIN32/demo.cpp.

 

eMBErrorCode eMBTCPInit

( 

USHORT 

usTCPPort

 ) 

 

 

 

Initialize the Modbus protocol stack for Modbus TCP.

Modbus TCP的协议初始化

This function initializes the Modbus TCP Module. Please note that frame processing is still disabled until eMBEnable( ) is called.

该函数初始化Modbus TCP 模块。注意,帧处理在eMBEnable()函数调用之前是禁止掉的。

Parameters: 参数

 

usTCPPort 

The TCP port to listen on. 监听的TCP端口

Returns: 返回

If the protocol stack has been initialized correctly the function returns eMBErrorCode::MB_ENOERR. Otherwise one of the following error codes is returned:

·   eMBErrorCode::MB_EINVAL If the slave address was not valid. Valid slave addresses are in the range 1 - 247.

·   eMBErrorCode::MB_EPORTERR IF the porting layer returned an error.

如果协议栈初始化正确,函数返回MB_ENOERR。否则,函数会返回如下的错误码:

·   eMBErrorCode::MB_EINVAL如果子模块地址无效,有效的子地址范围是1-247

·   eMBErrorCode::MB_EPORTERR如果移植层返回一个错误。

Examples:

MCF5235TCP/demo.c, STR71XTCP/demo.c, and WIN32TCP/demo.cpp.

FreeModbus源码详解 本篇按照FreeModbus协议栈的工作流程,对源代码进行总结解析;FreeModbus协议栈作为从机,等待主机传送的数据,当从机接收到一帧完整的报文后,对报文进行解析,然后响应主机,发送报文给主机,实现主机和从机之间的通信; 1:demo.c中三个函数,完成协议栈的准备工作; eMBInit()函数:(mb.c) /*函数功能: *1:实现RTU模式和ASCALL模式的协议栈初始化; *2 阅读详情

相关推荐

modbus_tk模块详细使用

源码:Github 使用及例子modbus_tk模块安装Demo功能码及使用说明: modbus_tk模块 通过modbus-RTU 读取地址,调用后返回反馈数值和故障信息。 modbus_tk模块安装 pip install pymodbus_tk Demo # -*- coding: utf_8 -*- import serial import modbus_tk import modbus_tk.defines as cst from modbus_tk import modbus_rtu

qq_23076153的博客 2万+

FreeModbus开源协议栈的移植和详解(二)- modbus主流程分析

FreeModbus开源协议栈的移植和详解(二) 概述 本篇主要介绍main函数以及mb.c文件,通过这两部分,我们能够从整体上分析FreeModbus。 一、从main函数说起 打开FreeModbus文件夹中的demo文件夹,该文件夹下是各个平台下的demo,这里我们选择AVR平台来分析。 打开AVR文件夹下的demo.c文件,main函数代码如下: int main( void ) { const UCHAR ucSlaveID[] = { 0xAA, 0xBB, 0x

childboy的博客 5711

嵌入式Modbus TCP通讯模块设计

摘要:本文迎合PLC应用网络化发展的需求,提出一种基于嵌入式的Modbus RTU转Modbus TCP协议转化的通讯模块设计方法。该设计能简单、低成本、便捷、可靠的把现有支持Modbus RTU协议的PLC应用于以太网互联。 关键字:PLC;Modbus RTU;Modbus TCP     一、引言 Modbus应用层协议由美国Modicon公司(现为施耐德电气旗下品牌)于1979年

liguangyong的专栏 3720

NI Modbus功能模块

NI Modbus功能模块 【下载地址】NIModbus功能模块 NI Modbus功能模块是一款专为Labview设计的Modbus底层驱动模块,能够轻松集成到您的开发环境中。只需将模块文件夹复制到Labview安装目录,即可立即使用。该模块经过实际项目验证,具备极高的稳定性和可靠性,特别适合需要高效、精准的Modbu...

gitblog_06715的博客 302

Profinet转Modbus模块减轻通讯编程工作量实现Modbus通讯

巴图自动化PN转Modbus模块简化Profinet与Modbus设备间通信,减轻编程工作。通过使用巴图自动化Profinet转Modbus模块(BT-MDPN10),用户无需编写复杂的通信程序或进行繁琐的协议转换,只需简单配置通讯参数。

BA_TU_AUTO_TECH的博客 715

labview dsc模块_【学院推荐】LabVIEW与PLC如何进行Modbus通信?

每天1小时,龙哥教你学LabVIEW视觉,参与送福利:1、低至两折!全套课程众筹价:588元(原价2980元)2、《LabVIEW视觉算子手册》配套电子书3、价值58元《LabVIEW机器视觉实用教程基础篇》LabVIEW是一种功能强大的编程环境,其独特的图形编程方式和各种专业的控件和工具使其非常适合工程测控领域。安装数据记录与监测(DSC)模块后,可以实现类似于组态软件但功能远比组态软件强大。安...

weixin_39859819的博客 3839

移星科技 modbus-tcp 转 modbus-Rtu模块

修改参数后,不要关闭Nport软件,然后 modbus-tcp 转 modbus-Rtu模块就可以当作四个普通串口使用了,连接设备时直接按照串口通讯设置参数即可。输入端采用modbus-tcpt通讯,输出端按照modbus-Rtu485连接通讯设备,通过IP端口号分别访问四个连接对象。例如:sensor_port->connect_port("COM1",115200);创建后会出现四个串口,选中串口,点击setting,可修改串口参数;2、将通讯模块设置为虚拟串口使用。运行Npcom,创建虚拟串口。

lg_cool_的博客 438

Modbus数据采集模块是什么?

本文详细介绍了Modbus数据采集模块的概念、应用以及HiWoo Box如何一次采集多个Modbus设备数据的方法。通过了解和应用HiWoo Box这一高效的数据采集设备,我们可以更好地实现工业自动化的数据采集和监控需求提高生产效率和管理水平。

weixin_50072277的博客 1586

modbus_tk模块

modbus_tk模块 通过modbus-RTU 读取地址,调用后返回反馈数值和故障信息。 modbus_tk模块安装 pip install pymodbus_tk 下面代码功能;读取地址为0x42700 长度为43个数值。 1 # -*- coding: utf_8 -*- 2 3 4 import serial 5 import...

weixin_30790841的博客 2134

MODBUS模拟量采集模块(艾莫迅)编程应用

这篇博客记录和分享MODBUS模拟量采集模块的使用和编程技巧,有关MODBUS通信的基础知识大家可以参考下面文章链接:如何提高MODBUS通信数据刷新速率MODBUS 扫描器的使用介绍SMART PLC MODBUS-RTU通信下面我们介绍我们的 SMART PLC和MODBUS模拟量采集模块的接线配置。

RXXW_Dor的博客 787

VB.Net实现Modbus通信模块开发详解

通过本章内容,我们深入解析了 Modbus TCP/IP 协议的结构,掌握了在 VB.NET 中使用 TcpClient 和 NetworkStream 实现通信的具体方法,并结合实战案例展示了如何与远程 PLC 进行寄存器读写操作。下一章将聚焦于具体功能码的应用,进一步提升 Modbus 编程的实际能力。Modbus 功能码 0x01 用于读取从设备中一组线圈的状态。每个线圈为一个布尔值(0 或 1),表示开关状态。

weixin_33814090的博客 1224

modbus-rtu串口modbus通信例子C语言:实现PC与modbus io模块的完美互动

modbus-rtu串口modbus通信例子C语言:实现PC与modbus io模块的完美互动 去发现同类优质开源项目:https://gitcode.com/ 在自动化控制和工业通信领域,modbus协议因其简单、易用、通用性强而备受青睐。今天,我们将为大家介绍一款开源项目——modbus-rtu串口modbus通信例子C#语言,该项目以其核心功能与实用场景成为开发者的首选工具。 项目介绍 mo...

gitblog_06758的博客 626

FreeModbus手册(中文版)

FreeModbus手册(中文版)

NIModbus功能模块:Labview下的Modbus通信利器

NIModbus功能模块:Labview下的Modbus通信利器 【下载地址】NIModbus功能模块 NI Modbus功能模块是一款专为Labview设计的Modbus底层驱动模块,能够轻松集成到您的开发环境中。只需将模块文件夹复制到Labview安装目录,即可立即使用。该模块经过实际项目验证,具备极高的稳定性和可靠...

gitblog_06762的博客 849

c51_Freemodbus.rar_c51 freemodbus_free modbus C51_freemodbus C51

FreeMODBUS一个奥地利人写的Modbus协议。它是一个针对嵌入式应用的一个免费(自由)的通用MODBUS协议的移植。Modbus是一个工业制造环境中应用的一个通用协议

STM32的DMA模块及Protues仿真实验

(一)DMA简介      DMA(Direct Memory Access,直接存储器访问), 用于在外设与存储器之间以及存储器与存储器之间提供高速数据传输。可以在无需任何 CPU 操作的情况下通过 DMA 快速移动数据。这样节省的 CPU 资源可 供其它操作使用。      STM32F407共有两个 DMA 控制器,总共有 16 个数据流(每个控制器 8 个),每一个 DMA 控制器都用于管理 一个或多

weixin_45930204的博客 2849

AIR724 4G模块Modbus网关,实现MODBUS 和 MQTT任意透传

AIR724模块Modbus网关,实现MQTT转换 今天介绍重点功能,Modbus转MQTT网关。Modbus及DL645十分常用,但是现在主流通信协议已经是MQTT,实现modbus和mqtt双向映射非常有用。 网关架构 功能设计 配置页面 DTU作为网关设备,实现Modbus RTU数据包和Json字串的映射,主要特征为: 定义通用参数: 串口号、串口超时 以设备为单位定义采集指令,包含:采集周期,采集指令 以寄存器为单位定义映射字段,字段在不同设备之间需要保持唯一 上传通道功能: 按设计周期定时

咸鱼钟的博客 8573

AI驱动视频剪辑自动化:cutcli命令行工具重塑工作流

视频剪辑自动化是提升内容生产效率的关键技术,其核心原理在于通过程序化指令替代手动操作,将创意执行过程代码化。这项技术的价值在于能够将创作者从重复性劳动中解放,实现批量化、标准化的视频内容生产,尤其适用于社交媒体运营、产品宣传等高频产出场景。通过封装专业软件(如剪映/CapCut)的底层草稿格式,自动化工具在保证工业级渲染质量的同时,提供了可编辑的中间态,为AI智能体(Agent)与生产工具的结合提供了清晰接口。本文以cutcli为例,深入探讨了如何通过命令行工具和AI助手,构建从自然语言指令到可编辑视频草稿

weixin_27210125的博客 1057

【物联网设备端开发】ESP32 使用RS485模块实现Modbus通信

常用 Modbus 公共功能码下表所示。0x05 写单个线圈0x06 写单个保持寄存器0x0F 写多个线圈0x10 写多个保持寄存器除了广播模式的报文以外,其他所有查询报文都希望能够获取一个正常的响应报文。如果一切正常,则从站设备将返回一个正常响应报文,该响应报文的功能码与请求报文的功能码一致。另外,对于字操作的功能码,存在多字节存储的大小端问题,因此主站设备和从站设备必须保持一致的规则处理,约定 Modbus 传输中的数据字段的字节序。

开源物联网项目商业化作者 7760

【AUCell打分】:评估一个基因集在单细胞转录组的每个细胞中特定的活性程度

AUCell使用曲线下面积来计算输入基因集的一个有意义的基因子集是否在每个细胞的表达基因中富集。AUC 分数在所有细胞中的分布允许探索特征的相对表达。由于评分方法是基于排名的,因此 AUCell 与基因表达单位和归一化程序无关。此外,由于细胞是单独评估的,因此可以很容易地应用于更大的数据集。

weixin_40695088的博客 1万+

深度学习二分类实战:用Python+Keras搞定基因表达数据预测(附完整代码)

本文详细介绍了如何使用Python和Keras构建深度学习模型进行基因表达数据的二分类预测。通过数据预处理、特征选择、神经网络构建及优化策略,特别针对小样本场景提供了调参技巧和模型解释方法。文章还包含完整的代码示例,帮助读者快速掌握深度学习在生物信息学中的应用。

weixin_30642561的博客 245
上一篇: 实现FreeModbus协议所需要的软/硬件需求
下一篇: Modbus协议寄存器操作
control_tech
博客等级 码龄17年 53粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值