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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
Hi,
here in the old forum are many examples,
as I remember you'll find the Bardcode stuff too:
https://forge.codesys.com/forge/talk/Runtime/thread/04361f89ec/?limit=25#333d
I think this is it:
https://forge.codesys.com/forge/talk/Runtime/thread/04361f89ec/?limit=25&page=1#f227
this is for 1)
2) even this there is an example how to excecute a python script an get the returnvalues.
https://forge.codesys.com/forge/talk/Runtime/thread/04361f89ec/?limit=25&page=1#d08c
If you have an solution would be great if you share your snippet/code/project
BR
Edwin
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!
Did you find a solution?
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.
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..