1734-232 ASC Module help (Barcode Application)

TL140

Lifetime Supporting Member
Join Date
Jun 2014
Location
South Carolina
Posts
152
Hello all,

I'm working with the 1734-232 ASC module in a barcode application. The scanner reads the barcode and gets stored in the Local:4:I.Data. We have many machines that do this, however all of them take different approaches.

Some use the ARD command as the scanner is connected directly to the serial port. This data gets stored in a string and is handled from there.

We have other machines that use the same module, however they are used in a manner in which certain pieces can be taken out of the barcode to represent certain things. Only using 1 or 2 numbers in the barcode, they are used in EQU blocks fairly simply.

The unfortunate bit is I've been task with adding a barcode to read a certian piece in an assembly process that had to read the whole barcode of 13 numbers and make sure they correlate to the first barcode read.

I have attempted to use the FSC instruction, but my code got messy relatively quick. My question is there an easier way to do this such as take Local:4:I.Data[0]-Local:4:I.Data[12] and concatenate it and just compare to a value? The data in the array is a SINT.
 
If I understand your problem correctly you have to compare two barcodes for equality and don't want to go through the array elements one at a time.
If so, you can create a string out of the data from your 1734-232ASCs and compare those strings with a EQU instruction. See the attached image to get an idea.

Depending on the setup of the modules and the barcode (variable length?) you have to do some math to calculate the starting element and the length for the COP instruction first.

In my setup I have to offset the starting point because of escape sequences, and a fixed length of 10 characters for the barcode.

Barcode_COP.png
 
Yes, you assessed my issue correctly.

I attempted to CPS the data from the module to a string in a UDT I made, and got some crazy output that look like '516$r$r$r$r$r$r$r$r$r$r$r...'. The data is given one element for the header and one element for the footer. The data from the module is a SINT.
 
You'll have to set the .LEN element of the String as well.

$r is shorthand for "Carriage Return". I'm not sure why it shows up multiple times in your case, but it's very likely the last character in the string that comes from the barcode device.
 
+1 for Ken

The length of the barcode data that you are receiving is not fixed, I assume that you copied a fixed amount of characters to your UDT and set the length accordingly. You will have to calculate the length of the relevant data. You can use the FIND instruction to get the position of the first appearance of '$r'. The length is the difference between your starting element and this position.

The FIND instruction can only be used on strings, maybe you have to create a string from the raw data of your module and use this to extract your barcode data.

Edit:

Do you look at the modules .Length member to set the length of the CPS? This should reflect the length of each string the module receives. The modules data represents a string basically, .Data[0] ... Data[x] holds the ASCII chars of the buffered string and .Lenght is the length of the buffered string
 
Last edited:
Thank you both for the informative responses. I will have to re-code and attempt these methods. I'll post an update when I am able to try this again. I go on vacation after tonight though so it may be a little before I am able to try it again.

Also, @Ken, I have the string set in the UDT for STRING[13] type. Is this what you mean by defining the length attribute? Also, could the reason the newline character be appearing multiple times is because of overflow? I did set the string to be the exact length but i may have put my blocks out of sequence. I don't have the program in front of me so I cant give more info, but I appreciate you guys working with me with what I can provide currently.
 
Do you look at the modules .Length member to set the length of the CPS? This should reflect the length of each string the module receives. The modules data represents a string basically, .Data[0] ... Data[x] holds the ASCII chars of the buffered string and .Lenght is the length of the buffered string

Yes, when the data is read the .LEN goes to 15. one for the header and the footer. I remember the header was decimal 10. I think thats new line. the footer was decimal 13 for carriage return. When i started my CPS I did it at element [1] and the len was set for 13, as thats the len of the data set i need to read.
 

Similar Topics

Can anyone please help me, im trying to communicate with an RS232 device 9 a conductivity meter (SIGMATEST 2.069) using a point IO 1734-232ASC. I...
Replies
8
Views
2,923
Hello All, In a new project, I have to send string data to a display from a control logix L71 controller. The display unit is having only one...
Replies
2
Views
2,184
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
725
I'm having a bit of trouble using the 1734-ASC232 card. I can seem to send out strings out fine, but reading strings seems to be a problem. I can...
Replies
2
Views
1,072
Hi everyone, new to forum. Since very long time i having issue with 1734-AENT module, after some period of time its keep stuck in error (simmilar...
Replies
14
Views
429
Back
Top Bottom