1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| //data write and read public object? write_read_value(string type, int db_area, int iDB_num, int iDB_start_byteadd, string w_or_r, object values, int bit_address = 0, int count = 1) { if (w_or_r == "w") if (type == "bool") { my_plc.WriteBit(S7_registertype(db_area), iDB_num, iDB_start_byteadd, bit_address, (bool)values); }
else { my_plc.Write(S7_registertype(db_area), iDB_num, iDB_start_byteadd, values); }
return my_plc.Read(S7_registertype(db_area), iDB_num, iDB_start_byteadd, S7_datatype(type), count); }
|