How To Create A Check Digit Using Vb Script S’abonner
I have a huge problem and have no idea hot to solve since I'm not Familiar with VB script at all. I need to create a barcode containing 13 digits and it needs to be serialzed and it needs to have a check digit and since the value changes everytime i print a label the check digit needs to change too. I look around the VB option and i saw it has a "check digit" option but i have no idea how to set it up. Can anyone here help me please?? i need to create a MOD32 check digit.
Thank you.
5 commentaires

Ian Cummings
ModérateurWhat barcode symbology are you supposed to be using?
If not directly supported in the symbology options then you would set about creating a check digit in the following manner:
1. Create the barcode object with the principal data source. Give this data source a name, which we can then reference from a VB script.
2. Create a second data source in the same barcode object using a VB script data type. Edit the VB script.
3. To make a calculation on the main data source of the barcode we make reference to the data source previously named. For example if we named the data source "btBarcode" then the reference in the VB script would look like this.
Format.NamedSubStrings("btBarcode").Value
4. In a very simple fashion a MOD32 calculation could be made like the following. However, such barcode check digits are calculated normally in a more complex "weighted" manner. You'll need to get details on how your specific MOD32 should be calculated.
value = Format.NamedSubStrings("btBarcode").Value Mod 32
First of all thank you for the help,
I'm suppost to multiply every digit in the barcode by a weighting number, which is equal to it’s position in the barcode string starting with 12. Sum the products modulo 32.
For example : 9AE2222BFE2A barcode will be break down like this
(9*12)+(10*11)+(14*10)+(2*9)+(2*8)+(2*7)+(2*6)+(11*5)+(15*4)+(14*3)+(2*2)+
(10*1) = 589
(589) Mod 32 = 13
The check digit in this case is 13, im suppost to use letters as well, and letters are given a diiferen value
for example A=10, B=11, C=12, D=13.....
Sorry for the delay -- I was caught up in other things -- the below VB script should do the trick:
varTotal = 0 varMultiplier = 12 For varCount = 1 To 12 varTotal = varTotal + ((Int("&H" & Mid(Format.NamedSubStrings("btBarcode").Value, varCount, 1))) * varMultiplier) varMultiplier = varMultiplier -1 Next value = varTotal Mod 32
Hi, I have a similar request for a VB Script but I need it for MOD-11 with 1,3,7 Weighting. I have not got the actual formula to work it out but I might be able to get it with some effort.
Here is some sample data with the check digit.
04508760 check digit is 0
04508784 check digit is 4
04508801 check digit is 1
thanks
Paul
Also, here are some 6 characters plus a check digit samples
8095020 check digit is 0
8095013 check digit is 3
8095068 check digit is 8
Vous devez vous connecter pour laisser un commentaire.