write serialstring with datetime to file