Esempio n. 1
0
        public void AddDatablock(int id, int size)
        {
            CheckServerRunning();
            if (id < 1)
            {
                throw new ArgumentException("Invalid id for datablock - id must be > 1", nameof(id));
            }
            if (size < 1)
            {
                throw new ArgumentException("Invalid size for datablock - size must be > 1", nameof(size));
            }
            if (datablocks.ContainsKey(id))
            {
                throw new InvalidOperationException($"A Datablock with id = {id} already exists");
            }
            var db = new DatablockDescription(id, size);

            while (!datablocks.TryAdd(id, db))
            {
            }
            server.RegisterArea(S7Server.srvAreaDB, id, ref datablocks[id].Data, datablocks[id].Data.Length);
        }
Esempio n. 2
0
 private void AddDatablock(int id, DatablockDescription datablock)
 {
     AddDatablock(id, datablock.Size);
     UpdateDatablockData(id, datablock.Data);
 }
Esempio n. 3
0
 public void AddDatablock(int id, DatablockDescription datablock)
 {
     throw new System.NotImplementedException();
 }