Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

USB Barcode Scanner

2019-02-05
2019-02-19
  • Reinier Geers - 2019-02-05

    Hello,
    How can i get the data from a barcodescanner connected to USB

     
  • Berghof-Support - 2019-02-06

    Hello Reinier,

    here you have basically two options.
    You can take a barcode scanner that is recongnized as a USB Keyboard.
    Then you can use the normal Write Variable/Keyboard handling in
    the CODESYS Visualization.

    Alternatively you can use a Barcodescanner that has an integrated
    USB-to-Serial converter, then you can establish a serial
    connection to the device using either the CAA COM or SysCom library
    and read out the what the scanner is sending.

    Be aware that both methods need a PLC that does support these
    interfacing features. Not all PLCs that have a USB Port will be able
    to use it for a keyboard or USB-to-Serial connection.
    Check this with your PLC manufacturer.

     
  • Reinier Geers - 2019-02-06

    Thanks !
    I Know. But most are USB Not Seriel.
    So i want it like Seriel.. but then with USB

     
  • Berghof-Support - 2019-02-08

    Like i already told your there are Barcodescanners
    that have an integrated USB-to-Serial Converter

    "Alternatively you can use a Barcodescanner that has an integrated
    USB-to-Serial converter, then you can establish a serial
    connection to the device using either the CAA COM or SysCom library
    and read out the what the scanner is sending."

    The plug remains USB, but it will be handled like serial connection.
    Just Google it...

    And again, only having the Barcodescanner is not enough,
    you will also need a PLC that supports USB-to-Serial on its
    USB Port.

    Examples on how to use Serial in CODESYS are found
    on the CODESYS Store:
    https://store.codesys.com/serial-com.html
    https://store.codesys.com/serial-com-with-visu.html

     
  • Reinier Geers - 2019-02-19

    Great.. But why can't i read the data from USB
    Its just data like seriel.
    So if Windows can handle it, why can't i ?

     

Log in to post a comment.