- Posts: 8
- Thank you received: 0
Python API Analog input
9 years 1 month ago #99405
by koth442
Python API Analog input was created by koth442
Hello all. I am having trouble getting the '.ain' command to work using the LinxCNC / python API. HalScope show's an incoming signal, but .ain just returns a list of 64 zero's. I don't have 64 input pins, so I find that fishy as well. Suggestions? I'm using a MESA 7i87 analog input card.
My code:
python
import linuxcnc, hal, time, sys, os, serial
a= linuxcnc.stat()
a.poll()
a.ain
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, etc).
My code:
python
import linuxcnc, hal, time, sys, os, serial
a= linuxcnc.stat()
a.poll()
a.ain
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, etc).
Please Log in or Create an account to join the conversation.
9 years 1 month ago #99408
by PCW
Replied by PCW on topic Python API Analog input
When software and hardware is installed correctly, the hm2 driver provides a
hal pin/parameter interface to the 7i87, The python API is not related to the 7I87 in
any way.
What hardware do you have?
hal pin/parameter interface to the 7i87, The python API is not related to the 7I87 in
any way.
What hardware do you have?
Please Log in or Create an account to join the conversation.
9 years 1 month ago - 9 years 1 month ago #99409
by koth442
Replied by koth442 on topic Python API Analog input
Not sure, I didn't set up the machine. I know there is also 2 7i64's, a 7i77, and a 7i83 cards. Other than that, not sure. How can I figure out the hardware?
Last edit: 9 years 1 month ago by koth442.
Please Log in or Create an account to join the conversation.
9 years 1 month ago #99413
by PCW
Replied by PCW on topic Python API Analog input
If all is connected correctly, and LinuxCNC is running, you can list the 7I87 pins
with:
if you wanted to show all the connected Mesa hardware pins, you could:
or the equivalent for parameters:
with:
Code:
halcmd show pin | grep 7i87
if you wanted to show all the connected Mesa hardware pins, you could:
Code:
halcmd show pin | grep hm2
or the equivalent for parameters:
Code:
halcmd show param | grep hm2
Please Log in or Create an account to join the conversation.
9 years 1 month ago #99414
by koth442
Replied by koth442 on topic Python API Analog input
Yes, that worked. I can see my inputs on the 7i87. Thank you.
Is there a way to interface the 7i87 with python API?
Is there a way to interface the 7i87 with python API?
Please Log in or Create an account to join the conversation.
9 years 1 month ago #99415
by PCW
Replied by PCW on topic Python API Analog input
The LinuxCNC Python API works at the NML interface level not HAL and you will lose the real time capabilities of the hardware if you use Python
What are you trying to do with the analog data from the 7I87?
What are you trying to do with the analog data from the 7I87?
Please Log in or Create an account to join the conversation.
Time to create page: 0.110 seconds