12345678910111213141516171819202122232425262728293031323334353637 |
- 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;
- }
- /// <summary>
- /// C#与PLC之间进行数据交换的结构体定义
- /// 采用TwinCAT ADS方式进行输入、输出区的数据更新
- /// </summary>
- [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;
- }
- }
|