Discussion:
view and mm/inches switching.
(too old to reply)
Gene Heskett
2017-04-15 14:03:18 UTC
Permalink
Raw Message
Greetings everybody;

I think I asked about this once before, but do not recall getting an
answer I could use, so asking again.

My jog wheel code currently has no way to switch between inches and mm's,
either for the motion stepsize, or for the displayed step size. So I
need a pair of pins exposed that tally the G20-G21 status, to be used as
a step size modifier, and a pin from the view mode tallying whether the
backplot dro is in mm's or inches.

I would use the G20-21 tally to change the step size to mm's, and the
view tally to change the size of step display.

If those pins can be exposed for my use, it would solve the last problem,
that of needing to maintain 2 configs whose only difference would be a a
pair of setp statements. That doesn't strike me as being a long term
viable solution.

Can this be done, or is it hidden in the #5xxx data and I've not found
it?

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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
John Figie
2017-04-15 23:35:45 UTC
Permalink
Raw Message
Gene

I don't know if this helps. There are some global parameters you can read
witin your g code program.


-

#<_metric> - Return 1 if G21 is on, else 0.
-

#<_imperial> - Return 1 if G20 is on, else 0.

John.

On Apr 15, 2017 9:05 AM, "Gene Heskett" <***@shentel.net> wrote:

> Greetings everybody;
>
> I think I asked about this once before, but do not recall getting an
> answer I could use, so asking again.
>
> My jog wheel code currently has no way to switch between inches and mm's,
> either for the motion stepsize, or for the displayed step size. So I
> need a pair of pins exposed that tally the G20-G21 status, to be used as
> a step size modifier, and a pin from the view mode tallying whether the
> backplot dro is in mm's or inches.
>
> I would use the G20-21 tally to change the step size to mm's, and the
> view tally to change the size of step display.
>
> If those pins can be exposed for my use, it would solve the last problem,
> that of needing to maintain 2 configs whose only difference would be a a
> pair of setp statements. That doesn't strike me as being a long term
> viable solution.
>
> Can this be done, or is it hidden in the #5xxx data and I've not found
> it?
>
> 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)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Gene Heskett
2017-04-15 23:43:22 UTC
Permalink
Raw Message
On Saturday 15 April 2017 19:35:45 John Figie wrote:

> Gene
>
> I don't know if this helps. There are some global parameters you can
> read witin your g code program.
>
>
> -
>
> #<_metric> - Return 1 if G21 is on, else 0.
> -
>
> #<_imperial> - Return 1 if G20 is on, else 0.
>
> John.

Its a last ditch thought, but not as dynamic as I'd like. I'd like very
much if it was real time as I have used that switch in the middle of a
gcode program more than once.

Thanks John.

> On Apr 15, 2017 9:05 AM, "Gene Heskett" <***@shentel.net> wrote:
> > Greetings everybody;
> >
> > I think I asked about this once before, but do not recall getting an
> > answer I could use, so asking again.
> >
> > My jog wheel code currently has no way to switch between inches and
> > mm's, either for the motion stepsize, or for the displayed step
> > size. So I need a pair of pins exposed that tally the G20-G21
> > status, to be used as a step size modifier, and a pin from the view
> > mode tallying whether the backplot dro is in mm's or inches.
> >
> > I would use the G20-21 tally to change the step size to mm's, and
> > the view tally to change the size of step display.
> >
> > If those pins can be exposed for my use, it would solve the last
> > problem, that of needing to maintain 2 configs whose only difference
> > would be a a pair of setp statements. That doesn't strike me as
> > being a long term viable solution.
> >
> > Can this be done, or is it hidden in the #5xxx data and I've not
> > found it?
> >
> > 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)
> > Genes Web page <http://geneslinuxbox.net:6309/gene>
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
andy pugh
2017-04-15 23:58:22 UTC
Permalink
Raw Message
On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net> wrote:
> Its a last ditch thought, but not as dynamic as I'd like. I'd like very
> much if it was real time as I have used that switch in the middle of a
> gcode program more than once.

Do you often care about jog step sizes in the middle of the execution
of a g-code program?
And do you really want the display switching units when you call a
mm-coded subroutine? I think that would actually just be annoying.

--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
Gene Heskett
2017-04-16 00:56:21 UTC
Permalink
Raw Message
On Saturday 15 April 2017 19:58:22 andy pugh wrote:

> On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net> wrote:
> > Its a last ditch thought, but not as dynamic as I'd like. I'd like
> > very much if it was real time as I have used that switch in the
> > middle of a gcode program more than once.
>
> Do you often care about jog step sizes in the middle of the execution
> of a g-code program?

Perhaps .1% of the time, most often when there is a tool change or 5 in
the code.

> And do you really want the display switching units when you call a
> mm-coded subroutine? I think that would actually just be annoying.

