John,
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
Third, why?
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
your code?
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
19200).
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.
Regards,
Luis
John J. wrote:
Hello All,
It’s good to get back to the RT Mailing List!
I'm looking for examples of using the mscomm control with this code:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/35355
I’m working on a project that drives a serial label printer on a
Windows host.
I’ve been trying ruby-serialport-0.6 by Guillaume Pierronnet and Alan
Stern.
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
is mscomm.ocx.
The code looks good, does anyone know where I can find examples of it’s
use?
ADVthanksANCE!
Regards,
JJ
Help everyone. If you can’t do that, then at least be nice.