当前位置:网站首页>倍福使用AdsRemote组件实现和C#的ADS通讯
倍福使用AdsRemote组件实现和C#的ADS通讯
2022-08-02 06:21:00 【黄昏和星空】
C# 倍福ADS的正确打开方式,使用AdsRemote组件优雅的通过ADS通讯,支持WPF窗体控件的绑定机制,做上位机页面很方便,大大节省了开发时间。
倍福的官方文档给的例子我就不多说了,今天介绍一种更改优雅的使用ADS组件进行通讯的方式,非常符合高级语言的编程风格,在也不用到处readany,writeany了。
https://github.com/nikvoronin/AdsRemote
AdsRemote:Beckhoff的TwinCAT.Ads API库的高级接口可以节省大量的开发时间。您不需要网络线程或句柄。只需声明一个C#变量,并通过变量属性将其绑定到PLC var。就这样。
我最喜欢的使用方式是变量变化后自动通知,类似观察者模式,不用傻傻的死等结果的反馈。Adsremote组件内部会使用一个线程来对取变量,当值发生变化时,调用ValueChanged事件。
PLC instance
First you have to create an instance of PLC object. This one wiil be like a factory that produces linked variables.
PLC plc = new PLC(“5.2.100.109.1.1”);
When device connected or disconnected
plc.DeviceReady += Plc_DeviceReady;
plc.DeviceLost += Plc_DeviceLost;
[…]
private void Plc_DeviceReady(object sender, AdsDevice e)
{
Log(“READY [” + e.Address.Port.ToStri
边栏推荐
- Reverse resolve dns server
- At age 94, pioneer Turing award winner, computational complexity theory, Juris Hartmanis, died
- About the local server problem after ue4.27 pixel streaming package
- awk语法-01-基础语法(命令、选项、内部变量)
- MySQL high-level --- storage engine, index, lock
- 提交代码流程
- Connection reset by peer problem analysis
- MySQL Advanced SQL Statements (2)
- 数据库概论之MySQL表的增删改查2
- C# FileInfo class
猜你喜欢

聊天机器人如何提升独立站的营销水平?

实例032:反向输出II

正则表达式的理解学习

See the picture to understand | How to choose sales indicators to measure the health of business growth

MySQL Advanced Study Notes

APP special test: traffic test

交换网络----三种生成树协议

How the Internet of Things is changing the efficiency of city operations

Pagoda+FastAdmin 404 Not Found

张驰课堂:六西格玛测量系统的误差分析与判定
随机推荐
堡垒机、堡垒机的原理
JS初识高阶函数和函数柯里化
MySQL Advanced - MVCC (ultra-detailed finishing)
HCIP 第二天
交换部分 VLAN
[Dataset][VOC] Eyewear dataset 6000 in VOC format
笔记本开机黑屏提示:ERROR 0199:System Security-Security password retry count exceeded
punch day05
实例027:递归输出
The nacos source code can not find the istio package
MySQL Advanced Statements (1)
2022年8月计划,着重ue4视频教程
postgres 多个变量填充字符串,字串格式化
论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》
[21天学习挑战赛——内核笔记](一)——设备树的概述(硬件、目标、效果、文件类型)
速看!PMP新考纲、PMBOK第七版解读
Launch Space on-premises deployment (local) Beta!
PMP新考纲考试内容介绍
Submit code process
【暑期每日一题】洛谷 P1255 数楼梯