Parser will get three information(On, Active, Temperature) at time X, then parser write it to file like this.
printf( "%s status of machine is %s", X, On );
printf( "%s Mode of machine is- %s", X, Active );
printf( "%s Temp is- %s", X, Temperature);
Please change like this
printf( "%s %s,%s,%s", X, On, Active, Temperature );