Adding additional i/o beyond default

More
22 Apr 2026 22:02 #345861 by Metalurgent
Adding additional i/o beyond default was created 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.

File Attachment:

File Name: redo_night.hal
File Size:15 KB

File Attachment:

File Name: redo_night.ini
File Size:4 KB
Attachments:

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

More
23 Apr 2026 00:32 - 23 Apr 2026 00:33 #345863 by PCW
Replied by PCW on topic Adding additional i/o beyond default
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




 
Last edit: 23 Apr 2026 00:33 by PCW.

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

Time to create page: 0.101 seconds
Powered by Kunena Forum