- Posts: 17
- Thank you received: 1
Setting the modes in halui
- bondglen
- Offline
- New Member
-
Less
More
3 years 6 months ago #269184
by bondglen
Setting the modes in halui was created by bondglen
I'm trying to build my own pendant, and it's coming together good. But I'm having a problem getting back to manual mode so that I can jog after a mdi operation. I check at the hal configuration from linuxCNC and it shows that it is still in mdi mode. I use setp command to change the mode to manual, but it doesn't change. Is there some documentation that describes the different modes and the requirements for changing them? I have been experimenting on this for quite a while and have learned a lot, but this one problem still eludes me. I can't find anything that tells about the modes of operation in any of the LINUXCNC documentation.
The modes that I am trying to change include 'auto', 'manual', 'mdi' and 'teleop'.
If anyone can direct me to some documentation I would greatly appreciate it.
Thanks,
Glen
The modes that I am trying to change include 'auto', 'manual', 'mdi' and 'teleop'.
If anyone can direct me to some documentation I would greatly appreciate it.
Thanks,
Glen
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
-
Less
More
- Posts: 337
- Thank you received: 118
3 years 6 months ago - 3 years 6 months ago #269191
by JPL
Replied by JPL on topic Setting the modes in halui
You should probably go with halui. More specifically halui.mode.xxx pins. Such as halui.mode.manual or halui.mode.auto to set modes and halui.mode.is-auto or is-manual to read current mode.
See here: linuxcnc.org/docs/html/man/man1/halui.1.html
See here: linuxcnc.org/docs/html/man/man1/halui.1.html
Last edit: 3 years 6 months ago by JPL.
The following user(s) said Thank You: COFHAL
Please Log in or Create an account to join the conversation.
- bondglen
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 1
3 years 6 months ago #269227
by bondglen
Replied by bondglen on topic Setting the modes in halui
Thanks for the link. There's lots of new info here.
But there are still many questions; can there be 2 modes active at the same time? I'm thinking NO, but not sure. If already set to true, does the 'halui-mode-auto' pin have to be set to false before setting the 'halui.mode.teleop' pin to true? or will setting the teleop pin to true cause the 'halui-mode-auto' pin to automatically reset to false?
Thanks again,
Glen
But there are still many questions; can there be 2 modes active at the same time? I'm thinking NO, but not sure. If already set to true, does the 'halui-mode-auto' pin have to be set to false before setting the 'halui.mode.teleop' pin to true? or will setting the teleop pin to true cause the 'halui-mode-auto' pin to automatically reset to false?
Thanks again,
Glen
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
-
Less
More
- Posts: 337
- Thank you received: 118
3 years 6 months ago - 3 years 6 months ago #269250
by JPL
Replied by JPL on topic Setting the modes in halui
Here is what I suggest you to do, step by step;
1- Run linuxcnc
2- Click 'machine' -> 'Show HAL configuration'
3- Expand 'Pins' (on the left side)
4- Expand 'Halui'
5- Expand 'mode'
6- Click on 'mode'
You should now have all 10 halui.mode pins listed with their state on the right, under the 'SHOW' tab
You will then click on the WATCH tab. Now, to add item on the watch tab you will click on any pins listed on the left. For example 'auto' (the first one in the mode section)
You should now have a red on yellow 'dot' on the WATCH tab with the mention halui.mode.auto
Continue adding 'is-auto', 'is-manual' and 'manual' the same way.
Dark red 'dot' = false
Yellow 'dot' = true
To change the state of a pin you will first switch to the 'SHOW' tab and then write in the 'test HAL command' box something like
setp halui.mode.auto 1 <- This will set the mode to auto
or
setp halui.mode.manual 1 <- This will set the manual mode
(Then click the Execute button)
You will find a few things while experimenting this way:
- Both mode.manual and mode.auto pins can be true at the same time. Those are the 'commands' to set the modes. (read or IN pins)
- Only one of the mode.is-manual or mode.is-auto can be true. Those are the current status of the machine. (OUT pins)
It seems to me that to set the mode to 'is-auto' you need a transition of the 'auto' pins from low to high. Same for 'is-manual'. I'm not sure if this does apply to all or any other pins, hence the previous suggestion to learn how to use 'Show HAL configuration'. To me it is an essential tool to understand linuxcnc.
I would also strongly suggest to read the HAL Basic section of the manual here: linuxcnc.org/docs/html/hal/basic-hal.html . This goes way beyond the simple setp command I've used above.
1- Run linuxcnc
2- Click 'machine' -> 'Show HAL configuration'
3- Expand 'Pins' (on the left side)
4- Expand 'Halui'
5- Expand 'mode'
6- Click on 'mode'
You should now have all 10 halui.mode pins listed with their state on the right, under the 'SHOW' tab
You will then click on the WATCH tab. Now, to add item on the watch tab you will click on any pins listed on the left. For example 'auto' (the first one in the mode section)
You should now have a red on yellow 'dot' on the WATCH tab with the mention halui.mode.auto
Continue adding 'is-auto', 'is-manual' and 'manual' the same way.
Dark red 'dot' = false
Yellow 'dot' = true
To change the state of a pin you will first switch to the 'SHOW' tab and then write in the 'test HAL command' box something like
setp halui.mode.auto 1 <- This will set the mode to auto
or
setp halui.mode.manual 1 <- This will set the manual mode
(Then click the Execute button)
You will find a few things while experimenting this way:
- Both mode.manual and mode.auto pins can be true at the same time. Those are the 'commands' to set the modes. (read or IN pins)
- Only one of the mode.is-manual or mode.is-auto can be true. Those are the current status of the machine. (OUT pins)
It seems to me that to set the mode to 'is-auto' you need a transition of the 'auto' pins from low to high. Same for 'is-manual'. I'm not sure if this does apply to all or any other pins, hence the previous suggestion to learn how to use 'Show HAL configuration'. To me it is an essential tool to understand linuxcnc.
I would also strongly suggest to read the HAL Basic section of the manual here: linuxcnc.org/docs/html/hal/basic-hal.html . This goes way beyond the simple setp command I've used above.
Last edit: 3 years 6 months ago by JPL.
Please Log in or Create an account to join the conversation.
- bondglen
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 1
3 years 6 months ago #269255
by bondglen
Replied by bondglen on topic Setting the modes in halui
Okay, using 'show' is great. I have looked at the HAL Configuration many times, but didn't know how to use the SHOW screen. Now I can monitor the pins that I am using. I think my biggest problem is that my program (loaded by 'custom.hal') is trying to change the mode from mdi to teleop while the mdi gcode is still running. I will fix it and let you know how it works.
Many thanks,
Glen
Many thanks,
Glen
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
3 years 6 months ago #269267
by cmorley
Replied by cmorley on topic Setting the modes in halui
is your program a python based program? if it is, using the linuxcnc python module would be easier/more powerful then using halui.
Please Log in or Create an account to join the conversation.
Time to create page: 0.142 seconds