Jump to content

V120 with handheld barcode scanner


Recommended Posts

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

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

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.

  • Upvote 1
Link to comment
Share on other sites

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

  • Upvote 1
Link to comment
Share on other sites

  • MVP 2023

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

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

  • Upvote 1
Link to comment
Share on other sites

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

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

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

  • MVP 2023

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. 

  • Upvote 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.