Lynxmotion Tech Support

www.lynxmotion.com
Join the Accelerator Program
It is currently Thu Apr 24, 2014 4:24 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Dec 15, 2008 3:15 pm 
Offline
Roboteer

Joined: Sat Dec 06, 2008 3:39 pm
Posts: 4
Hello all. I used to use qbasic to control the parallel port with OUT(888),255 type commands. I've recently picked up an new laptop with XP on it and now I'm using justbasic and liberty basic. I can no longer control the parallel port. Can anyone give me a working bit of code that will control pins 2-9 on and off ? Do I need special drivers ? Thanks, C Mitch


Top
 Profile  
 
PostPosted: Mon Dec 15, 2008 5:23 pm 
Offline
Robot Guru

Joined: Tue Feb 28, 2006 12:27 pm
Posts: 2172
aluminumfetish wrote:
Hello all. I used to use qbasic to control the parallel port with OUT(888),255 type commands. I've recently picked up an new laptop with XP on it and now I'm using justbasic and liberty basic. I can no longer control the parallel port. Can anyone give me a working bit of code that will control pins 2-9 on and off ? Do I need special drivers ? Thanks, C Mitch

you have the basic idea, you need a driver.
this may help, http://www.lvr.com/parport.htm, about 2/3 of the way down the page is a section "Programming Tools for Port I/O and Interrupts" and the first entry is about a .dll called Inpout32.dll which I used an older version of some years ago. Don't remember much more than that but it may be a start you can work from.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 15, 2008 10:47 pm 
Offline
Robot Guru

Joined: Thu Jul 13, 2006 11:10 pm
Posts: 2260
If you want to get user level access to the hardware on an XP machine, you can run Userport (at bottom link) on the machine one time and it sets the permissions to allow access just like a win 98 machine (qbasic should then work). Liberty basic should have a folder called ntport with the required dll and sys files to allow parallel port access. Link below has some parallel port post. Just basic does not have native ability for parallel port access, but the middle link below uses a userport work around along with debug to some simple parallel port pin toggling.

http://libertybasic.conforums.com/index ... rd=comport
http://justbasic.conforums.com/index.cg ... 1145483474
http://www.embeddedtronics.com/design&ideas.html


Top
 Profile  
 
PostPosted: Sat Jan 03, 2009 11:44 am 
Offline
Roboteer

Joined: Sat Jan 03, 2009 11:38 am
Posts: 1
aluminumfetish wrote:
Hello all. I used to use qbasic to control the parallel port with OUT(888),255 type commands. I've recently picked up an new laptop with XP on it and now I'm using justbasic and liberty basic. I can no longer control the parallel port. Can anyone give me a working bit of code that will control pins 2-9 on and off ? Do I need special drivers ? Thanks, C Mitch

Liberty BASIC comes with the NTPORT driver that you need to make OUT and INP work, but you must make sure to install the software using an administrator account, and you may need to launch Liberty BASIC that way too.

Are you using XP Home, or XP Pro?

-Carl Gundel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 12:31 pm 
Offline
Roboteer

Joined: Sat Dec 06, 2008 3:39 pm
Posts: 4
XP pro. I got great control of my serial port but have yet to get control of the pport. I only run in administrator mode. I have the nt port driver in the right spot I think.


CLS
FOR counter = 1 TO 400
OUT 888,2
OUT 888,0
FOR zz = 1 TO 100: NEXT
NEXT counter

This is a sample of what I was trying. I'm starting to think maybe it might be my parallel cable. I kind of dropped this project and started working with serial control with the SSCII. I will post again after I get a new cable to test.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 2:36 pm 
Offline
Robot Guru

Joined: Thu Jul 13, 2006 11:10 pm
Posts: 2260
I think it was mentioned in another forum that a USB to parallel port "printer cable" will not work if that is what you are trying to use. Also, the code you posted will run extremely fast such that you may not be able to detect the pin changes. Below is example code from the help file. This loops 40,000 times and only takes 344 milliseconds (similar to your code). in your code the there is no delay between setting the pin high and setting it low. You may need to add a delay between the hi/lo pin changes if you are trying to interface with anything mechanical (bottom code).

Code:
'get start time

startTime = time$("ms")

'do some computations

for i = 1 to 40000

    x = x + i

next

'get end time

endTime=time$("ms")

print "Computations took ";

print endTime-startTime; " milliseconds"

end



Code:
'get start time

startTime = time$("ms")

FOR counter = 1 TO 400
x=x+1 'OUT 888,2

  timer 10, [timertest]
  wait
[timertest]
  timer 0

y=y+1 'OUT 888,0
FOR zz = 1 TO 100: NEXT
NEXT counter

'get end time

endTime=time$("ms")

print "Computations took ";

print endTime-startTime; " milliseconds"

end


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© 2014 RobotShop Distribution inc. All rights reserved.
Powered by phpBB® Forum Software © phpBB Group