if(m_mb.get() != NULL)
{
wxString msg("Closing port \"");
msg.append(m_heatercomport);
msg.append("\" modbus port ");
wxLogMessage(msg);
readoutput->AppendText("Modbus Connection Closed\n");
m_mb.reset();
}
// open modbus connection
m_mb= boost::shared_ptr<modbus_t>( modbus_new_rtu(m_heatercomport.c_str(),9600,'N',8,1),modbus_free);