Halui Component

More
7 years 3 months ago #138426 by stegrg
Replied by stegrg on topic Halui Component
phillc54,

I finally got around to trying your code by pasting it into a .axisrc file. When I run Hal Configuration within LinuxCNC, I don't see the step-activated pin anywhere in the tree. Should I be able to see it somewhere?

Please Log in to join the conversation.

More
7 years 3 months ago #138441 by Grotius
Replied by Grotius on topic Halui Component
Hi,

It was Python code :
Code:
comp.newpin('step-activated', hal.HAL_BIT, hal.HAL_IO) comp.ready()

You would see this new pin by the name : step-activated

Please Log in to join the conversation.

More
7 years 3 months ago #138454 by phillc54
Replied by phillc54 on topic Halui Component
Yes, it should appear as axisui.step-activated

Please Log in to join the conversation.

More
7 years 3 months ago #138542 by stegrg
Replied by stegrg on topic Halui Component
Sorry to further bother you guys with this but I'm still having issues getting the code to work. I created an .axisrc file with the sample code copied into it. I saved the file in my home/username folder location. Here is a screenshot:

Attachment not found



After running Hal Configuration in LinuxCNC, I can't see the step-activated pin in Axisui. Am I missing a step?

Attachment not found

Please Log in to join the conversation.

More
7 years 3 months ago #138544 by andypugh
Replied by andypugh on topic Halui Component
Do you see any error messages if you start LinuxCNC from the command line (command "linuxcnc" )

Please Log in to join the conversation.

More
7 years 3 months ago #138548 by stegrg
Replied by stegrg on topic Halui Component
No, it starts up without any issues.

Attachment not found

Please Log in to join the conversation.

More
7 years 3 months ago #138552 by andypugh
Replied by andypugh on topic Halui Component
How about if you put a deliberate error in the .axisrc file?
(Just to be sure that it is actually running)

Please Log in to join the conversation.

More
7 years 3 months ago #138577 by phillc54
Replied by phillc54 on topic Halui Component
I'm guessing you are using LinuxCNC 2.7, if so then the user_hal_pins() function is not available.
[strike]If that is the case then I think you can use the function user_live_update() but will need to create a new component like:[/strike]
Create a new component with this in .axisrc in lieu of the user_hal_pins() function:
Code:
h = hal.component("stepstatus") h.newpin('step_activated', hal.HAL_BIT, hal.HAL_OUT) h.ready()
This should give you a pin named stepstatus.step-activated

Edit: Only took two edits to get it right, I don't use 2.7 enough...

Please Log in to join the conversation.

More
7 years 3 months ago #138579 by tommylight
Replied by tommylight on topic Halui Component
He is using 2.7.14. I do recalled you or someone mentioning that the .axisrc workaround works on 2.8 or 2.9.

Please Log in to join the conversation.

More
7 years 3 months ago #138622 by stegrg
Replied by stegrg on topic Halui Component
Everybody,

Thank you very much for the assistance! I finally have it working. I had to make some small modifications to the .axisrc file after stitching it together with the latest suggestions. I have attached it below for future reference if any else may run into the same issue.

Attachment not found



I'm going to try and hijack the LinuxCNC Run button so that I can use it to reset the step_activated bit once activated.

Please Log in to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum