本例子是测试ads通信的. 1.首先添加TwinCAT.Ads引用 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Reflection; using System.Runtime.Interop…
倍福TwinCAT3上位机与PLC通信测试(ADS通信) 包含C#和C++代码 本次测试需要环境: VS2013,TwinCAT3(本人版本TC31-Full-Setup.3.1.4018.16) 代码:C#代码,PLC程序代码,C++代码(官方提供) 测试部分: 测试包含:bool类型,int类型,long类型,real类型,lreal类型,string类型,数组,以及结构体 部分测试(这里没有结构体嵌套) PLC程序Main程序 基本类型部分 代码: PROGRAM MAIN VAR B…