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 <[email protected]> wrote: > On Monday 17 April 2017 19:34:02 Chris Morley wrote: > > > But I didn't get very far: > > > > pi@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 > > [email protected] > > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers >
units
Description: Binary data
------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
