コード例 #1
0
        public AddressingForm(LadderAddressing addressing)
        {
            InitializeComponent();

            txtInput.Value   = addressing.ListInputAddress.Count;
            txtInput.Enabled = false;

            txtOutput.Value   = addressing.ListOutputAddress.Count;
            txtOutput.Enabled = false;

            txtMemory.Value   = addressing.ListMemoryAddress.Count;
            txtMemory.Enabled = true;

            txtTimer.Value   = addressing.ListTimerAddress.Count;
            txtTimer.Enabled = true;

            txtCounter.Value   = addressing.ListCounterAddress.Count;
            txtCounter.Enabled = true;
        }
コード例 #2
0
        public Address ReadAddress(ref Int32 position, LadderAddressing addressing)
        {
            //Instruction instruction = new Instruction(ReadOperationCode(position));
            Instruction instruction = InstructionFactory.createInstruction(ReadOperationCode(position));

            switch (instruction.OpCode)
            {
            case OperationCode.None:
                break;

            case OperationCode.LineEnd:
                break;

            case OperationCode.NormallyOpenContact:
            case OperationCode.NormallyClosedContact:
                AddressTypeEnum addressType = GetAddressingType(position);
                position++;
                Int32 addressIndex = ReadInteger(position);
                position++;
                return(addressingServices.Find(addressType, addressIndex));;

            case OperationCode.OutputCoil:
            case OperationCode.Reset:
                break;

            case OperationCode.ParallelBranchBegin:
            case OperationCode.ParallelBranchEnd:
            case OperationCode.ParallelBranchNext:
                break;

            case OperationCode.Counter:
                break;

            case OperationCode.Timer:
                break;
            }
            return(null);
        }
コード例 #3
0
 public void SetAddressing(LadderAddressing value)
 {
     addressing = value;
 }
コード例 #4
0
 public void SetAddressing(LadderAddressing addressing)
 {
     this.addressing = addressing;
 }