private void ReadExample() { // 此处以M100寄存器作为示例 bool bool_M100_0 = s7NetServer.ReadBool("M100.0").Content; byte byte_M100 = s7NetServer.ReadByte("M100").Content; // 读取M100的值 short short_M100 = s7NetServer.ReadInt16("M100").Content; // 读取M100-M101组成的字 ushort ushort_M100 = s7NetServer.ReadUInt16("M100").Content; // 读取M100-M101组成的无符号的值 int int_M100 = s7NetServer.ReadInt32("M100").Content; // 读取M100-M103组成的有符号的数据 uint uint_M100 = s7NetServer.ReadUInt32("M100").Content; // 读取M100-M103组成的无符号的值 float float_M100 = s7NetServer.ReadFloat("M100").Content; // 读取M100-M103组成的单精度值 long long_M100 = s7NetServer.ReadInt64("M100").Content; // 读取M100-M107组成的大数据值 ulong ulong_M100 = s7NetServer.ReadUInt64("M100").Content; // 读取M100-M107组成的无符号大数据 double double_M100 = s7NetServer.ReadDouble("M100").Content; // 读取M100-M107组成的双精度值 string string_M100 = s7NetServer.ReadString("M100", 10).Content; // 读取M100-M109组成的ASCII字符串数据 // 读取数组 short[] short_M100_array = s7NetServer.ReadInt16("M100", 10).Content; // 读取M100-M101组成的字 ushort[] ushort_M100_array = s7NetServer.ReadUInt16("M100", 10).Content; // 读取M100-M101组成的无符号的值 int[] int_M100_array = s7NetServer.ReadInt32("M100", 10).Content; // 读取M100-M103组成的有符号的数据 uint[] uint_M100_array = s7NetServer.ReadUInt32("M100", 10).Content; // 读取M100-M103组成的无符号的值 float[] float_M100_array = s7NetServer.ReadFloat("M100", 10).Content; // 读取M100-M103组成的单精度值 long[] long_M100_array = s7NetServer.ReadInt64("M100", 10).Content; // 读取M100-M107组成的大数据值 ulong[] ulong_M100_array = s7NetServer.ReadUInt64("M100", 10).Content; // 读取M100-M107组成的无符号大数据 double[] double_M100_array = s7NetServer.ReadDouble("M100", 10).Content; // 读取M100-M107组成的双精度值 }