GD32F4xx 移植agile_modbus软件包与电能表通信

GD32F4xx MCU
专栏收录该内容
¥49.90
¥99.00
25 篇文章

1. agile_modbus

1.1 简介

agile_modbus是一个轻量级的Modbus协议栈,主要特点:

  • 支持RTU和TCP协议,采用纯C语言开发,不涉及任何硬件接口,可直接在任何形式的硬件上使用。
  • 由于它不涉及硬件,因此可以在串口上运行tcp协议,在网络上运行RTU(远程终端单元)协议。
  • 支持符合Modbus格式的自定义协议。
  • 同时支持多个Master和多个Slave
  • 使用简单,只需要初始化RTU或TCP句柄,然后调用对应的API进行打包数据和解压数据即可。

1.2 下载

agile_modbus软件包下载地址:https://gitee.com/RT-Thread-Mirror/agile_modbus

2. agile_modbus使用

2.1 源码目录

agile_modbus 软件包目录如下图所示:

VIP agile_modbus移植 摘要:本文讲解了如何移植agile_modbus RTU部分 开通可读全文·2.6k 阅读·27 点赞·42 收藏 阅读全文

相关推荐

Agile Modbus STM32裸机移植 从机使用

初始化RTU/TCP环境 ( agile_modbus_rtu_init / agile_modbus_tcp_init )在本实验中只用到了agile_modbus.c、agile_modbus.h文件。Agile Modbus 是一个轻量级的 Modbus 协议栈,可以满足用户在任何场景下的需求。Agile Modbus时我们可以查看Agile Modbus帮助文档进行使用。需只要在回调函数中,根据功能码对应位置编写所需功能代码即可。根据帮助手册的指示进行移植Agile_modbus。

m0_65548585的博客 2346

手把手教你用Agile Modbus协议栈实现RTU主从通信(附完整代码)

本文详细介绍了如何利用Agile Modbus协议栈实现工业级RTU主从通信,涵盖环境搭建、主从站开发、异常处理及性能优化等全流程。通过实战代码示例,帮助开发者快速掌握Modbus RTU通信技术,提升工业自动化设备的开发效率。

weixin_42715608的博客 259

RT-Thread GD32F4xx 软件包agile_modbus

GD32F4xx MCU的RT-Thread标准版工程,使用agile_modbus软件包实现Modbus RTU Master 、Slave。

madao1234的博客 909

[GD32F103CBT6] STM32HAL库+串口+Modbus RTU 从机

这是博主进的第一家公司学习的很重要的知识,想当哇塞。而且 我接触的第一个项目就是STM32G+AG128的及MCU+FPGA,并且我是负责这个项目的硬件设计和MCU程序编写,搞电机和Modbus RTU的,这就对我很有激励。

sinat_58149788的博客 3150

基于agile-modbus封装实现的跨平台modbus协议通信库

modbus_rt是一款完全基于C语言实现的可以运行在windows, linux, macos, RTOS上的modbus通信库。主要目的是针对控制系统和工业物联网的方向使用。 压缩包内包含文档、视频及使用第三方源码库(PikaPython-OpenHardware)。 modbus_rt可以同时支持slave模式和master模式,基于类似socket句柄的实现思想,可以很方便的支持多例模式。 它不仅仅是modbus协议的解析和实现,而是尽可能的在应用层做好实现和封装,做到开箱即用,而不需要做过多的应用层移植。

GD32_FreeModbus_GD32_gd32modbus移植_FreeModBus

gd32移植freemodbus示例工程

Pluto SDR新手避坑指南:从环境配置到第一个MATLAB收发程序(附完整代码)

本文为Pluto SDR新手提供全面的避坑指南,从硬件连接到MATLAB环境配置,再到第一个信号收发程序的实现。详细介绍了驱动安装、常见问题排查以及关键参数设置,帮助用户快速上手软件定义无线电(SDR)技术,并附有完整代码示例。

weixin_33168937的博客 326

保姆级教程:用QSTEM和DrProbe搞定你的第一张STEM模拟图(附Fe3O4实例文件)

本文提供了一份详细的STEM模拟图像生成教程,涵盖从晶体结构获取到最终图像模拟的全过程。通过QSTEM和DrProbe软件的操作指南,帮助材料科学研究者快速掌握STEM模拟技术,特别适合初学者。教程包含Fe3O4实例文件,详细解析参数设置、计算优化和结果分析等关键步骤。

weixin_33730836的博客 535

虚拟机扩容——非LVM分区

虚拟机扩容——非LVM分区

ytraister的博客 3908

基于ROS2 Humble和VGR数据集完整部署GADEN气体分散仿真环境及模型替换实践

文章摘要 本文详细介绍了基于ROS2 Humble和VGR数据集部署GADEN气体分散仿真环境的方法。GADEN是一款专为移动机器人嗅觉研究设计的3D仿真框架,能够精确模拟气体扩散过程并集成多种环境传感器。文章从系统配置开始,逐步指导读者完成ROS2 Humble环境的搭建、GADEN框架的编译部署,以及VGR数据集的使用。VGR数据集包含120个基于真实房屋模型的CFD仿真案例,为研究提供高度真实的测试环境。教程涵盖了常见问题的解决方案,并深入探讨了气体扩散模型参数的修改方法,为机器人嗅觉算法的开发和验证

huanghm88的专栏 282

Android 编译系统(Build System)剖析

make是一种自动化构建工具,通过读取Makefile将源代码自动编译为可执行程序和库文件。

虎哥LoveDroid 2171

【26美赛F题 To Gen-AI, or Not To Gen-AI】(MCM/ICM)思路解析及代码分享

摘要:本文研究生成式人工智能(Gen-AI)对三类职业(STEM、技能型工艺、艺术)的影响,建立量化模型预测未来10-20年岗位需求变化。通过分析AI替代效应($R_{sub}(t)$)和增强效应($R_{enh}(t)$),提出差异化高校课程调整策略:STEM专业需加强AI集成能力,技能型工艺专业应结合智能工具与实操训练,艺术专业需平衡AI创作辅助与原创性培养。模型表明,高校通过针对性课程优化可提升毕业生在AI时代的就业竞争力,为教育决策提供数据支持。(149字)

一键难忘的博客 640

【人工智能】AI 智能体驾驭工程(Harness Engineering)全解析

OpenAI将Harness定义为让Agent能完成有用工作的系统工程,Harness Engineering则是持续设计、实现、迭代这套系统的方法论;Anthropic将其概括为「让模型真正成为可靠Agent的基础设施」;Martin Fowler/Thoughtworks则将其定义为「控制Agent各层循环的规格、质量检查与工作流指导体系」。强大的AI模型是一匹爆发力极强的烈马;Prompt Engineering是「对马喊话的技巧」,Context Engineering是「给马看的地图」;

奶爸的编程之路,也就一周冷个三天 5269

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

上一篇: Mcgs屏幕脚本程序
下一篇: CH32V3xx SPI Flash GD25Q32驱动
madao1024
博客等级 码龄8年 1371粉丝 132原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

madao1024

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值
⌂ 换网址