Monitor serial data (1 Viewer)

bidule

New member
Local time
Today, 04:24
Joined
Oct 14, 2012
Messages
1
Hi all,

I'm trying to create an application that could monitor and trap incoming serial data within Access, and I'm wondering what is the most efficient way to do this.

Imagine a storage management application in which incoming barcode scan data or RFID data can open a form displaying corresponding records.
It is not the typical data-logging application: the application's main purpose is not only to listen and log the data, and the incoming data will be a relatively rare event, so the application must listen to the serial port in the background and keep being responsive for other uses.

I managed to get serial data using the commIO code posted by David Hitchner, which calls the Windows API. However, for now, I'm using a loop to read serial data and sleep for 500 ms. This obviously makes the application not very responsive. I was wondering if there's a better way to do that.

I've tried for a brief while using the mscomm32 ocx in Access, but failed (possibly wrong version of the DLL?). It doesn't seem to be the recommended method anyway.

I was thinking of writing a serial monitor windows service (probably in C#) that would raise a windows event whenever incoming data is detected, but I don't know how to consume the event in Access: is this possible at all?

If I can't consume a windows event within Access, another option would be to have the service poke the Access application in a way or another -- but the windows service beeing a different client than the GUI, it can't share variables with the Access application. It could insert a row in a table, but there is no trigger method in Access AFAIK...

I hope I'm making sense. Any help or suggestion would be very welcome.

Thanks!
 

rdub

New member
Local time
Yesterday, 22:24
Joined
Nov 17, 2012
Messages
2
I have just started the same project!! And when I say just started I mean I started the app yesterday afternoon, so what I ahve is VERY rough. I am also reading from Barcode scanners and have structured the app to Open the com port when the form opens. I use the forms timer to do a CommRead a couple times a second and handle the branching logic for each scan, and close the com port when the form unloads.

Havent done much testing, but it has worked at least a few times. I plan to get back to it monday to flesh it out better and add some error handeling.
 

Users who are viewing this thread

Top Bottom