New to Forum and new to Ascii

t67

Member
Join Date
Jun 2010
Location
Indiana
Posts
10
Greetings,
I am relatively new to programming and work for a small company, so programming is taught as you go along. Have been able to generate programs for lockdowns for simple failsafe- incorporated Cognex cameras and Atlas Copco runners to Micrologix, but I am getting killed on Ascii. I have a 1500 that I am running a symbol scanner to in order to compare part number barcodes. The thought is to "teach" a part number to begin with and then compare subsequent scans to see if the same pn was used. These parts are going through a leak test; when the leak test passes, a witness mark is placed on the casting. We apply a label to the casting and need to make sure that:
1> It is there
2> It is the correct pn (labels are pre printed)

My problem (I think) is that I cannot see what is going on because my port is taken by the scanner and I really do not know of a way to go online and see what is happening. I am including a PDF of what I think should be working, but is not. If anyone could thow something at me to try, that would be great. I have chapter 20 from 1762 that I am reading and I think the commands I tried were used in context, but not sure.

Some other information
-pn is 7 digits
-SN is on the label, but is 9 characters (2 alpha, 7 numeric)
-Teach button is a standard AB pushbutton light
-I have a ton of the 1761 devicenet interfaces- but am clueless to their full potential- could I get the scanner to go through it somehow and then be able to go online when a scan is not being made??

Any help, suggestions, require reading is extremely appriciated.

Later, Jon
 
Buy a 1764-LRP with two ports (CH0 ASCII to Scanner/Printer) and CH1 DF1 to RSLinx, to do your software development, then put the 1764-LSP back in the machine before you ship.

You can find used LRP processeors on E-Bay, or used PLC distributors.

Make sure that you ASCII Clear Buffers are one shoted and not left on. You example shows the ACL in the on state, and your Ascii Read Line in ER. You can't CLEAR and READ at the same time.

Try using ARD Ascii Read, instead of ARL Ascii Read Line.

Use Hyper Terminal to see what your scanner is spitting out.

Make sure all your baud, and protocols match, we always use 9600,N,8,1 as suprisingly many things are default to that. And it is easy to remember.
 
Thanks for the reply, Plastic.

I am currently trying to write a more simplistic program based off of your suggestions.

I do have one question regarding the ASCII buffer; say for instance that an incorrect barcode is scanned, should i recognize it and clear the buffer then (one shot, of course) or should i let it go and have another scan. I do not know how information could be differentiated other than clearing

1> after sucessful comparison
2> After an incorrect scan

Thanks for any help

Later
 
There is no need to clear buffers. Just RESET the ARD Control.

Set your PLC to do an ASCII read. When the appropiate amount of charathers are read, you will get an ARD.DN bit

When you get the DN bit based on reading the expected amount of characters.

There will be a result read string.

Use subsqunet ASCII Compare String instructions (to known valid static or pre-defined string). If valid compare, then allow machine continue logic. If the compare is invalid match, then flush all incoming string data, reset the Control of the ARD, and read the new string. IF match then allow normal machine cycle.
 
So I finally got back to programming this and I have no problems with the original teach barcode and subsequent compare barcodes- (plastic suggestions worked out very well)but when I have to "switch" product and reteach, the compare string will not advance the logic. I am including the program that I made up.

First line is useless, but it worked with it- so I left it in
lines 1-5 is for the teach (push button)
lines 9-11 set up a pulse so that multiple barcodes can be read if incorrect

I think the whole problem could be what Plastic talked about which was "If the compare is invalid match, then flush all incoming string data, reset the Control of the ARD, and read the new string."

Appearantly I am clueless on how to do this correctly- I even tried the RES; did not get errors- but it did not do anything that I could tell either. I hope that ASCII becomes painfully obvious very soon.

Thanks in advance for any input.
 
Your ARD on rung 001 has an expected string length of 7. Is the total ASCII content of the read, as confirmed by hyperterminal. Just beacause you want 7 ascii content ie.. a part number, may not be what you need to set the length at.

If hyperterminal shows sentinels and/or cr/lf. You need to account for the ENTIRE incoming string.

If you only need to check the contents of less than the full string, the use AEX ascii string extract to pull your specific content out of the full string for later subsequent compare.

Your ARD on rung 007 needs an expected string length.
 
I will give the AEX a try tomorrow and work with only part of the PN. I did verify that the PN on hyperterminal only showed the exact PN- no sentinels. If I teach the PN and run the expect part with the correct label, it never fails. If I try to scan an incorrect PN (it will always have the same amount of characters), it will not release the part until the correct one is scanned. If I scan another number that is not correct, it may or may not recover. If I reteach, all bets are off. I think the AEX, extracting 5 digits, will really work because I should be able to clear easily.

Thanks for your help on this.

One other thing, I looked through the AB manuals and could not find one thing out. Say I leave the length at 0- that is supposed to default to maximum amount of characters; so if there was a bunch of junk in the queue, would it take all of it out so that next scan only new information was moved to the string? My concern was that someone could inadvertently scan the SN, which is right next to PN; ARD would grab 7 of the 9 in the Queue, leave the two and use them as the start of the next compare function(with the next string of data). Is this correct?

Later, Jon
 

Similar Topics

  • Locked
  • Sticky
Hi folks, If you're having any login issues kindly send an email to [email protected] or use the 'contact us' link on the bottom of every page to get...
Replies
0
Views
1,095
Hi Folks, After many, many hours of setup/testing/tuning/etc I'm happy to announce our brand new shiny PLC forum is coming out of beta and...
Replies
30
Views
2,133
Hi All, Firstly… Merry Christmas to all of you! Secondly, as some of you may have noticed I made some modifications to our backend to address...
Replies
29
Views
7,084
For the past 2 days when I come here it stops on a Verification page to see if my connection is secure, Clicking on a thread goes to the same page...
Replies
1
Views
357
Hello, Whenever I google some bug regarding simatic step7 or siemens PLCs, the first results are usually from siemens support website. But when I...
Replies
2
Views
560
Back
Top Bottom