On Saturday 17 July 2021 01:18:45 nkp wrote:
And left out the howto, so can you clarify please?
> jogaxisget.comp:
> // sudo halcompile --install jogaxisget.comp
> component jogaxisget "determines which axis jogging";
>
> pin in bit Xin0 "axis.0.kb-jog-active";
> pin in bit Xin1;
>
> pin in bit Yin0 "axis.1.kb-jog-active";
> pin in bit Yin1;
>
> pin in bit Zin0 "axis.2.kb-jog-active";
> pin in bit Zin1;
>
> pin out bit Xtrigger ;
> pin out bit Ytrigger ;
> pin out bit Ztrigger ;
>
> pin out bit activeX ;
> pin out bit activeY ;
> pin out bit activeZ ;
>
>
> pin in bit Xverify =FALSE "axisui.Xisactive";
> pin in bit Yverify =FALSE "axisui.Yisactive";
> pin in bit Zverify =FALSE "axisui.Zisactive";
>
>
> variable hal_bit_t prev_Xtrigger = FALSE;
> variable hal_bit_t prev_Ytrigger = FALSE;
> variable hal_bit_t prev_Ztrigger = FALSE;
>
> license "GPL";
> function _;
> ;;
> FUNCTION(_) {
>
> if (( Xin0 && !Xin1 ) || ( Xin1 && !Xin0 )) {/* XOR2 axisX */
> Xtrigger = 1;
> } else {
> Xtrigger = 0;
> }
>
> if (( Yin0 && !Yin1 ) || ( Yin1 && !Yin0 )) {/* XOR2 axisY */
> Ytrigger = 1;
> } else {
> Ytrigger = 0;
> }
>
>
> if (( Zin0 && !Zin1 ) || ( Zin1 && !Zin0 )) {/* XOR2 axisZ */
> Ztrigger = 1;
> } else {
> Ztrigger = 0;
> }
>
>
> if(!!Xtrigger != !!prev_Xtrigger) /* Xtrigger has changed */
> {
> activeX = 1;
> if(!!Xverify) {prev_Xtrigger = Xtrigger; activeX = 0;}
> }
>
>
> if(!!Ytrigger != !!prev_Ytrigger) /* Ytrigger has changed */
> {
> activeY = 1;
> if(!!Yverify) {prev_Ytrigger = Ytrigger; activeY = 0;}
> }
>
>
> if(!!Ztrigger != !!prev_Ztrigger) /* Ztrigger has changed */
> {
> activeZ = 1;
> if(!!Zverify) {prev_Ztrigger = Ztrigger; activeZ = 0;}
> }
>
> }
> ##################################################
>
>
Where does this go, and how do we call it?
>
> .axisrc
>
>
> if hal_present == 1 :
> ucomp = hal.component("axisui.user")
>
> ucomp.newpin("activeX",hal.HAL_BIT,hal.HAL_IN)
> ucomp.newpin("activeY",hal.HAL_BIT,hal.HAL_IN)
> ucomp.newpin("activeZ",hal.HAL_BIT,hal.HAL_IN)
>
> ucomp.newpin("Xisactive",hal.HAL_BIT,hal.HAL_IN)
> ucomp.newpin("Yisactive",hal.HAL_BIT,hal.HAL_IN)
> ucomp.newpin("Zisactive",hal.HAL_BIT,hal.HAL_IN)
>
> ucomp.ready()
>
> def fun(pin,act):
> global flag
> if pin:
> if flag :
> flag = 0
> try:
> act()
> except:
> print "except flag = ", flag
> else:
> flag = 1
>
>
>
> def activate_axisX():
> print "activate_axisX"
> activate_axis(0)
>
>
> def activate_axisY():
> print "activate_axisY"
> activate_axis(1)
>
>
> def activate_axisZ():
> print "activate_axisZ"
> activate_axis(2)
>
>
> def user_live_update():
>
> if "xyzabcuvw".index(vars.current_axis.get())!=0:
> fun(ucomp["activeX"],activate_axisX)
> if "xyzabcuvw".index(vars.current_axis.get())!=1:
> fun(ucomp["activeY"],activate_axisY)
> if "xyzabcuvw".index(vars.current_axis.get())!=2:
> fun(ucomp["activeZ"],activate_axisZ)
>
>
> if "xyzabcuvw".index(vars.current_axis.get())==0:
> ucomp["Xisactive"] = 1
> ucomp["Yisactive"] = 0
> ucomp["Zisactive"] = 0
> if "xyzabcuvw".index(vars.current_axis.get())==1:
> ucomp["Xisactive"] = 0
> ucomp["Yisactive"] = 1
> ucomp["Zisactive"] = 0
> if "xyzabcuvw".index(vars.current_axis.get())==2:
> ucomp["Xisactive"] = 0
> ucomp["Yisactive"] = 0
> ucomp["Zisactive"] = 1
>
>
> #########################################
> postgui.hal
>
>
> loadrt jogaxisget
works
> addf jogaxisget.0 servo-thread
works added to job thread, a slower thread than servo
but without the .axisrc, these below aren't found and are all # out>
> net activeX jogaxisget.0.activeX axisui.user.activeX
> net activeY jogaxisget.0.activeY axisui.user.activeY
> net activeZ jogaxisget.0.activeZ axisui.user.activeZ
>
> net axis:0:kb jogaxisget.0.Xin0 axis.0.kb-jog-active
> net axis:1:kb jogaxisget.0.Yin0 axis.1.kb-jog-active
> net axis:2:kb jogaxisget.0.Zin0 axis.2.kb-jog-active
>
> net Xisactive jogaxisget.0.Xverify axisui.user.Xisactive
> net Yisactive jogaxisget.0.Yverify axisui.user.Yisactive
> net Zisactive jogaxisget.0.Zverify axisui.user.Zisactive
>
>
>
> ############################
> axis
>
> flag = 0
Do these last two lines above belong in postgui.hal?
> 17.07.2021 02:59, John Dammeyer пишет:
> >>>> Yes. Keyboard and click on radio button both change so the Tool
> >>>> buttons refer to the correct axis. But Pendants don't seem to
> >>>> have that feature. John
> >>>
> >>> If a USB (or in this case a Ps/2) keyboard can do it, then
> >>> somewhere in the code for that, there must be a way to get any
> >>> other device connected by USB to make the same GUI updates.
> >>>
> >>> Or am I just being naive?
> >>>
> >>> Martin
> >>>
> >>> Mouse and keyboard inputs are handled very differently from those
> >>> on a pendant. The mouse and keyboard are part of the user
> >>> interface and get to Linuxcnc through Axis or what ever UI is
> >>> being used. Pendant inputs get to Linuxcnc directly through Hal.
> >>> This has the advantage of being real-time and independent of
> >>> userspace hangups, but has the disadvantage of not being easily
> >>> tied into the UI.
> >>>
> >>> Todd
> >>
> >> I had suspected as much, but in this case its (this jogging from a
> >> mesa encoder input dial) is all handled by hal, which IIRC sends it
> >> to motion, never getting anywhere near axis. So it would be totally
> >> dependent on motion telling axis, I think.
> >
> > Actually not quite since you'll notice the DROs on the screen change
> > so stuff does go back. Once the signal from the keyboard or
> > display radio button sets the axis there is no need to feed back to
> > the AXIS radio button which is probably why it was never exposed for
> > setting externally. So yes, the MPG does get near AXIS but not the
> > part we want.
> >
> > BTW, the example I showed written in Object Pascal is very
> > simplistic and is fixed at 3 axis. The AXIS software reads the INI
> > file values to determine what to display. But even it's kind of
> > broken.
> >
> > The [TRAJ].COORDINATES.value set to XYZA assigns the X to joint0, Y
> > to joint1 and so on and you see the 'A' radio button on the screen.
> > Set it to only XYZ and you only see 3 radio buttons.
> >
> > But swap those around like AXYZ and now the AXIS radio button marked
> > X spins the Y axis. The Y button spins the Z, the Z button spins
> > the A axis and the A button spins the X. And yet, the arrow keys
> > still spin the correct axis.
> >
> > The [DISPLAY].GEOMETRY.value set to xyza doesn't seem to affect the
> > radio buttons. I think it impacts the trajectory display but
> > haven't looked further into that.
> >
> > I think AXIS python code counts the number of letters and uses that
> > to put XYZ
> > A
> > Radio buttons on the screen but it gets confused with the mapping to
> > the +/- buttons while the keyboard doesn't seem to care.
> >
> > John
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Emc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users