Author Topic: Bar Code Scanner  (Read 10919 times)

philipjoseph

  • Jr. Member
  • Posts: 57
    • View Profile
Bar Code Scanner
« on: September 04, 2002, 10:30:46 AM »
???
Hi, I'd like to install a bar code scanner to a t100md1616 and save that code to a data memory DM's.

Where do I  need to install it?
How should I program that input?
What are the better models and manufactures that work properly with this plc?

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Philip.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Bar Code Scanner
« Reply #1 on: September 04, 2002, 01:32:22 PM »
You need to purchase a bar code scanner that has an RS232 or RS485 type of serial output and link to the PLC's COMM1 or COMM3. ?Any model that can communicate at 9600 to 38400 bps will be ideal.

Barcode scanner typically outputs CR-terminated ASCII string. So you can read the data quite easily using the INPUT$(1) or INPUT$(3) command. The input$(n) command always returns an empty string unless it has received a complete ASCII string with CR termination. So you can set up a periodic test of the COMM port such as:

    A$ = INPUT$(1)
    IF  LEN(A$)=0 RETURN: ENDIF  ' nothing received.
   .......       ' else do something with the received data.
   ......

If you use the PLC's COMM1 to connect to the barcode scanner, you may like to consider purchasing an Auto485 adapter ($49) so that you still can perform programming and on-line monitoring via COMM3 without having to constantly swapping the serial cable during the test phase.
« Last Edit: December 31, 1969, 04:00:09 PM by -1 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS