Script bash
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
14 Nov 2014 05:35 #53073
by grzesiekzxr
Script bash was created by grzesiekzxr
Hi All
I'm trying with INI FILTER. and need to have a reaction when some pin becomes true.
My script
#!/bin/bash
halcmd getp parport.0.pin-01-in
#halcmd gets signal_button
if [ $? eq 1 ]
float=$1
int=${float/\.*}
cat $1 |sed 's/x\([ ]*\)\([-0-9\.]*\)/x[-1*[\2]]/g'
then
exit 0
Don't work for me .
Any ideas?
I'm trying with INI FILTER. and need to have a reaction when some pin becomes true.
My script
#!/bin/bash
halcmd getp parport.0.pin-01-in
#halcmd gets signal_button
if [ $? eq 1 ]
float=$1
int=${float/\.*}
cat $1 |sed 's/x\([ ]*\)\([-0-9\.]*\)/x[-1*[\2]]/g'
then
exit 0
Don't work for me .
Any ideas?
Please Log in or Create an account to join the conversation.
15 Nov 2014 00:59 #53090
by ArcEye
Replied by ArcEye on topic Script bash
Hi
Afraid can't see the connection between the INI section [FILTER], which is largely for programs converting some other form of input into gcode and testing a pin value.
The easiest way to test a pin is inside HAL, rather than in a bash script.
Do you just want to display something or are you wanting to use the value?
It looks like your script is being called as M1XX Pnn , so the value is already known
If the signal is true, I think the idea is to display a positive integer representation of the number in Pnn
However you are converting Pnn to an integer and then using the original float value anyway, so not quite sure what you are trying to do.
Outline exactly what you are trying to achieve and I am sure we can either suggest how to get your method to work, or suggest a better way
regards
Afraid can't see the connection between the INI section [FILTER], which is largely for programs converting some other form of input into gcode and testing a pin value.
The easiest way to test a pin is inside HAL, rather than in a bash script.
Do you just want to display something or are you wanting to use the value?
It looks like your script is being called as M1XX Pnn , so the value is already known
If the signal is true, I think the idea is to display a positive integer representation of the number in Pnn
However you are converting Pnn to an integer and then using the original float value anyway, so not quite sure what you are trying to do.
Outline exactly what you are trying to achieve and I am sure we can either suggest how to get your method to work, or suggest a better way
regards
Please Log in or Create an account to join the conversation.
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
15 Nov 2014 05:01 #53096
by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Thanks for response.
I will try to explaine.
When I put single string :
cat $1 |sed 's/x\([ ]*\)\([-0-9\.]*\)/x[-1*[\2]]/g'
I have a symetry but it should have a place when I turn on the button on the right side my maschine.
Aditionaly changing orgin ,and some owords
next step schould be Axis refresch/reload.
When I press button on the left side should nothing happen.
I hoppe now it's clear what I want to achieve.
Regards
I will try to explaine.
When I put single string :
cat $1 |sed 's/x\([ ]*\)\([-0-9\.]*\)/x[-1*[\2]]/g'
I have a symetry but it should have a place when I turn on the button on the right side my maschine.
Aditionaly changing orgin ,and some owords
next step schould be Axis refresch/reload.
When I press button on the left side should nothing happen.
I hoppe now it's clear what I want to achieve.
Regards
Please Log in or Create an account to join the conversation.
20 Nov 2014 00:49 #53215
by andypugh
Err, no. Not even slightly clear.
Without reference to bash scripts and detailed implementation, what do you want to happen, and when?
Replied by andypugh on topic Script bash
I hoppe now it's clear what I want to achieve.
Regards
Err, no. Not even slightly clear.
Without reference to bash scripts and detailed implementation, what do you want to happen, and when?
Please Log in or Create an account to join the conversation.
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
20 Nov 2014 03:40 #53219
by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Hallo ,English it's not my native language ,so maybe some description aren't like I want.
The main idea is to use section Filter in INI to have symetry.
MY machine BIESSE 346ATC have big table 3500 X 1350 and I can put material ones on the left side and then on the right.
To start proces (g-code) I put real button left or right.
When press left button should nohing happen ,when right FILTER should work.
Thanks for response
Regards
The main idea is to use section Filter in INI to have symetry.
MY machine BIESSE 346ATC have big table 3500 X 1350 and I can put material ones on the left side and then on the right.
To start proces (g-code) I put real button left or right.
When press left button should nohing happen ,when right FILTER should work.
Thanks for response
Regards
Please Log in or Create an account to join the conversation.
20 Nov 2014 03:44 #53220
by andypugh
Do you want to make one normal part then the mirrored part, or is the idea to load one part while another is being made on the same table?
If the parts to be made are identical then don't use FILTER, just set up an MDI_COMMAND for each button that switches between G54 and G55 coordinate systems.
Replied by andypugh on topic Script bash
The main idea is to use section Filter in INI to have symetry.
MY machine BIESSE 346ATC have big table 3500 X 1350 and I can put material ones on the left side and then on the right.
To start proces (g-code) I put real button left or right.
When press left button should nohing happen ,when right FILTER should work.
Do you want to make one normal part then the mirrored part, or is the idea to load one part while another is being made on the same table?
If the parts to be made are identical then don't use FILTER, just set up an MDI_COMMAND for each button that switches between G54 and G55 coordinate systems.
Please Log in or Create an account to join the conversation.
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
20 Nov 2014 04:14 #53222
by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
The part many times are diferent .
"Is the idea to load one part while another is being made on the same table?"
Yes
Before changing control I used it possibility realy often.
Do you think that Filter is wrong way?
Thanks.
"Is the idea to load one part while another is being made on the same table?"
Yes
Before changing control I used it possibility realy often.
Do you think that Filter is wrong way?
Thanks.
Please Log in or Create an account to join the conversation.
20 Nov 2014 04:20 #53223
by andypugh
Replied by andypugh on topic Script bash
[quote="grzesiekzxr" post=53222Do you think that Filter is wrong way? [/quote]
Yes, I think it makes more sense to run identical G-code in a different coordinate system than to change the G-code.
Yes, I think it makes more sense to run identical G-code in a different coordinate system than to change the G-code.
Please Log in or Create an account to join the conversation.
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
20 Nov 2014 04:41 #53224
by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
Ok I understend and agree with you.
Ones I need parts identical but next time I have to produce one piece right or left.
My machine have horizotal drills and it schould by change acording to location component{material).
Thanks.
Ones I need parts identical but next time I have to produce one piece right or left.
My machine have horizotal drills and it schould by change acording to location component{material).
Thanks.
![:unsure: :unsure:](/media/kunena/emoticons/unsure.png)
Please Log in or Create an account to join the conversation.
- grzesiekzxr
- Offline
- Senior Member
-
Less
More
- Posts: 75
- Thank you received: 0
20 Nov 2014 05:40 #53226
by grzesiekzxr
Replied by grzesiekzxr on topic Script bash
"Yes, I think it makes more sense to run identical G-code in a different coordinate system than to change the G-code."
My main production is creating kitchen cabinet but not series only one set.
Therfore writing one g-code and use Filter to create mirror part it's for me big facilitation and prevents mistakes.
Now I use MDI COMMAND to some simple things ,but I don't know nothing about existence chance to change words inside g-code using MDI COMMANDS.
Bash gives my ability to find and replace some words/sign,of course Python too.
I'm learning all time but knowledge is like bottomless pit![:) :)](/media/kunena/emoticons/smile.png)
Ofcourse I'm realy happy that now I have LINUXCNC instead of old CNI control.
I belive that exist solution to have (symetry/mirroror something like this)
Thanks.
Regars.
My main production is creating kitchen cabinet but not series only one set.
Therfore writing one g-code and use Filter to create mirror part it's for me big facilitation and prevents mistakes.
Now I use MDI COMMAND to some simple things ,but I don't know nothing about existence chance to change words inside g-code using MDI COMMANDS.
Bash gives my ability to find and replace some words/sign,of course Python too.
I'm learning all time but knowledge is like bottomless pit
![:) :)](/media/kunena/emoticons/smile.png)
Ofcourse I'm realy happy that now I have LINUXCNC instead of old CNI control.
I belive that exist solution to have (symetry/mirroror something like this)
Thanks.
Regars.
Please Log in or Create an account to join the conversation.
Time to create page: 0.229 seconds