Since we can't trace the subroutine at all, and any errors are blamed on
the parent call, at least the display changing modes could tell us the
subroutine is running. Its a nearly vanishingly thin excuse to be sure
though. :(

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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Chris Morley
2017-04-17 18:50:41 UTC
Permalink
Raw Message
I think you are using recent master.

If so this python program should give you what you want.

name it metric_status and put it in your $PATH as per:

http://linuxcnc.org/docs/devel/html/hal/halmodule.html

Creating Userspace Python Components - LinuxCNC.org<http://linuxcnc.org/docs/devel/html/hal/halmodule.html>
linuxcnc.org
A userspace component begins by creating its pins and parameters, then enters a loop which will periodically drive all the outputs from the inputs.




#!/usr/bin/env python
import hal
from hal_glib import GStat
import gobject
GSTAT = GStat()

def mode_changed(obj, data):
h['g20'] = not data
h['g21'] = data

h = hal.component("metric_status")
h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
h.ready()

GSTAT.connect("metric-mode-changed",mode_changed)
# work around forced merge error
GSTAT.merge()
metric_new = GSTAT.old['metric']
GSTAT.emit('metric_mode_changed',metric_new)


try:
gobject.MainLoop().run()
except KeyboardInterrupt:
raise SystemExit


________________________________
From: Gene Heskett <***@shentel.net>
Sent: April 16, 2017 12:56 AM
To: emc-***@lists.sourceforge.net
Subject: Re: [Emc-developers] view and mm/inches switching.

On Saturday 15 April 2017 19:58:22 andy pugh wrote:

> On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net> wrote:
> > Its a last ditch thought, but not as dynamic as I'd like. I'd like
> > very much if it was real time as I have used that switch in the
> > middle of a gcode program more than once.
>
> Do you often care about jog step sizes in the middle of the execution
> of a g-code program?

Perhaps .1% of the time, most often when there is a tool change or 5 in
the code.

> And do you really want the display switching units when you call a
> mm-coded subroutine? I think that would actually just be annoying.

Since we can't trace the subroutine at all, and any errors are blamed on
the parent call, at least the display changing modes could tell us the
subroutine is running. Its a nearly vanishingly thin excuse to be sure
though. :(

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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
[http://geneslinuxbox.net:6309/gene/pix/EasterSundayCropped2004-1.jpg]<http://geneslinuxbox.net:6309/gene>

Gene's Web pages<http://geneslinuxbox.net:6309/gene>
geneslinuxbox.net
Welcome to Gene's web pages. Here you will find some of the things that make me tick, and that help keep me out of the bars. That is me & the missus, Dee (Elladene) I ...



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
Emc-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers
Emc-developers Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developers>
lists.sourceforge.net
The Enhanced Machine Controller (EMC) is a CNC machine controller that runs on Linux and is available under the terms of the GNU General Public License.
Gene Heskett
2017-04-17 19:56:03 UTC
Permalink
Raw Message
On Monday 17 April 2017 14:50:41 Chris Morley wrote:

> I think you are using recent master.
>
Yes Chris, and thank you. For G20-G21, this looks promising.

> If so this python program should give you what you want.
>
> name it metric_status and put it in your $PATH as per:
>
> http://linuxcnc.org/docs/devel/html/hal/halmodule.html
>
> Creating Userspace Python Components -
> LinuxCNC.org<http://linuxcnc.org/docs/devel/html/hal/halmodule.html>
> linuxcnc.org
> A userspace component begins by creating its pins and parameters, then
> enters a loop which will periodically drive all the outputs from the
> inputs.
>
>
>
>
> #!/usr/bin/env python
> import hal
> from hal_glib import GStat
> import gobject
> GSTAT = GStat()
>
> def mode_changed(obj, data):
> h['g20'] = not data
> h['g21'] = data
>
> h = hal.component("metric_status")
> h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
> h.ready()
>
> GSTAT.connect("metric-mode-changed",mode_changed)
> # work around forced merge error
> GSTAT.merge()
> metric_new = GSTAT.old['metric']
> GSTAT.emit('metric_mode_changed',metric_new)
>
>
> try:
> gobject.MainLoop().run()
> except KeyboardInterrupt:
> raise SystemExit
>


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Gene Heskett
2017-04-17 20:13:49 UTC
Permalink
Raw Message
On Monday 17 April 2017 14:50:41 Chris Morley wrote:

> I think you are using recent master.
>
> If so this python program should give you what you want.
>
> name it metric_status and put it in your $PATH as per:
>
> http://linuxcnc.org/docs/devel/html/hal/halmodule.html
>
> Creating Userspace Python Components -
> LinuxCNC.org<http://linuxcnc.org/docs/devel/html/hal/halmodule.html>
> linuxcnc.org
> A userspace component begins by creating its pins and parameters, then
> enters a loop which will periodically drive all the outputs from the
> inputs.
>
>
>
>
> #!/usr/bin/env python
> import hal
> from hal_glib import GStat
> import gobject
> GSTAT = GStat()
>
> def mode_changed(obj, data):
> h['g20'] = not data
> h['g21'] = data
>
> h = hal.component("metric_status")
> h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
> h.ready()
>
> GSTAT.connect("metric-mode-changed",mode_changed)
> # work around forced merge error
> GSTAT.merge()
> metric_new = GSTAT.old['metric']
> GSTAT.emit('metric_mode_changed',metric_new)
>
>
> try:
> gobject.MainLoop().run()
> except KeyboardInterrupt:
> raise SystemExit
>
>
> ________________________________
> From: Gene Heskett <***@shentel.net>
> Sent: April 16, 2017 12:56 AM
> To: emc-***@lists.sourceforge.net
> Subject: Re: [Emc-developers] view and mm/inches switching.
>
> On Saturday 15 April 2017 19:58:22 andy pugh wrote:
> > On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net> wrote:
> > > Its a last ditch thought, but not as dynamic as I'd like. I'd like
> > > very much if it was real time as I have used that switch in the
> > > middle of a gcode program more than once.
> >
> > Do you often care about jog step sizes in the middle of the
> > execution of a g-code program?
>
> Perhaps .1% of the time, most often when there is a tool change or 5
> in the code.
>
> > And do you really want the display switching units when you call a
> > mm-coded subroutine? I think that would actually just be annoying.
>
> Since we can't trace the subroutine at all, and any errors are blamed
> on the parent call, at least the display changing modes could tell us
> the subroutine is running. Its a nearly vanishingly thin excuse to be
> sure though. :(
>
> 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)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
> [http://geneslinuxbox.net:6309/gene/pix/EasterSundayCropped2004-1.jpg]
><http://geneslinuxbox.net:6309/gene>
>
> Gene's Web pages<http://geneslinuxbox.net:6309/gene>
> geneslinuxbox.net
> Welcome to Gene's web pages. Here you will find some of the things
> that make me tick, and that help keep me out of the bars. That is me &
> the missus, Dee (Elladene) I ...
>
>
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
> Emc-developers Info Page -
> SourceForge<https://lists.sourceforge.net/lists/listinfo/emc-developer
>s> lists.sourceforge.net
> The Enhanced Machine Controller (EMC) is a CNC machine controller that
> runs on Linux and is available under the terms of the GNU General
> Public License.
>
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Kurt Jacobson
2017-04-17 20:16:45 UTC
Permalink
Raw Message
Chris,

I am using the user-space Python comp pasted below to get the G20/21 state
out to HAL pins. It looks somewhat similar to what you came up with (which
makes me feel good as I am just starting to learn python and play with
LCNC). I sent it to Gene on Saturday, but I guess he did not like it ;)

I brute forced it buy using the python interface and polling every 50ms and
updating the HAL pins, but I see you used a module GStat, where can I find
some info on that, it looks useful?

Cheers,
Kurt

Here is my code:

#!/usr/bin/env python
import hal, time
import linuxcnc

stat = linuxcnc.stat()

h = hal.component("units")
h.newpin("prog_in", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("prog_mm", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("update_rate", hal.HAL_FLOAT, hal.HAL_IN)

h.ready()

# Set default update rate to 50ms
h.update_rate = .05

try:
while 1:
time.sleep(h.update_rate)
stat.poll()
prog_units = stat.program_units
if prog_units == 1: # Inch
h.prog_in = 1
h.prog_mm = 0
elif prog_units == 2: # Metric
h.prog_in = 0
h.prog_mm = 1
except KeyboardInterrupt:
raise SystemExit

On Mon, Apr 17, 2017 at 2:50 PM, Chris Morley <***@hotmail.com>
wrote:

> I think you are using recent master.
>
> If so this python program should give you what you want.
>
> name it metric_status and put it in your $PATH as per:
>
> http://linuxcnc.org/docs/devel/html/hal/halmodule.html
>
> Creating Userspace Python Components - LinuxCNC.org<http://linuxcnc.
> org/docs/devel/html/hal/halmodule.html>
> linuxcnc.org
> A userspace component begins by creating its pins and parameters, then
> enters a loop which will periodically drive all the outputs from the inputs.
>
>
>
>
> #!/usr/bin/env python
> import hal
> from hal_glib import GStat
> import gobject
> GSTAT = GStat()
>
> def mode_changed(obj, data):
> h['g20'] = not data
> h['g21'] = data
>
> h = hal.component("metric_status")
> h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
> h.ready()
>
> GSTAT.connect("metric-mode-changed",mode_changed)
> # work around forced merge error
> GSTAT.merge()
> metric_new = GSTAT.old['metric']
> GSTAT.emit('metric_mode_changed',metric_new)
>
>
> try:
> gobject.MainLoop().run()
> except KeyboardInterrupt:
> raise SystemExit
>
>
> ________________________________
> From: Gene Heskett <***@shentel.net>
> Sent: April 16, 2017 12:56 AM
> To: emc-***@lists.sourceforge.net
> Subject: Re: [Emc-developers] view and mm/inches switching.
>
> On Saturday 15 April 2017 19:58:22 andy pugh wrote:
>
> > On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net> wrote:
> > > Its a last ditch thought, but not as dynamic as I'd like. I'd like
> > > very much if it was real time as I have used that switch in the
> > > middle of a gcode program more than once.
> >
> > Do you often care about jog step sizes in the middle of the execution
> > of a g-code program?
>
> Perhaps .1% of the time, most often when there is a tool change or 5 in
> the code.
>
> > And do you really want the display switching units when you call a
> > mm-coded subroutine? I think that would actually just be annoying.
>
> Since we can't trace the subroutine at all, and any errors are blamed on
> the parent call, at least the display changing modes could tell us the
> subroutine is running. Its a nearly vanishingly thin excuse to be sure
> though. :(
>
> 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)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
> [http://geneslinuxbox.net:6309/gene/pix/EasterSundayCropped2004-1.jpg]<
> http://geneslinuxbox.net:6309/gene>
>
> Gene's Web pages<http://geneslinuxbox.net:6309/gene>
> geneslinuxbox.net
> Welcome to Gene's web pages. Here you will find some of the things that
> make me tick, and that help keep me out of the bars. That is me & the
> missus, Dee (Elladene) I ...
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
> Emc-developers Info Page - SourceForge<https://lists.
> sourceforge.net/lists/listinfo/emc-developers>
> lists.sourceforge.net
> The Enhanced Machine Controller (EMC) is a CNC machine controller that
> runs on Linux and is available under the terms of the GNU General Public
> License.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Gene Heskett
2017-04-17 20:39:17 UTC
Permalink
Raw Message
On Monday 17 April 2017 16:16:45 Kurt Jacobson wrote:

> Chris,
>
> I am using the user-space Python comp pasted below to get the G20/21
> state out to HAL pins. It looks somewhat similar to what you came up
> with (which makes me feel good as I am just starting to learn python
> and play with LCNC). I sent it to Gene on Saturday, but I guess he did
> not like it ;)
>
Never saw it Kurt, and its not in my inbox or my emc folder here. Did you
get a bounce?

> I brute forced it buy using the python interface and polling every
> 50ms and updating the HAL pins, but I see you used a module GStat,
> where can I find some info on that, it looks useful?
>
> Cheers,
> Kurt
>
> Here is my code:
>
> #!/usr/bin/env python
> import hal, time
> import linuxcnc
>
> stat = linuxcnc.stat()
>
> h = hal.component("units")
> h.newpin("prog_in", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("prog_mm", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("update_rate", hal.HAL_FLOAT, hal.HAL_IN)
>
> h.ready()
>
> # Set default update rate to 50ms
> h.update_rate = .05
>
> try:
> while 1:
> time.sleep(h.update_rate)
> stat.poll()
> prog_units = stat.program_units
> if prog_units == 1: # Inch
> h.prog_in = 1
> h.prog_mm = 0
> elif prog_units == 2: # Metric
> h.prog_in = 0
> h.prog_mm = 1
> except KeyboardInterrupt:
> raise SystemExit
>
> On Mon, Apr 17, 2017 at 2:50 PM, Chris Morley
> <***@hotmail.com>
>
> wrote:
> > I think you are using recent master.
> >
> > If so this python program should give you what you want.
> >
> > name it metric_status and put it in your $PATH as per:
> >
> > http://linuxcnc.org/docs/devel/html/hal/halmodule.html
> >
> > Creating Userspace Python Components - LinuxCNC.org<http://linuxcnc.
> > org/docs/devel/html/hal/halmodule.html>
> > linuxcnc.org
> > A userspace component begins by creating its pins and parameters,
> > then enters a loop which will periodically drive all the outputs
> > from the inputs.
> >
> >
> >
> >
> > #!/usr/bin/env python
> > import hal
> > from hal_glib import GStat
> > import gobject
> > GSTAT = GStat()
> >
> > def mode_changed(obj, data):
> > h['g20'] = not data
> > h['g21'] = data
> >
> > h = hal.component("metric_status")
> > h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
> > h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
> > h.ready()
> >
> > GSTAT.connect("metric-mode-changed",mode_changed)
> > # work around forced merge error
> > GSTAT.merge()
> > metric_new = GSTAT.old['metric']
> > GSTAT.emit('metric_mode_changed',metric_new)
> >
> >
> > try:
> > gobject.MainLoop().run()
> > except KeyboardInterrupt:
> > raise SystemExit
> >
> >
> > ________________________________
> > From: Gene Heskett <***@shentel.net>
> > Sent: April 16, 2017 12:56 AM
> > To: emc-***@lists.sourceforge.net
> > Subject: Re: [Emc-developers] view and mm/inches switching.
> >
> > On Saturday 15 April 2017 19:58:22 andy pugh wrote:
> > > On 16 April 2017 at 00:43, Gene Heskett <***@shentel.net>
wrote:
> > > > Its a last ditch thought, but not as dynamic as I'd like. I'd
> > > > like very much if it was real time as I have used that switch in
> > > > the middle of a gcode program more than once.
> > >
> > > Do you often care about jog step sizes in the middle of the
> > > execution of a g-code program?
> >
> > Perhaps .1% of the time, most often when there is a tool change or 5
> > in the code.
> >
> > > And do you really want the display switching units when you call a
> > > mm-coded subroutine? I think that would actually just be annoying.
> >
> > Since we can't trace the subroutine at all, and any errors are
> > blamed on the parent call, at least the display changing modes could
> > tell us the subroutine is running. Its a nearly vanishingly thin
> > excuse to be sure though. :(
> >
> > 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)
> > Genes Web page <http://geneslinuxbox.net:6309/gene>
> > [http://geneslinuxbox.net:6309/gene/pix/EasterSundayCropped2004-1.jp
> >g]< http://geneslinuxbox.net:6309/gene>
> >
> > Gene's Web pages<http://geneslinuxbox.net:6309/gene>
> > geneslinuxbox.net
> > Welcome to Gene's web pages. Here you will find some of the things
> > that make me tick, and that help keep me out of the bars. That is me
> > & the missus, Dee (Elladene) I ...
> >
> >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
> > Emc-developers Info Page - SourceForge<https://lists.
> > sourceforge.net/lists/listinfo/emc-developers>
> > lists.sourceforge.net
> > The Enhanced Machine Controller (EMC) is a CNC machine controller
> > that runs on Linux and is available under the terms of the GNU
> > General Public License.
> >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Chris Morley
2017-04-17 23:57:45 UTC
Permalink
Raw Message
________________________________
From: Kurt Jacobson <***@bellsouth.net>
Sent: April 17, 2017 8:16 PM
To: EMC developers
Subject: Re: [Emc-developers] view and mm/inches switching.

Chris,

I am using the user-space Python comp pasted below to get the G20/21 state
out to HAL pins. It looks somewhat similar to what you came up with (which
makes me feel good as I am just starting to learn python and play with
LCNC). I sent it to Gene on Saturday, but I guess he did not like it ;)

I brute forced it buy using the python interface and polling every 50ms and
updating the HAL pins, but I see you used a module GStat, where can I find
some info on that, it looks useful?

Cheers,
Kurt


Hi Kurt
your code looks fine.

Gstat is a super secret dev only code....

Ok truth is it is used in gladevcp and GUIs for widgets that require linuxcnc status updates.
It has no documentation - yet - I have some started somewhere...
I recently added more functions to it to help with GUI development.
I have a branch of QTvcp that uses it extensively.
I idea is to have only one program poll updates rather then every little program polling.
It uses GObject messages to tell the programs that are registered to the signal to update.
event driven updates is the GUI programming term for it.

look in lib/python/hal_glib.py for the code.

Chris M
Kurt Jacobson
2017-04-18 00:58:50 UTC
Permalink
Raw Message
>
>
> Hi Kurt
> your code looks fine.
> Gstat is a super secret dev only code....
> Ok truth is it is used in gladevcp and GUIs for widgets that require
> linuxcnc status updates.
> It has no documentation - yet - I have some started somewhere...
> I recently added more functions to it to help with GUI development.
> I have a branch of QTvcp that uses it extensively.
> I idea is to have only one program poll updates rather then every little
> program polling.
> It uses GObject messages to tell the programs that are registered to the
> signal to update.

event driven updates is the GUI programming term for it.


Ah, so it is similar to a event callback signal in GUI programming, but for
LCNC status.

Looking back at your code I see something that looks like a GTK button
signal connector:
GSTAT.connect("metric-mode-changed",mode_changed)

So "metric-mode-changed" is similar to "clicked" when connecting a button
handler? But then there must be a bunch of different signals like
"metric-mode-changed"...
And, if I am thinking in the right direction, instead of polling to see if
something has changed I can write functions that get called only when
something does change. That's genius!

Sorry for thinking out loud. Guess I'll have to dig around and see what I
can learn about this top secret code!


> Chris M


Thanks much Chris!

Kurt



On Mon, Apr 17, 2017 at 7:57 PM, Chris Morley <***@hotmail.com>
wrote:

>
>
>
> ________________________________
> From: Kurt Jacobson <***@bellsouth.net>
> Sent: April 17, 2017 8:16 PM
> To: EMC developers
> Subject: Re: [Emc-developers] view and mm/inches switching.
>
> Chris,
>
> I am using the user-space Python comp pasted below to get the G20/21 state
> out to HAL pins. It looks somewhat similar to what you came up with (which
> makes me feel good as I am just starting to learn python and play with
> LCNC). I sent it to Gene on Saturday, but I guess he did not like it ;)
>
> I brute forced it buy using the python interface and polling every 50ms and
> updating the HAL pins, but I see you used a module GStat, where can I find
> some info on that, it looks useful?
>
> Cheers,
> Kurt
>
>
> Hi Kurt
> your code looks fine.
>
> Gstat is a super secret dev only code....
>
> Ok truth is it is used in gladevcp and GUIs for widgets that require
> linuxcnc status updates.
> It has no documentation - yet - I have some started somewhere...
> I recently added more functions to it to help with GUI development.
> I have a branch of QTvcp that uses it extensively.
> I idea is to have only one program poll updates rather then every little
> program polling.
> It uses GObject messages to tell the programs that are registered to the
> signal to update.
> event driven updates is the GUI programming term for it.
>
> look in lib/python/hal_glib.py for the code.
>
> Chris M
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Gene Heskett
2017-04-18 01:55:13 UTC
Permalink
Raw Message
On Monday 17 April 2017 16:16:45 Kurt Jacobson wrote:

> #!/usr/bin/env python
> import hal, time
> import linuxcnc
>
> stat = linuxcnc.stat()
>
> h = hal.component("units")
> h.newpin("prog_in", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("prog_mm", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("update_rate", hal.HAL_FLOAT, hal.HAL_IN)
>
I did a loadusr units, and if I look at a halmeter I can see the above
pins, with
prog_in=true
prog_mm=false
update_rate=.1

but I now assume it needs addf'd to a thread before it works as it is not
responding to a g20-g21 issued thru the MDI cmd line.
The jog-thread is 10x too fast. I already have a jog-thread created, and
man 9 threads says it can do 3 per call, so am I to have it create a
mode-thread at 10x the period of the jog-thread? And addf it to that
thread? But that won't run. The light at the end of the tunnel? It's
not moving. :(

So I got rid of the addf, but left the mode-thread, and now its working!
Call me confused. The docs do not cover this.

Now I need it to report the viewport dro mode too, and find out if I can
use it to switch the background colors of a label box, and a number box,
neither of which are noted to actually have that ability. A pyvcp LED
can, but it can't show text.

Is getting the DRO mode as simple as adding:

h.newpin("dro_in", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("dro_mm", hal.HAL_BIT, hal.HAL_OUT)

To the above code? It can't do worse than fail. And of course it did.
Failed safe, and the only thing that is updated in the linuxcnc-status
display is the number of the command when the ! key is repeatedly
pressed. So it is not available in the status array. Grrrr.

That means all I can do is leave the displayed jog size alone, but make
the jog size displayed be inches or mm's as applied to the machines
motion. EG if G20 it true the displayed value in inches, but if G21 is
true, the displayed jog size, which doesn't change in the gui, but the
jog is then done in mm's.

That is not what I had in mind, but it can be lived with IF I can change
the background color of the num-box to track the g20-g21 status.

Can I???

Thanks pyvcp experts. And how many on this list are color-blind, making
a poor choice of colors unusable for your use?

> h.ready()
>
> # Set default update rate to 50ms
> h.update_rate = .05
>
> try:
>     while 1:
>         time.sleep(h.update_rate)
>         stat.poll()
>         prog_units = stat.program_units
>         if prog_units == 1: # Inch
>             h.prog_in = 1
>             h.prog_mm = 0
>         elif prog_units == 2: # Metric
>             h.prog_in = 0
>             h.prog_mm = 1
> except KeyboardInterrupt:
>     raise SystemExit


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Chris Morley
2017-04-18 18:27:37 UTC
Permalink
Raw Message
________________________________
From: Kurt Jacobson <***@bellsouth.net>
Sent: April 17, 2017 8:16 PM
To: EMC developers
Subject: Re: [Emc-developers] view and mm/inches switching.

Chris,

I am using the user-space Python comp pasted below to get the G20/21 state
out to HAL pins. It looks somewhat similar to what you came up with (which
makes me feel good as I am just starting to learn python and play with
LCNC). I sent it to Gene on Saturday, but I guess he did not like it ;)

I brute forced it buy using the python interface and polling every 50ms and
updating the HAL pins, but I see you used a module GStat, where can I find
some info on that, it looks useful?

Cheers,
Kurt

Hey Kurt i added some basic docs:
http://linuxcnc.org/docs/devel/html/gui/GStat.html

Chris M
Kurt Jacobson
2017-04-18 22:20:56 UTC
Permalink
Raw Message
>
> Hey Kurt i added some basic docs:
> http://linuxcnc.org/docs/devel/html/gui/GStat.html



Chris M


Thanks Chris, that looks great!
I'll have to see if I can use GStat in the UI I am making for my mill.

https://github.com/KurtJacobson/hazzy

Cheers,
Kurt


On Tue, Apr 18, 2017 at 2:27 PM, Chris Morley <***@hotmail.com>
wrote:

>
>
>
> ________________________________
> From: Kurt Jacobson <***@bellsouth.net>
> Sent: April 17, 2017 8:16 PM
> To: EMC developers
> Subject: Re: [Emc-developers] view and mm/inches switching.
>
> Chris,
>
> I am using the user-space Python comp pasted below to get the G20/21 state
> out to HAL pins. It looks somewhat similar to what you came up with (which
> makes me feel good as I am just starting to learn python and play with
> LCNC). I sent it to Gene on Saturday, but I guess he did not like it ;)
>
> I brute forced it buy using the python interface and polling every 50ms and
> updating the HAL pins, but I see you used a module GStat, where can I find
> some info on that, it looks useful?
>
> Cheers,
> Kurt
>
> Hey Kurt i added some basic docs:
> http://linuxcnc.org/docs/devel/html/gui/GStat.html
>
> Chris M
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Gene Heskett
2017-04-17 20:35:21 UTC
Permalink
Raw Message
On Monday 17 April 2017 14:50:41 Chris Morley wrote:

> I think you are using recent master.
>
> If so this python program should give you what you want.
>
> name it metric_status and put it in your $PATH as per:
>
> http://linuxcnc.org/docs/devel/html/hal/halmodule.html
>
> Creating Userspace Python Components -
> LinuxCNC.org<http://linuxcnc.org/docs/devel/html/hal/halmodule.html>
> linuxcnc.org
> A userspace component begins by creating its pins and parameters, then
> enters a loop which will periodically drive all the outputs from the
> inputs.
>
>
>
>
> #!/usr/bin/env python
> import hal
> from hal_glib import GStat
> import gobject
> GSTAT = GStat()
>
> def mode_changed(obj, data):
> h['g20'] = not data
> h['g21'] = data
>
> h = hal.component("metric_status")
> h.newpin("g20", hal.HAL_BIT, hal.HAL_OUT)
> h.newpin("g21", hal.HAL_BIT, hal.HAL_OUT)
> h.ready()
>
> GSTAT.connect("metric-mode-changed",mode_changed)
> # work around forced merge error
> GSTAT.merge()
> metric_new = GSTAT.old['metric']
> GSTAT.emit('metric_mode_changed',metric_new)
>
>
> try:
> gobject.MainLoop().run()
> except KeyboardInterrupt:
> raise SystemExit
>
>
But I didn't get very far:

***@raspberrypi:~/linuxcnc/configs/sheldon-lathe $ halrun
halcmd: loadusr metric_status
halcmd: Traceback (most recent call last):
File "/usr/local/bin/metric_status", line 16, in <module>
GSTAT.connect("metric-mode-changed",mode_changed)
TypeError: <GStat object at 0x76a9df80 (hal_glib+_GStat at 0xd09500)>:
unknown signal name: metric-mode-changed

halcmd: show pin
Component Pins:
Owner Type Dir Value Name

halcmd:

Something didn't work, but me python dummy.

I thought I was following directions from the link?

Thanks Chris.

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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Chris Morley
2017-04-17 23:34:02 UTC
Permalink
Raw Message
>
>
But I didn't get very far:

***@raspberrypi:~/linuxcnc/configs/sheldon-lathe $ halrun
halcmd: loadusr metric_status
halcmd: Traceback (most recent call last):
File "/usr/local/bin/metric_status", line 16, in <module>
GSTAT.connect("metric-mode-changed",mode_changed)
TypeError: <GStat object at 0x76a9df80 (hal_glib+_GStat at 0xd09500)>:
unknown signal name: metric-mode-changed

halcmd: show pin
Component Pins:
Owner Type Dir Value Name

halcmd:

Something didn't work, but me python dummy.

I thought I was following directions from the link?

Thanks Chris.

Cheers, Gene Heskett
-


Probably not current enough then.
looks like it was added march 21 or so.
Use Kurts version (but i would set the rate at minimum 100ms instead of 50.

Chris M
Gene Heskett
2017-04-17 23:40:43 UTC
Permalink
Raw Message
On Monday 17 April 2017 19:34:02 Chris Morley wrote:

> But I didn't get very far:
>
> ***@raspberrypi:~/linuxcnc/configs/sheldon-lathe $ halrun
> halcmd: loadusr metric_status
> halcmd: Traceback (most recent call last):
> File "/usr/local/bin/metric_status", line 16, in <module>
> GSTAT.connect("metric-mode-changed",mode_changed)
> TypeError: <GStat object at 0x76a9df80 (hal_glib+_GStat at 0xd09500)>:
> unknown signal name: metric-mode-changed
>
> halcmd: show pin
> Component Pins:
> Owner Type Dir Value Name
>
> halcmd:
>
> Something didn't work, but me python dummy.
>
> I thought I was following directions from the link?
>
> Thanks Chris.
>
> Cheers, Gene Heskett
> -
>
>
> Probably not current enough then.
> looks like it was added march 21 or so.

The pi is running jessie (raspbian version)

> Use Kurts version (but i would set the rate at minimum 100ms instead
> of 50.
>
That would be fast enough I believe. Thanks Chris.


> Chris M
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Kurt Jacobson
2017-04-18 00:17:45 UTC
Permalink
Raw Message
Gene,
I have attached my python script as a file so you won't have to repair any
line ending damage done by pasting it into the email. I am doing this form
a windoze machine though so it may not be much better off :)

Also I changed the default poll interval to 100ms as suggested by Chris
above.

Here is a little bit of usage info:

NAME:
units

PINS:
units.prog_in (bit out, TRUE if G20 is active)
units.prog_mm (bit out, TRUE if G21 is active)
units.update_rate (float in, update rate in seconds, defaults to 0.05s if
not set)

USAGE:
Put the "units" python file somewhere on your $PATH and make it executable.
(I have it in usr/bin)

In your HAL file load it as a userspace component: loadusr units
You do not need to add it to a thread.


Hope this works for you Gene!

Cheers,
Kurt

On Mon, Apr 17, 2017 at 7:40 PM, Gene Heskett <***@shentel.net> wrote:

> On Monday 17 April 2017 19:34:02 Chris Morley wrote:
>
> > But I didn't get very far:
> >
> > ***@raspberrypi:~/linuxcnc/configs/sheldon-lathe $ halrun
> > halcmd: loadusr metric_status
> > halcmd: Traceback (most recent call last):
> > File "/usr/local/bin/metric_status", line 16, in <module>
> > GSTAT.connect("metric-mode-changed",mode_changed)
> > TypeError: <GStat object at 0x76a9df80 (hal_glib+_GStat at 0xd09500)>:
> > unknown signal name: metric-mode-changed
> >
> > halcmd: show pin
> > Component Pins:
> > Owner Type Dir Value Name
> >
> > halcmd:
> >
> > Something didn't work, but me python dummy.
> >
> > I thought I was following directions from the link?
> >
> > Thanks Chris.
> >
> > Cheers, Gene Heskett
> > -
> >
> >
> > Probably not current enough then.
> > looks like it was added march 21 or so.
>
> The pi is running jessie (raspbian version)
>
> > Use Kurts version (but i would set the rate at minimum 100ms instead
> > of 50.
> >
> That would be fast enough I believe. Thanks Chris.
>
>
> > Chris M
> > ----------------------------------------------------------------------
> >-------- Check out the vibrant tech community on one of the world's
> > most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers
>
>
> 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)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
Gene Heskett
2017-04-18 01:58:09 UTC
Permalink
Raw Message
On Monday 17 April 2017 20:17:45 Kurt Jacobson wrote:

> Gene,
> I have attached my python script as a file so you won't have to repair
> any line ending damage done by pasting it into the email. I am doing
> this form a windoze machine though so it may not be much better off :)
>
> Also I changed the default poll interval to 100ms as suggested by
> Chris above.
>
> Here is a little bit of usage info:
>
> NAME:
> units
>
> PINS:
> units.prog_in (bit out, TRUE if G20 is active)
> units.prog_mm (bit out, TRUE if G21 is active)
> units.update_rate (float in, update rate in seconds, defaults to
> 0.05s if not set)
>
> USAGE:
> Put the "units" python file somewhere on your $PATH and make it
> executable. (I have it in usr/bin)
>
> In your HAL file load it as a userspace component: loadusr units
> You do not need to add it to a thread.
>
>
> Hope this works for you Gene!

It already did work, just fine, Kurt & I thank you.
>
> Cheers,
> Kurt
>
> On Mon, Apr 17, 2017 at 7:40 PM, Gene Heskett <***@shentel.net>
wrote:
> > On Monday 17 April 2017 19:34:02 Chris Morley wrote:
> > > But I didn't get very far:
> > >
> > > ***@raspberrypi:~/linuxcnc/configs/sheldon-lathe $ halrun
> > > halcmd: loadusr metric_status
> > > halcmd: Traceback (most recent call last):
> > > File "/usr/local/bin/metric_status", line 16, in <module>
> > > GSTAT.connect("metric-mode-changed",mode_changed)
> > > TypeError: <GStat object at 0x76a9df80 (hal_glib+_GStat at
> > > 0xd09500)>: unknown signal name: metric-mode-changed
> > >
> > > halcmd: show pin
> > > Component Pins:
> > > Owner Type Dir Value Name
> > >
> > > halcmd:
> > >
> > > Something didn't work, but me python dummy.
> > >
> > > I thought I was following directions from the link?
> > >
> > > Thanks Chris.
> > >
> > > Cheers, Gene Heskett
> > > -
> > >
> > >
> > > Probably not current enough then.
> > > looks like it was added march 21 or so.
> >
> > The pi is running jessie (raspbian version)
> >
> > > Use Kurts version (but i would set the rate at minimum 100ms
> > > instead of 50.
> >
> > That would be fast enough I believe. Thanks Chris.
> >
> > > Chris M
> > > ------------------------------------------------------------------
> > >---- -------- Check out the vibrant tech community on one of the
> > > world's most engaging tech sites, Slashdot.org!
> > > http://sdm.link/slashdot
> > > _______________________________________________
> > > Emc-developers mailing list
> > > Emc-***@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/emc-developers
> >
> > 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)
> > Genes Web page <http://geneslinuxbox.net:6309/gene>
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-developers mailing list
> > Emc-***@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Niemand Sonst
2017-04-17 09:09:47 UTC
Permalink
Raw Message
Am 15.04.2017 um 16:03 schrieb Gene Heskett:
> Greetings everybody;
>
> I think I asked about this once before, but do not recall getting an
> answer I could use, so asking again.
>
> My jog wheel code currently has no way to switch between inches and mm's,
> either for the motion stepsize, or for the displayed step size. So I
> need a pair of pins exposed that tally the G20-G21 status, to be used as
> a step size modifier, and a pin from the view mode tallying whether the
> backplot dro is in mm's or inches.
>
> I would use the G20-21 tally to change the step size to mm's, and the
> view tally to change the size of step display.
>
> If those pins can be exposed for my use, it would solve the last problem,
> that of needing to maintain 2 configs whose only difference would be a a
> pair of setp statements. That doesn't strike me as being a long term
> viable solution.
>
> Can this be done, or is it hidden in the #5xxx data and I've not found
> it?
>
> Cheers, Gene Heskett

Hallo Gene,


have you looked at the code of combi_dro.py?

I use a timer to update the information about coordinate systems and
used unints.

It should be easy to add a hal pin and convert that code to be a user comp.


Norbert
Gene Heskett
2017-04-17 15:04:02 UTC
Permalink
Raw Message
On Monday 17 April 2017 05:09:47 Niemand Sonst wrote:

> Am 15.04.2017 um 16:03 schrieb Gene Heskett:
> > Greetings everybody;
> >
> > I think I asked about this once before, but do not recall getting an
> > answer I could use, so asking again.
> >
> > My jog wheel code currently has no way to switch between inches and
> > mm's, either for the motion stepsize, or for the displayed step
> > size. So I need a pair of pins exposed that tally the G20-G21
> > status, to be used as a step size modifier, and a pin from the view
> > mode tallying whether the backplot dro is in mm's or inches.
> >
> > I would use the G20-21 tally to change the step size to mm's, and
> > the view tally to change the size of step display.
> >
> > If those pins can be exposed for my use, it would solve the last
> > problem, that of needing to maintain 2 configs whose only difference
> > would be a a pair of setp statements. That doesn't strike me as
> > being a long term viable solution.
> >
> > Can this be done, or is it hidden in the #5xxx data and I've not
> > found it?
> >
> > Cheers, Gene Heskett
>
> Hallo Gene,
>
>
> have you looked at the code of combi_dro.py?
>
Not till now. And it generates a nice 4 axis dro on the r-pi. But 500+
loc when all I need are two halpins supplying a true/false? I don't need
the display, just the status. And there's no one on this list,
including me that thinks I am a python guru.

> I use a timer to update the information about coordinate systems and
> used unints.
>
> It should be easy to add a hal pin and convert that code to be a user
> comp.

Stripped of the gui stuff, slimmed down to just the X & Z queries, with 2
output halpins, it may be something I could add to the jog-thread,
currently running at 100hz. But I doubt if I am the one to do it.

> Norbert
>
>
> ----------------------------------------------------------------------
>-------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-developers mailing list
> Emc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


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)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Loading...