Script bash

More
06 Dec 2014 01:16 #53723 by ArcEye
Replied by ArcEye on topic Script bash
HI

Need to know exactly what your sequence is

The screenshot below shows result when I set param #100 to 555 in MDI and then run a program that includes a test of the value, it is still 555.
So the parameter is persistent between MDI and Auto.

regards


Attachments:
The following user(s) said Thank You: grzesiekzxr

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

More
06 Dec 2014 03:23 - 06 Dec 2014 03:26 #53735 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hi
When I put in MDI #100=555
next write (debug,#100) and have info 555



Next run file like:



if parameter #100 is active have a square



if parameter #100 is not active have a straight line in Y axis



I have info about value parameter only by debug inside MDI or presing conected button .
I don't run program only watching previev Axis

''So the parameter is persistent between MDI and Auto.''
Is it posible to check it in different way?
What can by responsible for persistent parameter?

regards.
Attachments:
Last edit: 06 Dec 2014 03:26 by grzesiekzxr.

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

More
06 Dec 2014 03:45 #53737 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hi ,
good news just run file machine travel by square so it's working :woohoo: ,
on the screen i see only straight line but physically work at first sight.
Sorry for the confusion,preview introduced me to the error.
I don't run physically evry program ,becouse my machine need preasure and compressor not always is on.
Will check more carefully and let you know
Many thanks
regards

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

More
06 Dec 2014 04:53 #53740 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Yes it's working :laugh:
What I observed when I moved trajectory from X0 to X300 preview appeared ,
I 'm not sure why earlier preview display only straight line but supose that becouse trajectory was behind limits.
Now I know that always I should run physically g-code/file.
Actual I 'm trying to add M101 to the sub.

o<right> sub
g10l2p2x[314.6+500]y-199 z47
g55
#100=-1
(debug,#100)
g4p0.001
M101
g4p0.001
o<right> endsub


#!/bin/bash

echo "M101 called"

axis-remote &
;axis-remote
exit 0

Macro have permision but not refresch axis ,what is the proper way ?
Great thanks,
regards.

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

More
06 Dec 2014 05:20 #53743 by andypugh
Replied by andypugh on topic Script bash

Hi ,
good news just run file machine travel by square so it's working :woohoo: ,
on the screen i see only straight line but physically work at first sight.


Oh! Of course :-)

When you load the program you haven't set the variable.

Does "reload" update to the correct preview?

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

More
06 Dec 2014 05:22 #53744 by andypugh
Replied by andypugh on topic Script bash

Y
echo "M101 called"

axis-remote &
;axis-remote
exit 0

Macro have permision but not refresch axis ,


axis-remote --reload ?

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

More
06 Dec 2014 16:45 #53757 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hi
'''axis-remote --reload ? ''
Oh I was thinking that the same so order like this is ok?

axis-reload

regards

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

More
06 Dec 2014 17:16 #53758 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
ok now I see :)
#!/bin/bash

echo "M101 called"


axis-remote --reload

exit 0
working ,but manual mode.
What I schould add to have it working in manual and auto mode.
regards

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

More
06 Dec 2014 17:39 - 06 Dec 2014 17:53 #53760 by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
now I see solution other user:

#!/bin/bash
halcmd sets halcmd_setHaluiModeManual TRUE
sleep 0.4
halcmd sets halcmd_setHaluiModeManual FALSE
exit 0

In sub:
o<left> sub
g10l2p1x313y-200.5 z47
g54
#100=1
(debug,#100)
g4p0.001
M190
g4p0.001
M101
g4p0.001
o<left> endsub

But in terminal have an error

<commandline>:0: signal 'halcmd_setHaluiModeManual' not found
<commandline>:0: signal 'halcmd_setHaluiModeManual' not found
M101 called
I will try with only one line:

halcmd sets halcmd_setHaluiModeManual TRUE
sleep 0.4
With line like above it's working-I see proper changing in both modes, but only mode MDI without error.

<commandline>:0: signal 'halcmd_setHaluiModeManual' not found
M101 called
nie można wykonać (EMC_TASK_PLAN_OPEN) w trybie manualnym


regards
Last edit: 06 Dec 2014 17:53 by grzesiekzxr.

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

More
06 Dec 2014 20:52 - 06 Dec 2014 22:32 #53765 by ArcEye
Replied by ArcEye on topic Script bash
Hi

I don't know where you got the code from, but it is useless unless you have created a signal called halcmd_setHaluiModeManual and linked it up properly.

All you need to do to change mode is use the halui pins
www.linuxcnc.org/docs/devel/html/gui/halui.html

eg

halui.mode.manual (bit, in) - pin for requesting manual mode
halui.mode.mdi (bit, in) - pin for requesting mdi mode


However you cannot do this in Auto mode, ie when a program is running, so it is no use for a M1XX routine to be called in the middle of a program.

I have kind of lost the plot with what you are trying to do now.

You have 2 buttons, one assigns #100 = 1 and the other assigns #100 = -1, using a MDI command through halui?

Your gcode uses #100 as a multiplication factor for X values, so that it either produces a positive or negative image?

If your program is already loaded, you need a reload to get the plot to match the code when you change the value of #100?

You should be able to simply link the buttons to M1XX scripts called through halui.mdi-command-XX

In that script something like

axis-remote --mdi '#100 = -1' ;
axis-remote --reload &


should do what you want,
The semi-colon after the first line forces a wait for return from that call before the second call.
The ampersand after the second call just spawns it as a separate process allowing immediate return.

regards
Last edit: 06 Dec 2014 22:32 by ArcEye.
The following user(s) said Thank You: grzesiekzxr

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

Time to create page: 0.298 seconds
Powered by Kunena Forum