I’ll suggest you avoid using mscomm.ocx for many reasons:
First, the overhead of interfacing with OLE/ActiveX/IDispatcher objects
form plain ruby code.
Second, the microsoft control developer license, forbids its use outside
any of the VB packages where it was shipped, so you will be “breaking
the law” using it
Are your serial label using CS and DS control lines for handshake? you
need to control them from your code to set/get your printer status from
for reference, past weeks I needed replace some buggy code from a VB
project that use MSCOMM control and we found its baddly based on ActiveX
event-driven model, which isn’t suited for high speed (any speed above
We replaced it with a custom dll made with FreeBASIC
http://www.freebasic.net and reduced latencies to the minimum, just 30k
of compiled dll… and solved the problem.
You even could interface it with Ruby using DL.
That just my suggestion of course.
If you need more inside information I’ll glad to provide some guidance.
John J. wrote:
It’s good to get back to the RT Mailing List!
I'm looking for examples of using the mscomm control with this code:
I’m working on a project that drives a serial label printer on a
I’ve been trying ruby-serialport-0.6 by Guillaume Pierronnet and Alan
It works as long as no handshaking is needed, i.e. as long as I send
data slower than the printer can print, it works. The problem is, I
need to speed things up. At 4 seconds a label, a couple of thousand
labels a day really adds up (~ 2 hrs).
I found the aforementioned message about using the mscomm control from
VB, I’m not to well versed on recent Win programming, but I assume this
The code looks good, does anyone know where I can find examples of it’s
Help everyone. If you can’t do that, then at least be nice.