Barcode Scanner to SLC5/03

Leeroy

Member
Join Date
Oct 2012
Location
Canada
Posts
66
Having issues with a barcode scanner. With the PLC I'm using the barcode scanner is picking up 4 characters (2 at the beginning and at 2 at the end) that aren't actually supposed to be part of the characters being sent to the PLC. My assumption is that they are special characters that represent the beginning and end of the data but the PLC doesn't know that and actually thinks they are part of the data being sent. If somebody could confirm that this is actually correct. Is there a way to solve this?

For extra notes:
Barcode Scanner is called Motorola DS4208
Manual here: http://2dbarcodepilot.com/docs/Hardware_Configuration_ Guide.pdf
 
SLC500 series, 5/03 is the exact model as I mentioned in the title.

Oops, i somehow missed those big bold letters.

Okay, the data is in ASCII, but is it in "A" type ascii file or "ST" type of string file?

Since it's connected serially, there are options in the serial port settings in the SLC CH0 user settings (assuming user ascii mode) for the termination characters. If those are set to match what the device is sending, that should take care of the trailing characters.

The leading characters, you may have to get rid of with some ladder logic.

The AEX (Ascii extract) command can do that for you (with ST file type).
 
It's in String (ST) format. Yes it's user ascii mode, I've never used the termination characters before so since the 2 beginning characters are ^J and ending characters are ^M, should I try putting those charcters instead of what's there already?

EDIT: Just found out those termination characters are in hex format, should have know that.
Tried changing but that didn't work, the plc likes to see the carriage return(\d, what's in the termination character 1 before changing) as the termination character, which does makes sense. When I changed the character it was just adding on to the string and not going to the next line (the cr and lf).

Another problem, I tried printing off a couple of other barcodes to scan and now they don't have the leading characters I was mentioning, why could that be? If it has to do with ink that would be funny.
 
Last edited:
I don't think that the termination characters will "fix" the beginning of the string, they simply tell the ARL instruction when the end of the line of text has been read. Be careful changing them, since they will also be appended to any AWA instructions you might be using.

The AEX should work for your string.

To remove two characters, you want something like this:
attachment.php


EDIT: If the lead characters "come and go" you could extract them to another working string element, then use an ASR (ASCII string compare) instruction to see if they match the bogus characters (by populating another spare string element with those unwanted characters), then only remove them if there is a match.
 
Last edited:
Okay I see how that would fix/get rid of the beginning characters. The thing is that when I printed off different barcodes just to use them for teseting purposes, the beginning characters didn't even show up anymore, just the ending ones.
 

Similar Topics

I thought I was nearly finished on this TIA Portal/s7-1212C project (famous last words)... Up until now, I'd developed the PLC/HMI such that the...
Replies
10
Views
1,554
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,970
Hello Everyone. I am working on a project where I need to scan in 2 Barcodes to populate 2 different tags. A glue Batch and a product serial...
Replies
12
Views
3,094
hi guys, I have to write a program to trigger and receive data from a barcode reader via an RS485 module plugged on Wago PFC 200. Does anyone know...
Replies
6
Views
2,728
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,261
Back
Top Bottom