-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improves named IO pins #2794
Improves named IO pins #2794
Conversation
With this patch num_dio or num_aio is set to the minimum of count(inputs) and count(outputs). |
Are you thinking we can split up the input and output? Like 15 inputs and 5 outputs, and of those inputs 10 is named and 5 is default-named, with something similar with the outputs, but only 5 outputs? Input and output does not have same amount of pins. Or is the intention that if I want to create 10 named inputs and 5 named outputs, It would actually generate 10 named inputs, 5 named outputs + 5 default-named outputs? Input and output has same amount of pins. This last one would give a limitation of 32 named pins, not sure if this will become a problem. |
I was thinking of the latter, but may have missed a detail. Do the IOs of each type share an array with each being input or output (I would check, but it's late here, and probably later where you are). My (un-checked) impression was that they were separate but of equal size. I am really keen to get 2.9.2 out (for reasons due to the Debian bugfix timescale) Do you think that the current partial fix is good enough for the moment? |
You might be correct , I based my assumption on these lines linuxcnc/src/emc/motion/emcmotcfg.h Lines 38 to 40 in 1db5638
and since it combines input and output pins into the same variable I assumed the same register. But as you say, it would make more sense if they were separate.
Not sure if I want to have any opinion on that, for 2.9.1
In it's current state, this has been flipped
The |
As you spotted, I managed to commit an incomplete fix. I have now committed the fix that I intended (and tested). |
Are you thinking on which solution to go for?
Not sure if you have looked it up, but linking in the discussion in #1349 and the initial pr #1352 for the named IO pins. Now that @andypugh fixed the bug in 2.9 this could target master instead, and we might be a bit more flexible with the solution and scope. I don't think it is to hard to have equal amount of pins, where some is named and some isn't, splitting them up is a bit more work, though not by much. |
There is still some limitations to the named pin arrays. If both `names_dout` and `names_din` is set, they have to be the exact same size. The same is true for `names_ain` and `names_aout`.
We will now have equal IO pins, named and default-named pins. With the command: motmod names_ain=one,two names_aout=one,two,three It will be created three analog input pins: - motion.ain-one - motion.ain-two - motion-analog-in-00 and three analog output pins: - motion.aout-one - motion.aout-two - motion-aout-three
aefe2f5
to
6363676
Compare
Rebased against master and added the necesarry documentation, the documentation for the error pins which is located in 2.9 is not included in this commit. Don't like the global variables, but not sure how to solve it without moving everything into the same function. |
6363676
to
9ec2b93
Compare
Related to this (but not an immediate change) is #2532 |
There is still some limitations to the named arrays. If both
names_dout
andnames_din
is set, they have to be the exact same size. The same is true fornames_ain
andnames_aout
. Currently, we do not verify this.Marking this as draft to see if the solution is accepted, I also thought to update the man-page for the named pins
names_dout
,names_din
andnames_ain
,names_aout
.There is also the issue with not sending in the max length to `count_names(), not sure if you want that in 2.9 as well @andypugh?