make sure plc is stopped before configuring it, use mkstemp to create a temp file...