Axis and Halui are not playing nice...

More
24 Jan 2013 12:49 #29063 by JR1050
Hello,

I have built a more typical user control panel consisting of regular buttons,knobs and switches.It is wired to a Mesa 7i84 board.The board works very well.I have written a component in C to read the states of the inputs and set logic,it also works so far. My problem is that there seems to be a fight with the Halui pins and the same actions in the Axis Gui.Example,I have a physical cycle start button,a bcd mode selector and a feed hold button.If I load a program and put the selector in auto mode then hit cycle start,it will run,if I hit feed hold,it will pause ,then cycle start,it will resume.So far so good,if I hit the program stop button on the gui,the program stops but it will not run again from the button,only from the gui.

It seems as though Halui and axis are sharing the same base commands,can theses be addressed directly(no halui).I opened up the python axis file and had a look. If axis and my panel wont play nice,would eliminating the gui buttons solve the problem? Halui info seems scarce,any suggestions.Thanks as alaways.
Attachments:

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

More
24 Jan 2013 17:38 - 24 Jan 2013 19:44 #29070 by ArcEye
Hi

If you are familiar with C, look at ..../src/emc/usr_intf/halui.cc
As well as listing all the headers of interest, you can see how it does it, which uncovers most of the basic calls.

Axis accesses the same calls via python bindings made in emcmodule.cc and others

I suspect that the root of the problem is to do with updating the underlying linuxcnc status.
The whole state is held in data structures which are updated with current values etc.
Any GUI for instance, has to have a loop which compares its copy of their structures to the linuxcnc ones and synchronise the two.

If the command does not emanate from Axis and its use is not reflected in a local Axis variable for instance, it will not necessarily know to look to see if that structure or field matches the underlying system.

So far so good,if I hit the program stop button on the gui,the program stops but it will not run again from the button,only from the gui.


In addition to structure synchronisation some of the other factors that come into play here are that linuxcnc must be in Auto mode and the current_line of the G Code must be set to >0 to run a file.
You will have to look to see what is happening in detail to track down the exact cause of the problem

Nice panel by the way!

regards
Last edit: 24 Jan 2013 19:44 by ArcEye.
The following user(s) said Thank You: JR1050

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

More
24 Jan 2013 21:25 #29084 by BigJohnT
To coordinate physical buttons with Axis using halui you need to use toggle2nist. See this thread for an example of run/stop pause/resume buttons coordinated with the Axis gui.

The other option is to program your gui using the python interface.

John

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

More
25 Jan 2013 00:21 #29096 by ArcEye

To coordinate physical buttons with Axis using halui you need to use toggle2nist. See this thread for an example of run/stop pause/resume buttons coordinated with the Axis gui.


Well done JT,

I bet what is missing are the <= halui.program.is-paused <= halui.program.is-running <= halui.program.is-idle etc linkages,
so that they are synchronised and Axis, your buttons and Linuxcnc all know what state they are in.

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

More
25 Jan 2013 01:51 #29098 by JR1050
Arceye and John,thanks for your input,

Attached is my noncompiled component for the panel.I am using the is-auto and is -paused,ect states.It wont do anything without them.Ill look into toggle2nist. I have no idea what it does!!!Im also gonna look at the header files. Thanks again,for the record,I didnt build the panel with all the buttons ect,It was made bt delta tau data systems,I just rewired it.I am how ever going to make a very similar panel for the rest of my equipment as soon as i get this code thing ironed out.

JR

File Attachment:

File Name: controlpanel.comp
File Size:9 KB
Attachments:

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

More
28 Jan 2013 11:35 #29216 by JR1050
After looking at both the halui source , toggle 2nist and some trial and error I came to the following observations;

Toggle2nist is a component that works best on the hal layer,it doesnt offer anything that cant be more simply coded in a component. I dont do logic on hal,it is solely for connections.


The stop program button on the gui also fires a reset/abort signal . I added physical reset button that both stops a program and/or rests and aborts errors. This required using halui.program.stop and halui.abort.

After adding the code to my component and adding the button I can now run a program, pause,stop and reset the control,which then allows me to rerun the program from the physical buttons.I spent some time in the axis.tcl file and commented out the gui buttons which are now physical buttons.I also changed some colors and fonts.

Presently working on the single step switch....picture of the slightly modified gui,for anyone interested.



Attachments:

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

More
28 Jan 2013 23:27 #29225 by BigJohnT
Cool, gotta love open source software.

John

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

Time to create page: 0.135 seconds
Powered by Kunena Forum