当前位置:网站首页>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;
}
}
边栏推荐
- 【pytorch学习笔记】Datasets and Dataloaders
- Jvm-04-runtime data area heap, method area
- Use of Tex editor
- [transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018
- Matplotlib drawing label cannot display Chinese problems
- Explanation of time complexity and space complexity
- Tensorflow realizes verification code recognition (I)
- Troubleshooting method of CPU surge
- 视觉上位系统设计开发(halcon-winform)-2.全局变量设计
- 【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
猜你喜欢
【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
Construction of operation and maintenance system
视觉上位系统设计开发(halcon-winform)
Jvm-08-garbage collector
Jvm-09 byte code introduction
Reentrantlock usage and source code analysis
视觉上位系统设计开发(halcon-winform)-1.流程节点设计
求字符串函数和长度不受限制的字符串函数的详解
el-switch 赋值后状态不变化
随机推荐
Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
QT common sentence notes
Detailed comments on MapReduce instance code on the official website
第04章_逻辑架构
Apache ant extension tutorial
Qt常用语句备忘
SQL server installation location cannot be changed
Can‘t connect to MySQL server on ‘localhost‘
Kubernetes advanced training camp pod Foundation
Redis主从、哨兵、集群模式介绍
Global and Chinese market of solder bars 2022-2028: Research Report on technology, participants, trends, market size and share
Yolov5 advanced 8 format conversion between high and low versions
TPS61170QDRVRQ1
Mysql报错:[ERROR] mysqld: File ‘./mysql-bin.010228‘ not found (Errcode: 2 “No such file or directory“)
Tensorflow realizes verification code recognition (I)
Using TCL (tool command language) to manage Tornado (for VxWorks) can start the project
【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
[daily training] 395 Longest substring with at least k repeated characters
什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
Enable multi-threaded download of chrome and edge browsers