当前位置: 首页 > article >正文

上位机建立TCP/IP连接:Matlab实现

Python实现的参考:

Xilinx ZYNQ+TCP通信+Python上位机 实现实时视频传输系统 - 知乎 (zhihu.com)

GitHub - yg99992/Image_transfer_open_source: ZYNQ-7000 based data transfer through TCP/IP protocol

参考:



MATLAB实现tcp连接 - 知乎 (zhihu.com)

MATLAB :【11】一文带你读懂serialport串口收发原理与实现_matlab serialport-CSDN博客

 Transition Your Code to serialport Interface - MATLAB & Simulink - MathWorks 中国

Transition Your Code to tcpclient Interface - MATLAB & Simulink - MathWorks 中国

串行通信的动态输入缓冲区大小 - MATLAB Answers - MATLAB Central (mathworks.cn)

如何更改串口的收发缓存的大小 - MATLAB Answers - MATLAB Central

Which is the Buffer Size of a TCP/IP socket (tcpclient)? - MATLAB Answers - MATLAB Central (mathworks.cn)

版本更新:

因为TCP/IP函数即将被移除,之后请使用新的函数作为代替:

tcpip will be removed. Use tcpclient or tcpserver instead. For more information on updating your code, see Compatibility Considerations.

(To be removed) Create TCPIP object - MATLAB tcpip - MathWorks 中国

串行属性用于使用 serial 对象配置通信和配置读写行为,可以用来配置缓存区,

这个也将被删除,serial 配置缓冲区已经成为了历史。

        Removed Functionality The ValuesReceived and ValuesSent properties will be removed. You can calculate the number of values sent using the NumBytesAvailable property and the data type of the data available.

For example, if the NumBytesAvailable is 20 bytes of uint32 data, the number of values sent is five since each uint32 value is four bytes.
        The readasync and stopasync functions and the ReadAsyncMode and TransferStatus properties will be removed. The updated interface reads data asynchronously.
The BytesToOutput, InputBufferSize, and OutputBufferSize properties will be removed. Buffer sizes are automatically managed and sized as needed.
        The BreakInterruptFcn, OutputEmptyFcn, and PinStatusFcn properties will be removed. You can set callback functions using configureCallback in the updated interface, but not for these properties.
        The RecordDetail, RecordMode, RecordName, and RecordStatus properties will be removed.
        The TimerFcn and TimerPeriod properties will be removed. Use timer instead.
        The Name, Type, ObjectVisibility, Status, and Tag properties will be removed.

代码:

上半部分是用以前版本的函数写的,下半部分是新的;

简洁了很多。

clc;
clear all; 
close all; 
warning off;

% Config_list = ones(10,10,"uint8");
Config_list = zeros(10,10,"uint8");

% % set olden version
% Client_0 = tcpip("192.168.1.119",10000);
% 
% set(Client_0,'InputBufferSize',256*64);
% set(Client_0,'OutputBufferSize',256*64);
% 
% fopen(Client_0);
% % s is a serial object
% fwrite(Client_0,Config_list)

% set new version
Client_1 = tcpclient("192.168.1.119",10000,"Timeout",20,"ConnectTimeout",30);
% s is a serialport object
write(Client_1,Config_list)


http://www.kler.cn/a/232333.html

相关文章:

  • 大模型UI:Gradio全解11——Chatbot:融合大模型的聊天机器人(4)
  • uni-app vue3 常用页面 组合式api方式
  • Mybatis Plus 分页实现
  • 如何使用C#与SQL Server数据库进行交互
  • AV1视频编解码简介、码流结构(OBU)
  • 【Azure 架构师学习笔记】- Azure Function (2) --实操1
  • 发文新思路!双流卷积!CWT-DSCNN-MSA基于时序特征、cwt小波时频图的双流卷积融合注意力机制的故障识别程序!直接运行!
  • armbian ddns
  • 海纳思NAS盒子设置网卡静态IP
  • 基于BatchNorm的模型剪枝【详解+代码】
  • 浅谈instant run
  • 飞天使-linux操作的一些技巧与知识点8-zabbix6.0 容器搭建
  • C语言到底是高级语言还是低级语言?
  • 容器基础:Docker 镜像如何保证部署的一致性?
  • VMware17上安装centos7.9
  • SSM框架,Maven的学习(上)
  • Mybatis中的sql-xml延迟加载机制
  • DBeaver连接mysql时报错com.mysql.cj.jdbc.Driver的解决方法【修改驱动下载的maven地址和重新下载驱动】
  • 从github上拉取项目到pycharm中
  • 【数据分享】1929-2023年全球站点的逐月平均能见度(Shp\Excel\免费获取)
  • C++ “万能血“ void*指针
  • 一篇文章理解时间复杂度和空间复杂度
  • wyh的迷宫
  • Linux基础入门
  • 相机图像质量研究(9)常见问题总结:光学结构对成像的影响--工厂镜头组装
  • Ubuntu搭建计算集群