Re: [Emc-users] M101 - M199 problem
Because of this I also tried a bash script that called the C program and got the same result (no response). Both work from the command line. I get no errors from EMC2. I have entered a echo command in the bash script that is shown when I run it from the command prompt. When run from EMC2 should it appear in a terminal window? Hi I think you are heading down the classic ladder path to achieve your overall end, but I don't recall seeing your having solved the initial problem of executing scripts etc from a M1XX command. I had some problems getting hal commands to run within a bash script called from M1xx, a while ago. First off, unless your controller computer is permanently connected to the internet, (why would you, hardly going to improve latency) just log in as, install as and run everything as root. Sorts out all the problems with permissions, ownership etc. The 'middle-man will get you' paranoids will argue against it, but for a stand alone computer, I really do not see the problem. Obviously ensure that M1xx file is in the path pointed to by PROGRAM_PREFIX in your .ini file If somehow you have 2 entries in your .ini file, EMC only reads the first one. Wonder how I found that out! If you launch EMC as child process within a terminal (ie without the trailing ) you will get stderr etc from emc and any processes launched from within it, eg bash or your C program. It was seeing this and using debug outputs, that enabled me to discover that EMC reads M101 P3 and then passes 3.00 instead of just 3, to my M101 script! As an example the below M101 script uses calls to halcmd to adjust the scale and stepgen associated with my spindle, to account for pulley changes. regards Schooner /#!/bin/bash ## sets scale gain to make output speed accurate ## for each of 4 pulley settings if [ ! $# == 1 ]; then echo Usage: M101 n - where n is speed range 1 - 4 exit 1 fi ## emc takes the M101 P3 for example and passes 3.00 ## to this script!!! ## need to convert first float=$1 int=${float/\.*} # DEBUGecho $float converted to $int case $int in 1 ) halcmd setp scale.0.gain 0.8 halcmd setp stepgen.4.maxvel 2400;; 2 ) halcmd setp scale.0.gain 1.24 halcmd setp stepgen.4.maxvel 1200;; 3 ) halcmd setp scale.0.gain 3.55 halcmd setp stepgen.4.maxvel 600;; 4 ) halcmd setp scale.0.gain 6 halcmd setp stepgen.4.maxvel 300;; esac exit 0/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] M101 - M199 problem
I would like to respectfully disagree. I do not see why one needs to run as root just to solve basic permissions or path issues. And I also do not see why being on the internet is going to ruin latency. Additionally, being on the internet would enable one to get system updates. i On Tue, Oct 5, 2010 at 11:11 AM, Schooner schoone...@tiscali.co.uk wrote: Because of this I also tried a bash script that called the C program and got the same result (no response). Both work from the command line. I get no errors from EMC2. I have entered a echo command in the bash script that is shown when I run it from the command prompt. When run from EMC2 should it appear in a terminal window? Hi I think you are heading down the classic ladder path to achieve your overall end, but I don't recall seeing your having solved the initial problem of executing scripts etc from a M1XX command. I had some problems getting hal commands to run within a bash script called from M1xx, a while ago. First off, unless your controller computer is permanently connected to the internet, (why would you, hardly going to improve latency) just log in as, install as and run everything as root. Sorts out all the problems with permissions, ownership etc. The 'middle-man will get you' paranoids will argue against it, but for a stand alone computer, I really do not see the problem. Obviously ensure that M1xx file is in the path pointed to by PROGRAM_PREFIX in your .ini file If somehow you have 2 entries in your .ini file, EMC only reads the first one. Wonder how I found that out! If you launch EMC as child process within a terminal (ie without the trailing ) you will get stderr etc from emc and any processes launched from within it, eg bash or your C program. It was seeing this and using debug outputs, that enabled me to discover that EMC reads M101 P3 and then passes 3.00 instead of just 3, to my M101 script! As an example the below M101 script uses calls to halcmd to adjust the scale and stepgen associated with my spindle, to account for pulley changes. regards Schooner /#!/bin/bash ## sets scale gain to make output speed accurate ## for each of 4 pulley settings if [ ! $# == 1 ]; then echo Usage: M101 n - where n is speed range 1 - 4 exit 1 fi ## emc takes the M101 P3 for example and passes 3.00 ## to this script!!! ## need to convert first float=$1 int=${float/\.*} # DEBUG echo $float converted to $int case $int in 1 ) halcmd setp scale.0.gain 0.8 halcmd setp stepgen.4.maxvel 2400;; 2 ) halcmd setp scale.0.gain 1.24 halcmd setp stepgen.4.maxvel 1200;; 3 ) halcmd setp scale.0.gain 3.55 halcmd setp stepgen.4.maxvel 600;; 4 ) halcmd setp scale.0.gain 6 halcmd setp stepgen.4.maxvel 300;; esac exit 0/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] M101 - M199 problem
On Tuesday, October 05, 2010 12:38:54 pm Igor Chudov did opine: I would like to respectfully disagree. I do not see why one needs to run as root just to solve basic permissions or path issues. And I also do not see why being on the internet is going to ruin latency. Additionally, being on the internet would enable one to get system updates. I have to agree with Igor here. Emc runs as well from a user account as it does from root, permissions problems are, with all due respect, usually caused by mucking about in the user account while root. We call that PEBKAC. AND the machine being on the internet has no apparent/detectable by me effect on latency. I have had konversation going and logging the emc channel, browsed the web (usually to the emc wiki pages for coding help) and or edited gcode, all while my machine was busy carving something. And its only an XP1400 runing at 1600 mhz, with half a gig of ram. i On Tue, Oct 5, 2010 at 11:11 AM, Schooner schoone...@tiscali.co.uk wrote: �Because of this I also tried a bash script �that called the C program and got the same result (no response). Both work �from the command line. �I get no errors from EMC2. �I have entered a echo command in the bash script that is shown when I run it �from the command prompt. When run from EMC2 should it appear in a terminal �window? Hi I think you are heading down the classic ladder path to achieve your overall end, but I don't recall seeing your having solved the initial problem of executing scripts etc from a M1XX command. I had some problems getting hal commands to run within a bash script called from M1xx, a while ago. First off, unless your controller computer is permanently connected to the internet, (why would you, hardly going to improve latency) �just log in as, install as and run everything as root. Sorts out all the problems with permissions, ownership etc. �The 'middle-man will get you' paranoids will argue against it, but for a stand alone computer, I really do not see the problem. Obviously ensure that M1xx file is in the path pointed to by PROGRAM_PREFIX in your .ini file If somehow you have 2 entries in your .ini file, EMC only reads the first one. Wonder how I found that out! If you launch EMC as child process within a terminal (ie without the trailing ) you will get stderr etc from emc and any processes launched from within it, eg bash or your C program. It was seeing this and using debug outputs, that enabled me to discover that EMC reads M101 P3 and then passes 3.00 instead of just 3, to my M101 script! As an example the below M101 script uses calls to halcmd to adjust the scale and stepgen associated with my spindle, to account for pulley changes. regards Schooner /#!/bin/bash ## sets scale gain to make output speed accurate ## for each of 4 pulley settings if [ ! $# == 1 ]; then � echo Usage: M101 n - where n is speed range 1 - 4 � exit 1 fi ## emc takes the M101 P3 for example and passes 3.00 ## to this script!!! ## need to convert first float=$1 int=${float/\.*} # DEBUG � �echo $float converted to $int case $int in � � 1 ) halcmd setp scale.0.gain 0.8 � � � � halcmd setp stepgen.4.maxvel 2400;; � � 2 ) halcmd setp scale.0.gain 1.24 � � � � halcmd setp stepgen.4.maxvel 1200;; � � 3 ) halcmd setp scale.0.gain 3.55 � � � � halcmd setp stepgen.4.maxvel 600;; � � 4 ) halcmd setp scale.0.gain 6 � � � � halcmd setp stepgen.4.maxvel 300;; esac exit 0/ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, �ECMAScript5, and DOM L2 L3. Spend less time writing and �rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) It takes a special kind of courage to face what we all have to face.
[Emc-users] M101 - M199 problem
Hello, I am having a problem getting a custom M101 to work. I building a custom tool changer and I am controlling it with an arduino board. I need to send a BCD signal over a spare parallel port. I have a C program that accomplishes this and I can make it work by running it from a terminal. I do however need to run it with sudo. Because of this I also tried a bash script that called the C program and got the same result (no response). Both work from the command line. I get no errors from EMC2. The spare port is not used by EMC2. It is actually the port on the mother board. My machine is running off a PCI parallel port card. The files are also in the appropriate directory. I have entered a echo command in the bash script that is shown when I run it from the command prompt. When run from EMC2 should it appear in a terminal window? I realize I could use classic ladder to accomplish this as well but I don't see why this is not working? Any help would be greatly appreciated. Thanks, Mike -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] M101 - M199 problem
Try this: go to your directory with all G code functions etc (program_prefix). Then: ( echo '#!/bin/bash' echo 'echo date /tmp/M156' ) M156 chmod 755 M156 then call M156 from EMC2 Then look at file /tmp/M156 On Sat, Oct 2, 2010 at 8:57 PM, Mike Cinquino mcinqu...@gmail.com wrote: Hello, I am having a problem getting a custom M101 to work. I building a custom tool changer and I am controlling it with an arduino board. I need to send a BCD signal over a spare parallel port. I have a C program that accomplishes this and I can make it work by running it from a terminal. I do however need to run it with sudo. Because of this I also tried a bash script that called the C program and got the same result (no response). Both work from the command line. I get no errors from EMC2. The spare port is not used by EMC2. It is actually the port on the mother board. My machine is running off a PCI parallel port card. The files are also in the appropriate directory. I have entered a echo command in the bash script that is shown when I run it from the command prompt. When run from EMC2 should it appear in a terminal window? I realize I could use classic ladder to accomplish this as well but I don't see why this is not working? Any help would be greatly appreciated. Thanks, Mike -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users