From: John Johnson Date: 2006-04-19T22:31:02+09:00 Subject: Re: Win32 Serial Communications, maybe using mscomm.ocx Luis, Thanks for the suggestions! The printer can user DTR or XOn/XOff. The ruby-serialport package doesn't support DTR on Windows, and the XOn/XOff doesn't seem to work. The symptom is, when I send labels without a sleep(3.5) between each, it prints the first few, the buffer fills, several labels are dropped, and it continues printing, the cycle repeats. I'll look into FreeBasic. I had downloaded it, but never got around to looking into it. If I could write a DLL or spooler program with it, that would be great. Thanks again! Regards, JJ On 18-Apr-2006, at 19:40, Luis Lavena wrote: > 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 :-P > > 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 Johnson 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. > > > -- > Posted via http://www.ruby-forum.com/. > > --- Help everyone. If you can't do that, then at least be nice.