Pricne,
I think no matter what you do you'll have to rotate the pipe at either the marking station or the ID station. Whatever you marking is (etched bar code, or color code etc..), you will need to either mark it around the entire circumference, or ID it by passing the sensor around the entire circumference.
Where ever it is, the "Rotation Station" would be a series of ball rollers place in a cradeling configuration. A rotating pneumatic tire would then come in contact with the pipe to rotate it for marking or I.D.ing it.
Personally I'd lean twards painting colored stripes around the parimiter of the pipe. Most of the paint would likely survive the process, and it could be ID either by a machine or visually.
However you didnt mention how many codes you need. Do you want to ID just size and schedule (pipe type), or give each pipe a specific serial number?
Color coding painted stripes for size and scheduale would be fairly simple. Basic colors like White, Red, Green, Orange, blue, grey, would be easy to pick up or see. If you had six possable colors in six bars/stripes, that would provide 46,656 different codes. More bars or colors would increase the possable codes dramaticly. (colors^bars = possable codes). The only drawback with painting wold be that it would require more maintenance to clean the spray heads, and restock the paint.
What I'm courious about is: what is the spicific purpose of the ID?? I think that would make a difference in how you'd mark the pipe.