Exemple #1
0
        private Task ReceivedCommunicationSetupAck(Memory <byte> buffer)
        {
            var data = S7CommSetupAckDataDatagram.TranslateFromMemory(buffer);

            _s7Context.MaxParallelJobs = data.Parameter.MaxAmQCalling;
            _s7Context.PduSize         = data.Parameter.PduLength;
            _concurrentJobs            = new SemaphoreSlim(_s7Context.MaxParallelJobs);
            UpdateConnectionState(ConnectionState.Opened);
            _connectEvent.Set(true);

            return(Task.CompletedTask);
        }
Exemple #2
0
        private void ReceivedCommunicationSetupAck(Memory <byte> buffer)
        {
            var data = S7CommSetupAckDataDatagram.TranslateFromMemory(buffer);

            var oldSemaCount = _s7Context.MaxAmQCalling;

            _s7Context.MaxAmQCalling = data.Parameter.MaxAmQCalling;
            _s7Context.MaxAmQCalled  = data.Parameter.MaxAmQCalled;
            _s7Context.PduSize       = data.Parameter.PduLength;

            UpdateJobsSemaphore(oldSemaCount, _s7Context.MaxAmQCalling);

            _ = UpdateConnectionState(ConnectionState.Opened);
            _connectEvent.Set(true);
        }
Exemple #3
0
        private void ReceivedCommunicationSetupAck(Memory <byte> buffer)
        {
            var data = S7CommSetupAckDataDatagram.TranslateFromMemory(buffer);

            _s7Context.MaxAmQCalling = data.Parameter.MaxAmQCalling;
            _s7Context.MaxAmQCalled  = data.Parameter.MaxAmQCalled;
            _s7Context.PduSize       = data.Parameter.PduLength;

            if (_concurrentJobs != null)
            {
                _concurrentJobs.Dispose();
            }
            _concurrentJobs = new SemaphoreSlim(_s7Context.MaxAmQCalling);

            _ = UpdateConnectionState(ConnectionState.Opened);
            _connectEvent.Set(true);
        }