当前位置:网站首页>视觉上位系统设计开发(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;
}
}
边栏推荐
- 【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
- 【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
- XWiki安装使用技巧
- Besides lying flat, what else can a 27 year old do in life?
- Global and Chinese markets for sterile packaging 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
- [opengl] face pinching system
- Yolov5进阶之八 高低版本格式转换问题
- Remote server background hangs nohup
- Yolov5 series (I) -- network visualization tool netron
猜你喜欢
![[attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer](/img/9b/6ca8375ef8689a80d437665909ae30.png)
[attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer
![[ue4] Niagara's indirect draw](/img/8a/576022b5d19e1d6422ff0135c50c93.jpg)
[ue4] Niagara's indirect draw

【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现

Yolov5系列(一)——网络可视化工具netron

How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
![[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018](/img/2b/b23aeab584f89be6678c0fe059d4b6.png)
[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018

【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
![[probably the most complete in Chinese] pushgateway entry notes](/img/5a/6dcb75f5d713ff513ad6842ff53cc3.png)
[probably the most complete in Chinese] pushgateway entry notes
![[graphics] real shading in Unreal Engine 4](/img/8d/53775c7570c5578f4fe985592bb305.jpg)
[graphics] real shading in Unreal Engine 4

5.2-5.3
随机推荐
使用Tengine解决负载均衡的Session问题
Byte practice surface longitude
Detailed comments on MapReduce instance code on the official website
[ue4] HISM large scale vegetation rendering solution
北京共有产权房出租新规实施的租赁案例
【微信小程序】WXSS 模板样式
redis单线程问题强制梳理门外汉扫盲
Stress test WebService with JMeter
[ue4] cascading shadow CSM
Redis主从、哨兵、集群模式介绍
[engine development] in depth GPU and rendering optimization (basic)
Using Tengine to solve the session problem of load balancing
What is machine reading comprehension? What are the applications? Finally someone made it clear
[pytorch learning notes] transforms
Puppet自动化运维排错案例
[opengl] pre bake using computational shaders
Apache ant extension tutorial
406. 根据身高重建队列
【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
Global and Chinese market of marketing automation 2022-2028: Research Report on technology, participants, trends, market size and share