using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOB_WIN_MBUS
{
    /// <summary>
    /// Implementazione classe connessione ModBus TCP,
    /// comprensiva dei parametri delle aree di memoria
    /// </summary>
    public class connParamModBusTCP
    {
        #region Public Fields

        /// <summary>
        /// Indirizzo di base degli Holding Register
        /// </summary>
        public int holdRegBaseAddr = 40001;

        /// <summary>
        /// Indirizzo IP del PLC
        /// </summary>
        public string ipAdrr = "";

        /// <summary>
        /// Base area x lettura
        /// </summary>
        public string memAddrRead = "";

        /// <summary>
        /// Base area x scrittura
        /// </summary>
        public string memAddrWrite = "";

        /// <summary>
        /// Size memoria lettura
        /// </summary>
        public int memSizeRead = 0;

        /// <summary>
        /// Size memoria scrittura
        /// </summary>
        public int memSizeWrite = 0;

        /// <summary>
        /// Timeout ping
        /// </summary>
        public int pingMsTimeout = 250;

        /// <summary>
        /// Porta di comunicazione
        /// </summary>
        public int port;

        /// <summary>
        /// Indica se usare baseAddress calcolati o da config
        /// </summary>
        public bool useCalcBaseAddr = true;

        #endregion Public Fields
    }
}