当前位置:网站首页>Visual upper system design and development (Halcon WinForm) -4 Communication management
Visual upper system design and development (Halcon WinForm) -4 Communication management
2022-07-03 15:19:00 【11eleven】
This paper will briefly introduce the design idea of communication between the system operation and the actual upper or lower level .
General production line machine vision project , After the products are put in place through the conveyor line ,PLC Inform the vision to take photos and analyze images , The final result is output to PLC And output to the upper MES Systems, etc .
This article takes TCP For example, communication . Pictured :

Here we define the communication device , Take the visual system as TCPSERVER, Inferior and superior by TCP client ,
First, define the server IP port , Then define the message receiving event , Message sending event . Here we will use the application of global variables mentioned above .

Define how to handle the received characters in the receiving event , And trigger the changes of other variables after receiving, so as to trigger the work of other threads of the system ,

In the sending event, the sending event is triggered under certain conditions , And the sent data can be combined with customized fixed content and dynamic variables .

The above figure shows the whole process from communication trigger execution to result feedback .
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;
}
}
边栏推荐
- Global and Chinese market of solder bars 2022-2028: Research Report on technology, participants, trends, market size and share
- Jvm-03-runtime data area PC, stack, local method stack
- High quality workplace human beings must use software to recommend, and you certainly don't know the last one
- Jvm-06-execution engine
- Jvm-02-class loading subsystem
- 使用Tengine解决负载均衡的Session问题
- 视觉上位系统设计开发(halcon-winform)-4.通信管理
- Kubernetes帶你從頭到尾捋一遍
- Global and Chinese markets for indoor HDTV antennas 2022-2028: Research Report on technology, participants, trends, market size and share
- Using Tengine to solve the session problem of load balancing
猜你喜欢

视觉上位系统设计开发(halcon-winform)
![[probably the most complete in Chinese] pushgateway entry notes](/img/5a/6dcb75f5d713ff513ad6842ff53cc3.png)
[probably the most complete in Chinese] pushgateway entry notes

Yolov5系列(一)——網絡可視化工具netron

运维体系的构建

el-switch 赋值后状态不变化

What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding

函数栈帧的创建和销毁

Can‘t connect to MySQL server on ‘localhost‘

Kubernetes带你从头到尾捋一遍

Basic SQL tutorial
随机推荐
【日常训练】395. 至少有 K 个重复字符的最长子串
Reentrantlock usage and source code analysis
Yolov5 advanced seven target tracking latest environment construction (II)
[pytorch learning notes] datasets and dataloaders
Concurrency-02-visibility, atomicity, orderliness, volatile, CAS, atomic class, unsafe
视觉上位系统设计开发(halcon-winform)-4.通信管理
Troubleshooting method of CPU surge
Jvm-06-execution engine
Kubernetes - yaml file interpretation
redis缓存穿透,缓存击穿,缓存雪崩解决方案
Halcon与Winform学习第一节
GCC cannot find the library file after specifying the link library path
Tensor ellipsis (three points) slice
Kubernetes vous emmène du début à la fin
Incluxdb2 buckets create database
Kubernetes带你从头到尾捋一遍
基于SVN分支开发模式流程浅析
Besides lying flat, what else can a 27 year old do in life?
视觉上位系统设计开发(halcon-winform)-5.相机
Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share