master.addPeriodicScan(Duration.ofSeconds(scanIntervalSeconds), Header.Range16((byte) 40, (byte) 3, rangeStart, rangeStop);Hi Chad,In response to your questions:1) Generally speaking, you want to stay away from custom scans as much as possible. Hopefully your device supports BinaryOutputStatus events, and you can get these changes with your normal event scan (class 1/2/3).
master.addPeriodicScan(Duration.ofMinutes(1), Header.getEventClasses());
master.addPeriodicScan(Duration.ofMinutes(1), Header.allObjects((byte)60, (byte)1));
Adam,
I am working with Chad on this project. The device side CommandHandler (which I am working on) updates the outstation with AnalogOutputStatus and BinaryOutputStatus immediately when the command is received from DirectOperate method as below:
public CommandStatus DirectOperate(ControlRelayOutputBlock command, ushort index){
ChangeSet changeSet = new ChangeSet();
changeSet.Update(new BinaryOutputStatus(command.code == ControlCode.LATCH_ON, (byte)BinaryQuality.ONLINE,DateTime.Now), index);
m_outstation.Load(changeSet);
//Do other stuff}
public CommandStatus DirectOperate(AnalogOutputDouble64 command, ushort index){
ChangeSet changeSet = new ChangeSet();
changeSet.Update(new AnalogOutputStatus(command.value, (byte)AnalogQuality.ONLINE, DateTime.Now), index);
//Do other stuff}
We expect this to trigger an event which updates the master (which Chad is working on) with the Analog/Binary output status. But somehow only few of the AnalogInput events (updated in the different section of the code but on the same outstation) gets updated in the master (assuming only those events that get modified?) from an event scan in the master as below:
master.addPeriodicScan(Duration.ofMinutes(1), Header.getEventClasses());
Note that however all the analog/binary input/outputs are available with a class 0 scan as below :
master.addPeriodicScan(Duration.ofMinutes(1), Header.allObjects((byte)60, (byte)1));