DaveE Posted April 10, 2014 Report Share Posted April 10, 2014 Good Morning, This has driven me to drink, well it seemed like a good excuse! I am trying to connect a Microscan HS-1 Barcode scanner through RS232 to Com Port 2 of a V120 PLC From what I can see I have everything set right, but when I trigger the hand held scanner the information that I have scanned does not appear to be sent to the PLC I have all my Baud rates, pre ambles and post ambles set right in the scanner, I feel if I have everything right, but I just cant get the flow of information. I have attached the program and am looking for someone brighter than me to see where my dumb *** has gone wrong, or at least point me in the right direction! One thing I am not 100% sure about is the cable I am using to connect the scanner to PLC, I am using a spare programming cable that came with the PLC..Is this my issue? smooth4.vlp Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 11, 2014 MVP 2023 Report Share Posted April 11, 2014 I tweaked the SCAN block a bit, removing the STX and ETX characters and relying only on silence for the end of message. Serial communication is always a PITA to make first contact. The programming cable should be OK. Keep beating on it. Joe T. smooth4 JT.vlp Link to comment Share on other sites More sharing options...
DaveE Posted April 11, 2014 Author Report Share Posted April 11, 2014 Joe I appreciate that. In fact I struggled through with a beer in my hand. And finally got it going Now the kicker. This was a V120. Now the powers that be said. Hey wouldn't it be nice to have a color touchscreen Ok I thought. And pulled out a V350. I saved the program to color. Switched the com2 to com1 and it didn't work again If I go back to the V120 it does so it's not the cables Any clues to where I am going wrong? It's the weekend and I would love to finish this thing so I can deal with life. Lol Thanks for listening to my rambles Link to comment Share on other sites More sharing options...
HigHTech Posted April 12, 2014 Report Share Posted April 12, 2014 Good Morning, This has driven me to drink, well it seemed like a good excuse! I am trying to connect a Microscan HS-1 Barcode scanner through RS232 to Com Port 2 of a V120 PLC From what I can see I have everything set right, but when I trigger the hand held scanner the information that I have scanned does not appear to be sent to the PLC I have all my Baud rates, pre ambles and post ambles set right in the scanner, I feel if I have everything right, but I just cant get the flow of information. I have attached the program and am looking for someone brighter than me to see where my dumb *** has gone wrong, or at least point me in the right direction! One thing I am not 100% sure about is the cable I am using to connect the scanner to PLC, I am using a spare programming cable that came with the PLC..Is this my issue? When it´s about communications I follow some guides: Barcode Readers: 1.- Connect the Barcode Reader to the pc and check it works properly. 2.- Connect the barcode Reader and use a comm terminal software like (hercules). You can check exactly what the barcode is sending. 3.- Configure the Barcode Reader trying to format the protocol to something standard (like STX and ETX). 4.- Connect the V120 with the comm terminal (hercules) and check the protocol is working and your logic is ok. 5.- Finally connect the Barcode Reader to the V120 and only then you are going to be closer to make the comm work. 1 Link to comment Share on other sites More sharing options...
Eyal Koren Posted April 13, 2014 Report Share Posted April 13, 2014 Joe I appreciate that. In fact I struggled through with a beer in my hand. And finally got it going Now the kicker. This was a V120. Now the powers that be said. Hey wouldn't it be nice to have a color touchscreen Ok I thought. And pulled out a V350. I saved the program to color. Switched the com2 to com1 and it didn't work again If I go back to the V120 it does so it's not the cables Any clues to where I am going wrong? It's the weekend and I would love to finish this thing so I can deal with life. Lol Thanks for listening to my rambles Hi DaveE, In general, the best way to debug communication issues is by monitoring the transmission. In Enhanced Vision models (like V350) you can do this via Info Mode. Do the following: 1. Press on any point on the screen for about 5 seconds. 2. Enter the password (default is 1111). 3. Go to Serial--> Monitor. Use the arrows to select port. Now you can see exactly what information (if any) is being transmitted 1 Link to comment Share on other sites More sharing options...
DaveE Posted April 13, 2014 Author Report Share Posted April 13, 2014 All Thanks so much I'm sure this info will help Dave Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 15, 2014 MVP 2023 Report Share Posted April 15, 2014 Just one beer? I converted your program and it didn't barf on my computer, but I don't have a barcode reader hooked up to test it. Did you re-direct your Protocol Config block to COM1 as well? The problem with connecting a serial device to a V130 or a V350 is you no longer have a second port to monitor what's going on. Tell the powers that be that you need to buy the second serial port card or better yet the Ethernet card. Anymore I always really push a second port of some kind for exactly this reason. Otherwise you're totally in the dark, and what's your time worth? The built-in sniffer Eyal describes is a great place to start. You're only limited by the small screen on the PLC an what it can hold. +1 on what HigHTech recommends. A terminal program is your best friend for either reading what the reader is spitting out or generating strings to send to the PLC and determining if your logic works. It helps if you have one that can display hex characters so you can see those annoying little control characters. I use this one- http://www.jtauser.com/Unitronics/Terminal/Terminal.zip It is very powerful despite its clunky appearance. Be sure to read the short Help file. Joe T. Link to comment Share on other sites More sharing options...
DaveE Posted April 15, 2014 Author Report Share Posted April 15, 2014 Joe You were dead on I was dumb and didn't redirect the protocol config block to Com 1 as well.... Put it down to alcohol abuse I had an ah ha moment and found it, I also said I need a second serial port card and I have that coming in.... I was using Termite as a terminal program, and found that works really well, I could connect up to the USB ports of my computer and see what was being read and what was echoed back to the controller I really appreciate everyone's help This place is so helpful 1 Link to comment Share on other sites More sharing options...
DaveE Posted April 17, 2014 Author Report Share Posted April 17, 2014 Its me again !! I have another problem that my head will not wrap around If you remember I am separating out an incoming ASCII string into 3 rows with a V350 This has just changed a little because sometimes the scanner will not be used and they want to have a manual input instead That part is easy, I just duplicated the MI0 and put it as a keyboard entry on another screen However this is my issue I now need to tell the PLC to send the data 1) Manually or 2) Automatically when they use the barcode scanner to scan Manually, I can set a bit that links to a button on the screen and that triggers the send What I cant work out is how to tell when the scan from the scanner has changed.. I dont see a bit that changes I have set a refresh bit link, but do not know how to use it properly (I fear) Thanks Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 21, 2014 MVP 2023 Report Share Posted April 21, 2014 If you're still using the same program, MB 2 comes on when the Scan block receives something. Use it to trigger your send and reset it afterwards. Joe T. Link to comment Share on other sites More sharing options...
DaveE Posted April 22, 2014 Author Report Share Posted April 22, 2014 Joe Your a genius I was missing the obvious Next issue is I seem to have some extra characters in the send string and I see them on the internal sniffer, termite and terminal 1abc[00]E[00]2defg[00][00]8[00]3hijk[00]Add 1abc is good [00]E[00] extraneous 2defg good [00][00]8[00] bad 3hijk good [00]Add bad any thoughts? www.dropbox.com/s/swj32fz7bd0egbh/smooth%20with%20variable2.vlp Link to comment Share on other sites More sharing options...
DaveE Posted April 25, 2014 Author Report Share Posted April 25, 2014 Hi not sure where this post should go however I would like to give a boat load of thanks to Joe Tauser for his assistance and his time in helping me out Also off the forum I have been bugging the **** out of Michael P at Unitronics support and every time I ask him something he comes through Thanks so very much to both of you, my project is done, dusted, finished OMG its time for the next one.. look out guys, more dumb questions coming your way Thanks Dave Link to comment Share on other sites More sharing options...
Cara Bereck Levy Posted April 27, 2014 Report Share Posted April 27, 2014 Hi! Just wanted to say that I really appreciate you posting your thanks--and yes, Joe is very cool that way I'm glad to hear that Michael Poles is giving you good support--it's what the Support gurus are supposed to do. Now that your program is done--enjoy that beer Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted April 29, 2014 MVP 2023 Report Share Posted April 29, 2014 Dave, Thank you for the kind words; I appreciate them. The fact that you post your code and ask very specific questions make it easier to help because we don't have to guess at what you're trying to accomplish and what your skill level is. I wish everyone would pay that much attention to detail when questions are asked. Joe T. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now