It is currently Sat Feb 16, 2019 10:32 am

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Sending characters to Olivetti PR2 RS232 dotmatrix printer
PostPosted: Thu Apr 19, 2018 12:53 pm 
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 533
Location: Europe

I have a printer that works in Olivetti PR2 emulation. It is connected to COM4 port on Windows.

Following commands work from Windows CLI.

set /p x="some text" <nul >\\.\COM4

type somefile.txt >\\.\COM4

Printing works via Print dialogue in PureBasic as well, however...

Is there a possibility to "emulate" commands above, since printer than works in native mode and not (very slow and nonflexible) graphics mode when I print it via Print library in PB? Can I use StartPrinting() function with some "native" mode for such dot-matrix printers?

BTW, i CANNOT access COM4 port from PB's commands...

Thank you in advance,


Edit: I tried something like this, but compiler crushes...

txt.s = "0123456789"
hndl.i = CreateFile_("\\.\COM4", #GENERIC_ALL, #FILE_SHARE_READ, #Null, #OPEN_EXISTING, #Null, #Null)
WriteFile_(hndl, @txt, Len(txt), #Null, #Null)

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   PureBasic_Compilation0.exe
  Application Version:
  Application Timestamp:   5ad88724
  Fault Module Name:   KERNELBASE.dll
  Fault Module Version:   6.1.7601.23915
  Fault Module Timestamp:   59b94f2a
  Exception Code:   c0000005
  Exception Offset:   0000000000001b54
  OS Version:   6.1.7601.
  Locale ID:   1050
  Additional Information 1:   6b14
  Additional Information 2:   6b148cf49d296fa0cbd4faef530b5e86
  Additional Information 3:   500e
  Additional Information 4:   500eec2a859faeef979f97032c85988a

Read our privacy statement online:

If the online privacy statement is not available, please read our privacy statement offline:

WriteFile_ part seems to be the one causing the error.


"If you lie to the compiler, it will get its revenge."
Henry Spencer

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye