当前位置:网站首页>视觉上位系统设计开发(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;
}
}
边栏推荐
- Yolov5 advanced seven target tracking latest environment construction (II)
- 【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
- Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
- 使用JMeter对WebService进行压力测试
- XWiki安装使用技巧
- [graphics] real shading in Unreal Engine 4
- Pytoch deep learning and target detection practice notes
- Yolov5系列(一)——网络可视化工具netron
- App全局异常捕获
- redis单线程问题强制梳理门外汉扫盲
猜你喜欢

There are links in the linked list. Can you walk three steps faster or slower
![[engine development] in depth GPU and rendering optimization (basic)](/img/71/abf09941eb06cd91784df50891fe29.jpg)
[engine development] in depth GPU and rendering optimization (basic)
![[ue4] geometry drawing pipeline](/img/30/9fcf83a665043fe57389d44c2e16a8.jpg)
[ue4] geometry drawing pipeline
![[engine development] rendering architecture and advanced graphics programming](/img/a4/3526a4e0f68e49c1aa5ce23b578781.jpg)
[engine development] rendering architecture and advanced graphics programming

第04章_逻辑架构
![[opengl] advanced chapter of texture - principle of flowmap](/img/dd/6208122fcc578caaf098301b185e03.jpg)
[opengl] advanced chapter of texture - principle of flowmap

Besides lying flat, what else can a 27 year old do in life?

Construction of operation and maintenance system

Yolov5 series (I) -- network visualization tool netron

什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
随机推荐
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
Pytoch deep learning and target detection practice notes
What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
C # realizes the login interface, and the password asterisk is displayed (hide the input password)
ASTC texture compression (adaptive scalable texture compression)
【pytorch学习笔记】Transforms
QT - draw something else
Explanation of time complexity and space complexity
【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
The method of parameter estimation of user-defined function in MATLAB
Global and Chinese markets for infrared solutions (for industrial, civil, national defense and security applications) 2022-2028: Research Report on technology, participants, trends, market size and sh
Yolov5 advanced nine target tracking example 1
【Transform】【NLP】首次提出Transformer,Google Brain团队2017年论文《Attention is all you need》
Global and Chinese market of iron free motors 2022-2028: Research Report on technology, participants, trends, market size and share
Mysql报错:[ERROR] mysqld: File ‘./mysql-bin.010228‘ not found (Errcode: 2 “No such file or directory“)
5.4-5.5
Use of Tex editor
MySQL reports an error: [error] mysqld: file '/ mysql-bin. 010228‘ not found (Errcode: 2 “No such file or directory“)
【日常训练】395. 至少有 K 个重复字符的最长子串
How does vs+qt set the software version copyright, obtain the software version and display the version number?