Node parentSlave = XMLTools.findParent(parentRegister, "slave");
String slaveAddress = XMLTools.getAttribute(ModbusPalXML.XML_SLAVE_ID2_ATTRIBUTE, parentSlave);
if( slaveAddress!= null )
{
ModbusSlaveAddress msa = ModbusSlaveAddress.parse(slaveAddress);
slave = getModbusSlave(msa);
}
else
{
slaveAddress = XMLTools.getAttribute(ModbusPalXML.XML_SLAVE_ID_ATTRIBUTE, parentSlave);
int slaveId = Integer.parseInt(slaveAddress);
ModbusSlaveAddress msa = new ModbusSlaveAddress(slaveId);
slave = getModbusSlave(msa);
}
}
// bind the register and the automation