Who has experience with using System.IO.Ports.SerialPort for bar-code reading
We would like to connect a serial port barcode reader to the Progress session.
The barcode events need to be published so other procedures can describe on it and handle the bar-code.
First problem we uncounted is that System.IO.Ports.SerialPort is a multi-threadded .Net oblect.
In this documentation we found a way to work with this.
Now we know what a delegate is and that we need one to use the ContinueWithmethod. But using delegates is not possible in ABL.
So we need some kind of adapter that allows us to create a .NET delegate which points to ABL code.
As we have seen in the example it is very easy to create a delegate in C#. But how can we invoke ABL code from .NET?
There are three different possibilities:
Recommended option 3. Subscribing to a .NET event in ABL.
Who has some experience to share to implement bar-code reader into a session as event triggered action.
In the past I've seen barcode scanners where the input was mapped to the keyboard so when the scanner read a tag, the output would be the same as doing it from a keyboard. The ABL program then had a trigger for the first character of the input which would then capture the barcode information.
Depending on the manufacturer of the barcode reader there may be drivers for windows (OPOS or POS for .NET). If they do and you are running under windows you can use these drivers to control the scanner as well as receive events from the scanner.
What type of barcode reader is it?
I propose option 3.
Create a wrapper in C# with a delegate to get the event in the GUI thread.
OPOS is nice, I read there is an newer version avail since years but many functions may still missing.
If you have multiple scanners from different manufacturers OPOS could be easier but if you have one manufacturer an intelligent serial scanner class in C# would be perfect and easy.
It will be interesting with multiple scanners!
I wrote a small C# scanner library in the past that
- recognize scanners during the application is running (you can connect a new one with USB on the fly) - with a timer which scans virtual com ports every second
- register .net event to the com port collection and forward it as one to the "output"
- disable every connected scanner when a barcode was scanned
- get an enable command from the app when the barcode was processed and play a beep (on scanner)
Only with this manual implementation I got a safe way not to loose any barcode in a heavy used system
With OPOS for .NET it was not safe (Honeywell / Metrologic)
And you are the godfather of your implementation :-)
Here is the current business case, I hope you had a good journey back from Copenhagen :-)
My proposal for ABL is:
Change this message and delegate the event to the ABL thread to avoid C# wrappers (perhaps only if no transactions are running)
I have been using OPOS extensively in my POS applications for nearly 15 years with no issues. The POS for .NET was just updated to 1.14 and we are using it in our new tablet POS with no issues.
For as far as I know POS and OPOS for .Net is only working on 32bit client applications.
We have chosen to move forward to Progress 11.4 and higher based on the 64bit client.
We have already an 32bit dll for com port barcode scanners.
Was build in 2003. There are no source code available for this DLL to make adjustments or rebuild it for 64bit client.
Yes, you are correct. OPOS and POS for .NET is 32-bit.