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

Using a USB barcode scanner with CoDeSys

  • f-und-e

    f-und-e - 2021-02-09

    Hello there,

    I got a small problem which is troubling me. On my desk there is a USB barcode scanner, which shall be used with CoDeSys running on a Raspberry Pi (Kunbus Revpi device).
    Sadly, it seems to be quite hard to implement it with CoDeSys.
    The scanner acts like a keyboard (HID-Device), so I thought about reading the input to a string variable to process it later.

    I thought about to ways of integrating it:

    1) Get the string via the visualization and a text box. Sadly, I do not know how to tell CoDeSys to have the text box "in focus" all the time - I only found the way of focusing the text box with a mouse down action.

    2) Use a (python) script on the Raspi which does the reading duties and then sends the data to CoDeSys. Sadly I do not know how to send the data from the script to CoDeSys.

    If anyone could please help me, I would be very happy. Either with solving 1) or 2), it doesn't really matter - but I like the thought of getting it done with CoDeSys!

    Thank you very much in advance!

    All the best

  • f-und-e

    f-und-e - 2021-02-09

    Nice, thank you very much! I did not find the post with all those projects. I'll dive into the resources you linked and report back.

    If I manage to solve it properly I will post the solution as well.


    • mandeepahujaifm

      mandeepahujaifm - 2021-04-28

      Did you find a solution?

      • f-und-e

        f-und-e - 2021-05-03

        The solution with the RFID-Scanner works. I do not remember if I changed much, but just check out eschwellingers comment. I did not dive deeper into it, because the barcode scanner now gets read by a different system.


Log in to post a comment.