Esempio n. 1
0
 public Adam6217Operation(string ip, int id)
 {
     this.id    = id;
     dataDic    = new Dictionary <int, string>();
     adamModbus = new AdamSocket();
     slaveIp    = ip;
     modbusPort = 502;
     adamSeries = Advantech.Adam.AdamType.Adam6200;
     adamType   = Advantech.Adam.Adam6000Type.Adam6217;
 }
Esempio n. 2
0
        /// <summary>
        /// 根据参数,构造modbus,生成adamSocket实例
        /// </summary>
        /// <param name="ip">从站ip</param>
        /// <param name="series">研华板卡的系列</param>
        /// <param name="type">研华板卡的具体型号</param>
        /// <param name="port">modbus通信端口,默认为502</param>
        public AdamHelper(string ip, AdamType series,
                          Adam6000Type type, int port = 502)
        {
            adamModbus = new AdamSocket();
            slaveIp    = ip;
            modbusPort = port;
            //adamSeries = Advantech.Adam.AdamType.Adam6200;

            adamSeries = (Advantech.Adam.AdamType)series;
            adamType   = (Advantech.Adam.Adam6000Type)type;
        }