public void GetBlocksOfTypeTest() { var client = new Dacs7Client(); client.Connect(ConnectionString); Assert.True(client.IsConnected); var bc = client.GetBlocksOfType(PlcBlockType.Ob); client.Disconnect(); Assert.False(client.IsConnected); }
public void GetBlocksOfTypeTest2() { var client = new Dacs7Client(); client.Connect(ConnectionString); Assert.True(client.IsConnected); var bc = client.GetBlocksOfType(PlcBlockType.Sdb); foreach (var c in bc) { Console.WriteLine(c.Number); } client.Disconnect(); Assert.False(client.IsConnected); }
/// <summary> /// This method starts a request to the plc to get information of the loaded data blocks /// </summary> /// <returns></returns> public IEnumerable <string> GetDataBlocks() { return(_client.GetBlocksOfType(PlcBlockType.Db).Select(bi => $"DB{bi.Number}")); }