This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dataItems = new List<DataItem>(); | |
for (int i = 0; i < 1; i += 2) | |
{ | |
dataItems.Add(DataItem.FromAddress("DB800.DBW" + i)); | |
} | |
var ip = "10.10.11.38"; | |
var plc = new S7.Net.Plc(CpuType.S7300, ip, 0, 2); | |
Console.WriteLine("Connecting " + ip); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Read known string from PLC | |
/// </summary> | |
/// <param name="startAddr">start byte in format DBx.DBBy</param> | |
/// <returns>known string</returns> | |
public string ReadString(string startAddr) | |
{ | |
if (_plc.IsConnected) | |
{ | |
_plc.ClearLastError(); |