Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Driving a HP plotter from REBOL through RS232
Pages: [1] Print
Author Topic: Driving a HP plotter from REBOL through RS232  (Read 428 times)
ADelmotte
Newbie
*
Offline Offline

Posts: 2


View Profile
Driving a HP plotter from REBOL through RS232
« on: June 04, 2006, 09:58:44 AM »

Hello!

I am both learning REBOL and want to use it as soon as possible for some cartographic applications.

I'd like to drive an HP7550Plus plotter which is linked to COM1.

I did find some information from the book of Olivier Auverlot, but I can not get it to work!

First I would just like to replicate the BASIC program below which works from a command prompt window under Windows 98 (quickbasic).

I would work either from Windows 98 or Windows XP; on both machines the com1 port is defined as
baud: 9600
bits: 8
parity: none
stop bit: 1
handshaking: hardware

Thanks for the help.

Alain Delmotte

here is the BASIC program

Code:
OPEN "COM1:9600,S,8,1,RS,CS65535,DS,CD" FOR RANDOM AS #1
PRINT #1, "IN;OI;"
Input #1, ID$
PRINT #1, "SP1;PA 500,500;"
PRINT #1, "LB"; ID$; " COMMUNICATION OK"; CHR$(3)
PRINT #1, "PA 0,0;SP0;"
END

Logged
PeterWood
Newbie
*
Offline Offline

Posts: 27


View Profile
Re: Driving a HP plotter from REBOL through RS232
« Reply #1 on: June 06, 2006, 05:36:33 AM »

Alain

These documents may help:

http://www.rebol.com/docs/changes.html#section-6.3
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlGVZS
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-topic-index.r?i=ports

Somethink like this should work:

ser: open/no-wait serial://    ;; open serial port with default values
                                           ;; defaults match the settings in your message


insert ser data-Alain             ;; push you data into the port buffer
update ser                           ;; flush the port buffer

close ser                              ;; close the port when finished (automatically flushes)

I couldn't test because I have no serial devices.

You could also look at the open/direct refinement which opens the port without a buffer.
(see the Rebol function dictionary - http://www.rebol.com/docs/words/wopen.html )

Hope this helps.

Peter




Something like this should work:

ser: open/direct/no-wait serial://
Logged
ADelmotte
Newbie
*
Offline Offline

Posts: 2


View Profile
Re: Driving a HP plotter from REBOL through RS232
« Reply #2 on: June 06, 2006, 09:24:45 AM »

Peter,

Thanks for the information; I'll have a look and, surely, some tries.

Regards,

Alain
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: Driving a HP plotter from REBOL through RS232
« Reply #3 on: June 23, 2006, 03:13:04 AM »

If you can develop a PCL dialect to send commands to the plotter, we could use it for general printing purposes Smiley
Logged

Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Driving a HP plotter from REBOL through RS232
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2008, 10:53:04 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2233 Posts in 581 Topics by 1886 Members
Latest Member: antigopit

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc