当前位置:网站首页>视觉上位系统设计开发(halcon-winform)-4.通信管理
视觉上位系统设计开发(halcon-winform)-4.通信管理
2022-07-03 15:08:00 【11eleven】
本文将简单介绍系统运行与实际的上位或者下位进行通信的设计思路。
一般产线机器视觉项目,都是经过输送线产品就位后,PLC通知视觉进行拍照图像分析,最后结果输出到PLC以及输出到上位MES系统等。
本文以TCP通信为例。如图:

这里我们对通信设备进行定义,以视觉系统作为TCPSERVER,下位以及上位 为TCP客户端,
首先定义好服务端的IP端口,然后定义消息接收事件,消息的发送事件。这里就会用到前面所讲的全局变量的应用。

定义好接收事件中收到字符后如何处理,以及收到后触发其他变量的变化从而触发系统其他线程工作,

发送事件中同理某些条件下触发发送事件,并且发送的数据可自定义固定内容与动态变量进行组合。

上图则是通信触发执行到结果反馈的全过程了。
public abstract class DeviceCommumicationClient
{
public long Id { set; get; }
public CommumicationTypeEnum CommumicationType { set; get; }
public string Name { set; get; }
public string Ip { get; set; }
public bool IsNeedRestart { set; get; } = false;
public bool IsRemove { set; get; } = false;
public int Port { get; set; }
public bool IsAutoReConnect { set; get; }
public bool IsActive { set; get; }
public bool IsFirst { set; get; }
public List<DeviceMessageHistory> ReceiveMsgList { set; get; }
public virtual void SendMessage(string msg) {
}
public virtual string ReceiveMessage()
{
return "";
}
public virtual bool Init()
{
return true;
}
public virtual bool Stop()
{
return true;
}
}
边栏推荐
- Kubernetes 进阶训练营 Pod基础
- Leetcode sword offer find the number I (nine) in the sorted array
- Using Tengine to solve the session problem of load balancing
- 链表有环,快慢指针走3步可以吗
- Relationship between truncated random distribution and original distribution
- [opengl] geometry shader
- [engine development] rendering architecture and advanced graphics programming
- [opengl] bone animation blending effect
- 零拷贝底层剖析
- Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
猜你喜欢

【可能是全中文网最全】pushgateway入门笔记

Yolov5系列(一)——網絡可視化工具netron
![[ue4] geometry drawing pipeline](/img/30/9fcf83a665043fe57389d44c2e16a8.jpg)
[ue4] geometry drawing pipeline
![[ue4] HISM large scale vegetation rendering solution](/img/a2/2ff2462207e3c3e8364a092765040c.jpg)
[ue4] HISM large scale vegetation rendering solution

Functional modules and application scenarios covered by the productization of user portraits
![[engine development] rendering architecture and advanced graphics programming](/img/a4/3526a4e0f68e49c1aa5ce23b578781.jpg)
[engine development] rendering architecture and advanced graphics programming

C string format (decimal point retention / decimal conversion, etc.)
![[graphics] adaptive shadow map](/img/93/a6a3c7716331368c90c2c86da11f55.jpg)
[graphics] adaptive shadow map

第04章_逻辑架构
![[opengl] advanced chapter of texture - principle of flowmap](/img/dd/6208122fcc578caaf098301b185e03.jpg)
[opengl] advanced chapter of texture - principle of flowmap
随机推荐
Relationship between truncated random distribution and original distribution
High quality workplace human beings must use software to recommend, and you certainly don't know the last one
什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
Search in the two-dimensional array of leetcode sword offer (10)
Neon global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
Explanation of time complexity and space complexity
Chapter 14 class part 1
Apache ant extension tutorial
[pytorch learning notes] datasets and dataloaders
Global and Chinese market of marketing automation 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets of AC electromechanical relays 2022-2028: Research Report on technology, participants, trends, market size and share
5-1 blocking / non blocking, synchronous / asynchronous
零拷贝底层剖析
406. 根据身高重建队列
XWiki安装使用技巧
[combinatorics] permutation and combination (set permutation, step-by-step processing example)
QT program font becomes larger on computers with different resolutions, overflowing controls
[ue4] geometry drawing pipeline
CentOS7部署哨兵Redis(带架构图,清晰易懂)
QT - draw something else