Adding additional i/o beyond default

More
6 months 1 week ago #345861 by Metalurgent
Longtime reader, first time poster.
Running a cnc lathe retrofit with 2.8.
I was using the y-axis as a drive axis for a tool turret. The y-servo motor moved the turret to the tool position and some simple digital outputs locked it down using an air cylinder. Unfortunately, the system was very "loose" and backlash problems and other repeatability issues meant that it wasn't very reliable. It was a good learning experience and I could get away with using just the 4 default input/outputs that came from a simple configuration.
I've redesigned the turret/indexing system for more effective indexing and this means that I need to unlock more inputs and outputs.
 I'm not any kind of linux programmer. I've used the forum to cobble together snippets of code to make things work and that's been enough for three mill retrofits so far and this lathe project.
I cant figure out how to expand the i/o so that the M62 -M68 codes can call the extended inputs and outputs that are available on the mesa 5i25- 7i77.
I can add and assign names to the i/0 in pncconfig. They show up in the hal file and I can see them in halshow. 
There is a section in hal that shows the only i/0 that  I can access.

#  ---digital in / out signals---

net dout-00     <=  motion.digital-out-00
net dout-01     <=  motion.digital-out-01
net dout-02     <=  motion.digital-out-02
net dout-03     <=  motion.digital-out-03
net din-00     =>  motion.digital-in-00
net din-01     =>  motion.digital-in-01
net din-02     =>  motion.digital-in-02
net din-03     =>  motion.digital-in-03


I know its probably something very basic but I'd like to expand this to include all the i/0 that I select in pncconfig.
I've been through the archives and I'm still drawing a blank. I'm getting errors regarding missing pin numbers and  i/0 max errors.
Any help would be much appreciated.

Attachment not found

Attachment not found

Please Log in to join the conversation.

More
6 months 1 week ago #345863 by PCW
In your hal file, change:

loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS

to:

loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_dio=N


where N= the number of DIO needed (1 to 64)


man motion




 

Please Log in to join the conversation.

More
6 months 1 week ago #345892 by Metalurgent
Thank you, Peter.
I did as you suggested and I was able to see the dio listed in halshow.
I spent all day trying to understand how to access and setup the inputs and outputs using the M64+ commands.
I think I figured it out after hours of frustration.
My issue was understanding the syntax of how the actual screw terminals of the 7I77 connected to the input of an MDI command of say M64 P4.
I needed to get my head around the random name that I had assigned to an output [ say Digital out 4], the terminal on the 7i77 ( that could be terminal 8..) and the call sign [say M64 P3] that i put into MDI . Understanding how to link them all together in hal to get a predictable result was a head-wreck.

Watching that single halshow dot finally turn from brown to yellow made my day.
Easy once you know.....as usual.

Thanks.

Please Log in to join the conversation.

Time to create page: 0.160 seconds
Powered by Kunena Forum