Script bash

More
11 Dec 2014 23:29 #53929 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
...sory I don't fully understand ,could you write it for me :blush: ?
regards,

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

More
12 Dec 2014 00:32 #53932 by ArcEye
Replied by ArcEye on topic Script bash

...sory I don't fully understand ,could you write it for me :blush: ?
regards,



#!/bin/bash

echo "M102 called"

cd /path-to/directory/for/ngc-files

rename 's/\.ngc/\.inv/' *.ngc
axis-remote --clear;
axis-remote --mdi 'G55#5381 = -1' ;
axis-remote --reload &
exit 0
The following user(s) said Thank You: eFalegname

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

More
12 Dec 2014 01:24 #53933 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Now check but I still have an error:
/home/grzegorz/realtime/master/bin/invertx: 16: [0: not found
I will try it more carefully and I will report.
Thanks
regads,

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

More
14 Dec 2014 02:12 #53995 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hallo'
Currently I have a problem with FILTER My filter file is:

#!/bin/sh
cat $1 |sed 's/x\([ ]*\)\([-0-9\.]*\)/x[-1*[\2]]/g'

exit 0
Firstly it was working but now I something messed up and have an error:

emc/task/emctask.cc 374: interp_error: File ended with no percent sign
File ended with no percent sign
nie można otworzyć /tmp/tmphaTRb3/test.inv
emc/task/emctask.cc 374: interp_error: File ended with no percent sign
File ended with no percent sign
nie można otworzyć /tmp/tmphaTRb3/test.inv


As You suggested corrected file M101;M102 and I have:

#!/bin/bash

echo "M101 called"
cd /home/grzegorz/linuxcnc/nc_files
rename 's/\.inv/\.ngc/' *.inv
axis-remote --clear;
axis-remote --mdi 'G54 #5381 = 1' ;
axis-remote --reload &
exit 0

#!/bin/bash

echo "M102 called"


cd /home/grzegorz/linuxcnc/nc_files
rename 's/\.ngc/\.inv/' *.ngc
axis-remote --clear;
axis-remote --mdi 'G55#5381 = -1' ;
axis-remote --reload &
exit 0

I wonder if it's posible to change extension only for file actualy loaded to AXIS not all in pointed directories ?

Commend CD and RENAME working ,what I see inside my nc_file but only if I click on alternating,If I click left button and then again left button or right and again right, ther is an error.

Sorry I can't completly check it becouse my FILTER not work I don' know where I make mistake?

Thank You ,
regards.

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

More
14 Dec 2014 03:39 #53996 by ArcEye
Replied by ArcEye on topic Script bash

emc/task/emctask.cc 374: interp_error: File ended with no percent sign
File ended with no percent sign


This is from the interpreter, you either do not have a terminating M2 or M30 or no % top and bottom, in your gcode file

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

More
14 Dec 2014 21:02 #54000 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hallo,
I was trying many ways.
Example file:
g17 g21
f2000
g1 x3 y4
m2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%
g17 g21
f2000
g1 x3 y4
m2
%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
g17 g21
f2000
g1 x3 y4
m30

What is the right place to put script file for FILTER (invertx) ?
Thank You
regards.

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

More
14 Dec 2014 21:20 #54001 by BigJohnT
Replied by BigJohnT on topic Script bash
Please review the G code file requirements for LinuxCNC

linuxcnc.org/docs/html/gcode/overview.html#_file_requirements

And the Program End if used in instead of the wrapping % signs.

linuxcnc.org/docs/html/gcode/m-code.html#sec:M2-M30

You do not need both and should understand the difference between them.

JT

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

More
15 Dec 2014 02:16 - 15 Dec 2014 03:17 #54004 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Thank You BigJohnT for reply.
Just trying it on another computer and FILTER working,no mater if % sign is together with M2 or not .
But if I look inside LINUXCNC_PRINT.TXT I see RUN_IN_PLACE=yes :huh:
I supose that is the problem ?
Probably transfering file INVERTX to /bin or download some file I'm not sure .

Now I have to recompile $ cd ~/emc2/src ?
Please let me know what do you think?
thanks
regards
Last edit: 15 Dec 2014 03:17 by grzesiekzxr.

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

More
15 Dec 2014 03:50 #54007 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
........to have actual linux-print.txt I just demaged INI file (comented HALUI) and here is content:
RUN_IN_PLACE=yes
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/home/grzegorz/realtime/master/bin
LINUXCNC_TCL_DIR=/home/grzegorz/realtime/master/tcl
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/home/grzegorz/realtime/master/rtlib
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/home/grzegorz/realtime/master/src/objects
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.5
INIFILE=/home/grzegorz/linuxcnc/configs/biesse-346_ATC/machine.ini
PARAMETER_FILE=machine.var
TASK=milltask
HALUI=halui
DISPLAY=axis
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Starting TASK program: milltask
Starting DISPLAY program: axis
Killing task linuxcncsvr, PID=6675
Killing task milltask, PID=6758
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
linuxcnc_debud:
Can not find -sec MOT -var MOT -num 1
Can not find -sec IO -var IO -num 1
Can not find -sec LINUXCNC -var NML_FILE -num 1
Can not find -sec EMC -var NML_FILE -num 1
Can not find -sec DISPLAY -var INTRO_GRAPHIC -num 1
Can not find -sec DISPLAY -var INTRO_TIME -num 1
6675
PID TTY STAT TIME COMMAND
6758
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

RUN_IN_PLACE=yes
I did not check this before but I think should be RUN_IN_PLACE=no
Tell me please What exactly should Type in terminal to change (repair) it corectly?

Lack of knowledge costing me a lot of problems :lol:
regards

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

More
15 Dec 2014 17:11 #54014 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hallo,
Do You think that problem with executing FILTER file is because RUN_IN_PLACE=yes ?
On second computer FILTER working and there is RUN_IN_PLACE=NO,no mater if INI file is good or broke.
I was testing example file on comp where FILTER work:

%
g17 g21
f2000
g1 x3 y4
m2
above working there isn't any error
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

%
g17 g21
f2000
g1 x3 y4
m2
%
above working there isn't any error
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%
g17 g21
f2000
g1 x3 y4
%
above working there isn't any error
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%
g17 g21
f2000
g1 x3 y4

above NOT working there is error => but not the same like in first machine only :BAD CHARACTER USED '%'

Error IN first machine is :

emc/task/emctask.cc 374: interp_error: File ended with no percent sign
File ended with no percent sign

What else could cause this problem?
Thanks,
regards.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum