当前位置:网站首页>视觉上位系统设计开发(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;
}
}
边栏推荐
- Construction of operation and maintenance system
- 视觉上位系统设计开发(halcon-winform)-6.节点与宫格
- Global and Chinese market of trimethylamine 2022-2028: Research Report on technology, participants, trends, market size and share
- [opengl] geometry shader
- 5.2-5.3
- 【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
- [opengl] pre bake using computational shaders
- Class part2
- [transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018
- 什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
猜你喜欢
![Mysql报错:[ERROR] mysqld: File ‘./mysql-bin.010228‘ not found (Errcode: 2 “No such file or directory“)](/img/cd/2e4f5884d034ff704809f476bda288.png)
Mysql报错:[ERROR] mysqld: File ‘./mysql-bin.010228‘ not found (Errcode: 2 “No such file or directory“)

什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用

【Transformer】入门篇-哈佛Harvard NLP的原作者在2018年初以逐行实现的形式呈现了论文The Annotated Transformer

cpu飙升排查方法

Remote server background hangs nohup

链表有环,快慢指针走3步可以吗

视觉上位系统设计开发(halcon-winform)-3.图像控件
![[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

北京共有产权房出租新规实施的租赁案例

High quality workplace human beings must use software to recommend, and you certainly don't know the last one
随机推荐
Solve the problem that pushgateway data will be overwritten by multiple push
基础SQL教程
Detailed comments on MapReduce instance code on the official website
Zero copy underlying analysis
Global and Chinese markets for flexible chips 2022-2028: Research Report on technology, participants, trends, market size and share
Nppexec get process return code
远程服务器后台挂起 nohup
什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
Vs+qt multithreading implementation -- run and movetothread
视觉上位系统设计开发(halcon-winform)-2.全局变量设计
Besides lying flat, what else can a 27 year old do in life?
TPS61170QDRVRQ1
[graphics] hair simulation in tressfx
cpu飙升排查方法
4-33--4-35
Kubernetes 进阶训练营 Pod基础
SQL server installation location cannot be changed
5.2-5.3
Didi off the shelf! Data security is national security
Search in the two-dimensional array of leetcode sword offer (10)