Using a USB barcode scanner with CoDeSys

f-und-e
2021-02-09
2023-12-14
  • 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 - 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.

    Greetings!

     
    • mandeepahujaifm - 2021-04-28

      Did you find a solution?

       
      • f-und-e - 2021-05-03

        Hello,
        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.

         
  • lostcontrol - 2023-12-14

    Hi,
    Has anyone actually got this working?
    Is there any easy way to find the old forum files, as these links only open current projects..

     

Log in to post a comment.