use motherboard parallel for additional inputs?

More
03 Nov 2014 10:32 #52709 by garylogan
hello, I have a working machine (lathe) that uses a PCI card parallel port for driving X & Z axis, my driver board has 4 inputs. I am using all of them--2 home switches and 2 for spindle encoding.
My computer motherboard has a parallel port that I would like to use for more inputs (tooleye sensor, ?)
I am having trouble figuring out how to access it.
My .hal file has this in it right now:
loadrt hal_parport cfg="0xa400 out 0x378 in"

When I try lspci -v in terminal, I get I/O a000 and a400.
I figure they are referring to the PCI card only? (hence the 0xa400 in my .hal file)
I am not sure why it says "out" and "in". My PCI card handles inputs and outputs.
Not sure how to identify the mobo address for parport. And if it is say... 0x378, how will the machine know
parport.0 from parport.1 when I do this in .hal:
addf parport.0.read base-thread
addf parport.0.write base-thread
addf parport.1.read base-thread
addf parport.1.write base-thread

Any ideas would be appreciated because I am stumped right now.
thanks!

Please Log in or Create an account to join the conversation.

More
03 Nov 2014 16:52 #52711 by ArcEye
Hi

lspci will not show the built in port, because it is not on the PCI bus

Use cat /proc/ioports

First off, it would be easier for you and anyone looking at your config, if you use the conventional setup, of the built in port for steppers etc and use the PCI card as additional inputs etc

Just change the hal file line to
loadrt hal_parport cfg="0x378 out 0xa400 in"
and plug your DB25 plug into the onboard connector, that is it done

I am not sure why it says "out" and "in". My PCI card handles inputs and outputs.


Setting a port to input, sets pins 2-9 as input, that is way different to a port set as output and gives many more inputs.

Not sure how to identify the mobo address for parport. And if it is say... 0x378, how will the machine know
parport.0 from parport.1 when I do this in .hal:
addf parport.0.read base-thread
addf parport.0.write base-thread
addf parport.1.read base-thread


parport0 is the first port declared in the loadrt line, parport1 the second etc.....
All quite simple really.

So just check the address is 0x378, change the loadrt line and swap the parport plug and you should be off and running ( or at least able to)

regards
The following user(s) said Thank You: garylogan

Please Log in or Create an account to join the conversation.

More
04 Nov 2014 06:06 #52741 by garylogan
thanks, that info is helpful.
Now I can start reading about the next move...

Please Log in or Create an account to join the conversation.

More
10 Nov 2014 06:44 - 10 Nov 2014 07:26 #52981 by garylogan
hi, I got my probe working on the 2nd parport. I can see it on HAL meter signals (true/false) and responds when I hit the button.
I could not get it to work with g38 though in a program.

My .hal contains 2 lines with respect to the probe:

loadrt probe_parport

net probe-in <= parport.1.pin-02-in

I wrote a short program, and it attempts G38.2 but never triggers when I hit the probe? (or it gives error with G38.3 of not hitting anything)

I read about "motion.probe-input" but when I put that in the .hal file it won't start the machine (error msg)
maybe I am using incorrect syntax?
Any suggestions or direction would be appreciated! thanks.



EDIT: It works now, I had to do this...
net probe parport.1.pin-02-not =>motion.probe-input
Last edit: 10 Nov 2014 07:26 by garylogan. Reason: problem solved

Please Log in or Create an account to join the conversation.

More
10 Nov 2014 15:22 #52983 by ArcEye
Started replying and see you have got it working

My .hal contains 2 lines with respect to the probe:
loadrt probe_parport
net probe-in <= parport.1.pin-02-in


For info, the first line is nothing to do with the probing you mean.
A probe is just a switch, it is the way the system deals with it that makes
probing different.

Couple of links for you, if you have not already seen them.

wiki.linuxcnc.org/cgi-bin/wiki.pl?Touch_Probe

www.timeguy.com/cradek/01262579508

regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.615 seconds
Powered by Kunena Forum