public override void DeviceConn(MelsecA1ENetConfig config) { NetworkDevice = new MelsecA1ENet(); ((MelsecA1ENet)NetworkDevice).IpAddress = config.IP; ((MelsecA1ENet)NetworkDevice).Port = config.Port; if (!System.Net.IPAddress.TryParse(config.IP, out System.Net.IPAddress address)) { throw new Exception("IpAddress input wrong"); } ((MelsecA1ENet)NetworkDevice).ConnectClose(); OperateResult connect = ((MelsecA1ENet)NetworkDevice).ConnectServer(); if (!connect.IsSuccess) { throw new Exception("Connect Failed"); } }
public FormMelsec1EBinary( ) { InitializeComponent( ); melsec_net = new MelsecA1ENet( ); }