Python API Analog input

More
9 years 1 month ago #99416 by koth442
Replied by koth442 on topic Python API Analog input
That's good to know. Is it possible to use a userspace and read data at microsecond intervals?

We are going to get sensor data then process the data outside of LinuxCNC then feed LinuxCNC commands based on sensor data. I'm not the architect of this project, so I don't know why we're doing it that way. The halcmd method you provided above will work, so now I'm satisfying my own curiosity.

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

More
9 years 4 weeks ago #99824 by andypugh
Replied by andypugh on topic Python API Analog input

koth442 wrote: That's good to know. Is it possible to use a userspace and read data at microsecond intervals?


No.

Even in the realtime layer the analogue inputs of the Mesa cards only update every 1mS.

The way to do what you want, if you must use Python, is to create a HAL pin in a Python HAL component that is connected to the Mesa analogue output, then process that data.
linuxcnc.org/docs/2.7/html/hal/halmodule.html

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

More
9 years 4 weeks ago #99825 by PCW
Replied by PCW on topic Python API Analog input
Note that anything done in standard Python is not going to be even close to real time
( you may have unpredictable multi-millisecond delays due to memory allocation and garbage collection )

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

More
9 years 4 weeks ago #99882 by koth442
Replied by koth442 on topic Python API Analog input
Thanks for the help everyone.

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

Time to create page: 0.105 seconds
Powered by Kunena Forum