Hi,
I am trying to create a Master using a serial port to monitor 2 Outstations ( RTU1 connects to RTU2 using serial cable).
My PC connects to RTU1 using a serial port (COM 7), and I am expecting to be able to read data from both RTU1 and RTU2 using the multidrop option, where RTU1 slave address=1, and RTU2 slave address=2
Here is my code:
IDNP3Manager dnp3Manager = DNP3ManagerFactory.CreateManager(1, new CustomPrintingLogAdapter());
var DNPChannelSerial = dnp3Manager.AddSerial(
"SerialPort",
LogLevels.ALL,
new ChannelRetry(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(1)),
new SerialSettings(portAddress, 9600, 8, StopBits.None, Parity.None, FlowControl.None),
new CustomChannelListener()
);
MasterStackConfig masterStackConfig = new MasterStackConfig();
masterStackConfig.link.localAddr = 1024;
masterStackConfig.link.remoteAddr = 1;
masterStackConfig.master.disableUnsolOnStartup = true;
var newMaster = DNPChannelSerial.AddMaster("RTU1", new PrintingSOEHandler(), DefaultMasterApplication.Instance, masterStackConfig);
var integrityPoll = newMaster.AddClassScan(ClassField.AllClasses, TimeSpan.FromMinutes(1), new PrintingSEOHandler(), TaskConfig.Default);
var classPoll = newMaster.AddClassScan(ClassField.AllEventClasses, TimeSpan.FromSeconds(15), new new PrintingSEOHandler(), TaskConfig.Default);
MasterStackConfig masterStackConfig2 = new MasterStackConfig();
masterStackConfig2.link.localAddr = 1024;
masterStackConfig2.link.remoteAddr = 2;
masterStackConfig2.master.disableUnsolOnStartup = true;
var newMaster2 = DNPChannelSerial.AddMaster("RTU2", new PrintingSOEHandler(), DefaultMasterApplication.Instance, masterStackConfig2);
var integrityPoll = newMaster2.AddClassScan(ClassField.AllClasses, TimeSpan.FromMinutes(1), new PrintingSEOHandler(), TaskConfig.Default);
var classPoll = newMaster2.AddClassScan(ClassField.AllEventClasses, TimeSpan.FromSeconds(15), new PrintingSEOHandler(), TaskConfig.Default);
newMaster.Enable();
newMaster2.Enable();
After running this code, I was able to get data from RTU1, but cannot get data from RTU2 due to this error message on Log:
RTU2 - WARN - Task was explicitly rejected via response with error IIN bit(s): Disable Unsolicited
I also already tried changing the disableUnsolOnStartup config but the same result.
This error only occurs when I am trying to create 2 masters on 1 channel for multidrop.
Is there something wrong with the code?
Thanks