started read g code in a thread logic