Direct bar code writing in turning operations