Auto Incrementing Serialization of barcodes?

Does anyone have an suggestions of how I could implement serialization of barcodes being printed in a manufacturing process.

The serial number within the barcode is specific to the particular product being produced at that terminal at that time to trace and track individual cases being produced. Each case incrementing the serial number by one until reaching the max serial number and rolling over.

I guess I was thinking I would write to a database to get a auto incremented number to use for the serial number. Then update that record with the production specific data from that particular product being weighed and labeled for that specific case at that time… but then how would I contend with reaching the max serial number and rolling over?

Curious about anyone’s thoughts on that.
Thank you,
Casey

An “autoincrementing primary key” will guarantee a unique value in the database for that attribute. You would also store the serial number in a different column, a date/time, and whatever other production information you need. Over time you would get different entries with the same “serial number”, but each would have a unique value for the key, which uniquely identifies any given barcode.

You can also incorporate the Julian Date into the serial number-- for example today (April 3, 2012) is the 94th day of the year so something like 12094 would help ensure no duplicates for about 100 years-- then it’s someone else’s problem! :thumb_left:

Add however many digits to cover the number of produce pieces in the day (and will fit on the label) and you’re good to go.

Thanks for the great suggestions. That sounds solid to me.

All are good ideas. When dealing with a bar code encoding scheme, it is wise to factor in how it will used down stream in the process and the environmental conditions it is exposed to as far as marring or scratching is involved. Generally the less data you encode, the better.