LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication Motorola Barcode scanner (PL3307)

Hello!

 

I am trying to communicate with a barcode scanner through a virtual serial COM port (CDC). If I enable the "continuous reading" I can easily read a barcode with a continuous VISA reading loop. However I do not want the scanner to be on continuous reading. I want to use the pull trigger command. I am trying to send this command to the scanner but nothing happens. When I use an example from the developers guide (https://atgsupportcentral.motorolasolutions.com/content/emb/docs/manuals/4045103a.pdf)  to request a parameter, also no response.

 

I attached a print screen of the really simple VI created to request a parameter. 7 bytes are written, but no bytes are received(no response)

 

Anyone who can help?

 

Michtro

 

 

 

0 Kudos
Message 1 of 10
(6,202 Views)

Would be much simpler if you can buy a keyboard wedge for this barcode scanner.

0 Kudos
Message 2 of 10
(6,174 Views)

You mention that you are using a virtual COM port. Are you using a Serial to USB converter by chance?

0 Kudos
Message 3 of 10
(6,156 Views)

First: there is no need for a sequence structure. The wires will ensure that your code executes in the desired order.

 

Do you always get 0 bytes at port? Rather than reading the number of bytes available at the port, try reading a fixed number of bytes (too many is fine) and wait for the timeout. You'll get any bytes that are available, plus a warning or error (that you can ignore) if it couldn't read as many as you requested. An attempt to read 0 bytes will return immediately, and probably there aren't any bytes available to by read immediately after you send the request, since it takes a small amount of time to process the request and send back the result.

 

Also try sending the same commands in a serial terminal program such as HyperTerminal or PuTTY. Don't forget the end-of-line character, if required.

0 Kudos
Message 4 of 10
(6,146 Views)

You've got no delay between your write and your read.  Since you use bytes at port to read, if the scanner hasn't responded yet, you'll never see anything.  Add a 1s delay to start with and then bring it down to figure out how small you can make it and still reliably get a response.

 

Also, if you know it ends in a standard termination character, you can set that in your VISA setup and just read without caring about delays or bytes at port.

0 Kudos
Message 5 of 10
(6,132 Views)

I am using a USB port. I have a CDC driver installed which creates a virtual COM port. 

0 Kudos
Message 6 of 10
(6,110 Views)

I already added a 1 second delay before but that did not do anything... I also put a fixed amount bytes to read (10) and it did not do anything except show the error that the timeout had been expired (set on 10s)

0 Kudos
Message 7 of 10
(6,106 Views)

I also tried through RealTerm and also this tool gave no response...

0 Kudos
Message 8 of 10
(6,096 Views)
WIRE YOUR ERROR WIRES!!!!! Also, get rid of the bigsequence structure since it is not needed and put one in between the write and read and put a 1000 millisecond wait in there like Matt suggested if your not going to use the termination charaecter(sp). Make sure you wire you wires through it.
0 Kudos
Message 9 of 10
(6,077 Views)

@Michtro wrote:

I also tried through RealTerm and also this tool gave no response...


Yes, you need to start my configuring the device correctly so that it does a read on trigger and sends the barcode as a string - we've used some motorola scanners before and it's possible to set a termination character which you can put in your VISA configuration to terminate the read. The configuration process for us was scanning a series of barcodes from the manual to set the options.

 

If you can't get anything from a simple serial terminal, it's probably a device configuration issue.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 10 of 10
(6,071 Views)