using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using Aitex.Core.RT.IOCore; namespace Aitex.Triton160.RT.PLC { [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct PLC_INPUT_DATA { [MarshalAs(UnmanagedType.ByValArray, SizeConst = IOGroupManager.DioBlockLength)] public Byte[] DI; [MarshalAs(UnmanagedType.ByValArray, SizeConst = IOGroupManager.AioBlockLength)] public float[] AI; } /// /// C#与PLC之间进行数据交换的结构体定义 /// 采用TwinCAT ADS方式进行输入、输出区的数据更新 /// [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct PLC_OUTPUT_DATA { [MarshalAs(UnmanagedType.ByValArray, SizeConst = IOGroupManager.DioBlockLength)] public Byte[] DO; [MarshalAs(UnmanagedType.ByValArray, SizeConst = IOGroupManager.AioBlockLength)] public float[] AO; } }