当前位置:网站首页>视觉上位系统设计开发(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;
}
}
边栏推荐
- 4-29——4.32
- Using Tengine to solve the session problem of load balancing
- 解决pushgateway数据多次推送会覆盖的问题
- mysql innodb 存储引擎的特性—行锁剖析
- Tensor 省略号(三个点)切片
- Remote server background hangs nohup
- 【微信小程序】WXSS 模板样式
- 406. Reconstruct the queue according to height
- QT program font becomes larger on computers with different resolutions, overflowing controls
- What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
猜你喜欢
Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
[ue4] HISM large scale vegetation rendering solution
5.2-5.3
Yolov5系列(一)——網絡可視化工具netron
4-20-4-23 concurrent server, TCP state transition;
[opengl] advanced chapter of texture - principle of flowmap
[engine development] in depth GPU and rendering optimization (basic)
【微信小程序】WXSS 模板样式
Didi off the shelf! Data security is national security
随机推荐
Global and Chinese markets of AC electromechanical relays 2022-2028: Research Report on technology, participants, trends, market size and share
零拷贝底层剖析
There are links in the linked list. Can you walk three steps faster or slower
Global and Chinese market of iron free motors 2022-2028: Research Report on technology, participants, trends, market size and share
[pytorch learning notes] transforms
Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
Using Tengine to solve the session problem of load balancing
Finally, someone explained the financial risk management clearly
2022/02/14
[engine development] rendering architecture and advanced graphics programming
Vs+qt application development, set software icon icon
Leetcode the smallest number of the rotation array of the offer of the sword (11)
解决pushgateway数据多次推送会覆盖的问题
[ue4] cascading shadow CSM
Didi off the shelf! Data security is national security
Redis主从、哨兵、集群模式介绍
4-20-4-23 concurrent server, TCP state transition;
4-29——4.32
Incluxdb2 buckets create database
Global and Chinese markets for ionization equipment 2022-2028: Research Report on technology, participants, trends, market size and share