| | |
| | | //https://www.ad.siemens.com.cn/productportal/Prods/S7-1200_PLC_EASY_PLUS/SmartSMS/060.html |
| | | //https://www.ad.siemens.com.cn/productportal/Prods/S7-1200_PLC_EASY_PLUS/07-Program/02-basic/01-Data_Type/09-String.html |
| | | |
| | | /// <summary> |
| | | /// 合肥佳通读取叠盘机 |
| | | /// </summary> |
| | | /// <param name="pyl">偏移量地址,佳通byte占位所以可以用这样方式直接读取写入 DB200.DBX0.1</param> |
| | | /// <returns></returns> |
| | | public static int ReadDpj(string pyl) |
| | | { var plc = new Plc(CpuType.S71500, "192.168.1.1", 0, 1); |
| | | S7Helper.Link(plc); |
| | | return (int)plc.Read(pyl); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 合肥佳通写入叠盘机 |
| | | /// </summary> |
| | | /// <param name="pyl">偏移量地址,佳通byte占位所以可以用这样方式直接读取写入 DB200.DBX0.1</param> |
| | | /// <param name="value">写入值 byte类型只能0 1</param> |
| | | /// <returns></returns> |
| | | public static int WriteDpj(string pyl,int value) |
| | | { |
| | | var plc = new Plc(CpuType.S71500, "192.168.1.1", 0, 1); |
| | | S7Helper.Link(plc); |
| | | return (int)plc.Write(pyl, value); |
| | | |
| | | } |
| | | internal static short[] ReadInt(string device, int db, int byteAddr, int count) { |
| | | short[] result = null; |
| | | try { |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// |