Barcode to string conversion issues

You need to find out what is causing the .len to get overwritten and when it occurs. Does this happen every time you scan a barcode? Is it happening after every 5 minutes randomly? Or maybe even when you are just pressing the trigger, but not scanning anything? You shouldn't have to delete the tag and recreate just to fix the length.

Also, there could be an issue with the barcode itself? Are you sure that barcode you have is correct? Is the barcode something you downloaded from a website or you receive from somewhere? Review these and let us know more info.

@Steve Bailey It's definitely naive of me to assume it was A.B., I just noticed the .len from the first post, and later on he posted the tag "CCDataMan_SINT256:I:0" which reminded me of rs logix programming. I've only worked with a.b. plcs so I could not relate this to anything else.
 
You can use the FSC instruction to find the number of Characters in your string. As long as it is a continuous string. No Blank Characters in the middle of string. I made a UDT String Type of 484 characters and then made a Tag called HandScan_String of that data type to copy the scanner results into and move the FSC.pos into it's length.

FSC_Length.jpg
 
The .LEN should be defined by you. Here is a picture of what I am doing. I am using MOV to move whatever length I desire into my .len of the string.

I was able to get the job done by using something simular to what you had. I .MOV a value of 400 (what the barcode .LEN will always be) into the .LEN AFTER the data was transfered. Thanks for a little insight!! Time for a beer!!
 
A question to the OP. Why did you assume that everyone would automatically know that the Cognex is sending its data to an Allen Bradley PLC? A question to alive15 and widelto. How did you know it was an Allen Bradley question? Is that particular model of Cognex scanner strictly for use with AB?

Steve:
To be honest I don´t not know what plc OP is using, I have the same scanner with AB and I have no problem at all.

Maybe the FIND instruction guided me to think of AB plc.
 

Similar Topics

I'm wondering if anyone has a solution where I can use a barcode scanner to input a string into a PLC tag. All AB hardware/software. I'm aware...
Replies
8
Views
17,959
I have a barcode scanner reading bin labels and handing a string to an Laser Guided vehicle to place the bin in its appropriate location based on...
Replies
1
Views
1,257
hi, i try to capture barcode data using UDT with SINT ascii array. i have all the data i need but it in array format, how can i convert to 1...
Replies
5
Views
3,044
Hi There, I am programming a cmore EA9-T87 to gather the data and save on SD card. And this time I want to use barcode scanner to trigger the bit...
Replies
2
Views
3,495
Anyone know SATO printers? I have a PLC program that outputs strings through a serial port to a SATO printer. (See "Printer Routine" and...
Replies
7
Views
5,536
Back
Top Bottom