- Posts: 1004
- Thank you received: 449
Bash M1## how to use the P word
- my1987toyota
- Offline
- Platinum Member
-
Less
More
5 years 1 month ago #220527
by my1987toyota
Replied by my1987toyota on topic Bash M1## how to use the P word
Would you mind giving more context on what your code does?eg. for case 100 i was successful with
Code:case $1 in 100.000000)
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 542
- Thank you received: 241
5 years 1 month ago #220554
by MaHa
Replied by MaHa on topic Bash M1## how to use the P word
It's from the timestamp for logfiles, still in use.
When M150 P100 is called, somehow the case statement is matching only, when testing 100 as 100.000000
forum.linuxcnc.org/20-g-code/36148-times...ogfile-solved#128037
When M150 P100 is called, somehow the case statement is matching only, when testing 100 as 100.000000
forum.linuxcnc.org/20-g-code/36148-times...ogfile-solved#128037
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
- anfänger
- Offline
- Platinum Member
-
Less
More
- Posts: 647
- Thank you received: 267
5 years 1 month ago - 5 years 1 month ago #220557
by anfänger
Replied by anfänger on topic Bash M1## how to use the P word
There was a change in LinuxCNC a while ago, i think all the former integers are now float. To change this you need to work with float in bash or convert. You can do this in the Goode or in bash.
Last edit: 5 years 1 month ago by anfänger.
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
- my1987toyota
- Offline
- Platinum Member
-
Less
More
- Posts: 1004
- Thank you received: 449
5 years 1 month ago #220569
by my1987toyota
Replied by my1987toyota on topic Bash M1## how to use the P word
Thanks guys. When I get a chance I will give that a shot.
Please Log in or Create an account to join the conversation.
- my1987toyota
- Offline
- Platinum Member
-
Less
More
- Posts: 1004
- Thank you received: 449
5 years 1 month ago #220571
by my1987toyota
Replied by my1987toyota on topic Bash M1## how to use the P word
That unfortunately didn't work. I have a feeling I have misunderstood how the M1## bash system works.
if I enter this M170 in linuxcnc it works
#!/bin/bash
halcmd setp classicladder.0.in-50 true
exit 0 ;
however this M170 P01 code doesn't
#!/bin/bash
case $1 in
01)
halcmd setp classicladder.0.in-50 true
;;
esac
exit 0 ;
their must be alot of things going on behind the scenes in linuxcnc that I can't
see, know about, or probably don't understand.
I do have a theory that I may need to come up with a hal component to make
use of the P## as a varriable and the hal component determines what pins
to switch high or low instead of it happening in the M170 bash command.
if I enter this M170 in linuxcnc it works
#!/bin/bash
halcmd setp classicladder.0.in-50 true
exit 0 ;
however this M170 P01 code doesn't
#!/bin/bash
case $1 in
01)
halcmd setp classicladder.0.in-50 true
;;
esac
exit 0 ;
their must be alot of things going on behind the scenes in linuxcnc that I can't
see, know about, or probably don't understand.
I do have a theory that I may need to come up with a hal component to make
use of the P## as a varriable and the hal component determines what pins
to switch high or low instead of it happening in the M170 bash command.
Please Log in or Create an account to join the conversation.
- anfänger
- Offline
- Platinum Member
-
Less
More
- Posts: 647
- Thank you received: 267
5 years 1 month ago - 5 years 1 month ago #220574
by anfänger
Replied by anfänger on topic Bash M1## how to use the P word
Run LinuxCNC from command line
And change the script to:
however this M170 P01 code doesn't
#!/bin/bash
echo „P:“
echo $1
case $1 in
01)
echo „case true“
halcmd setp classicladder.0.in-50 true ;;
esac
exit 0
There you should see what the P value is
And change the script to:
however this M170 P01 code doesn't
#!/bin/bash
echo „P:“
echo $1
case $1 in
01)
echo „case true“
halcmd setp classicladder.0.in-50 true ;;
esac
exit 0
There you should see what the P value is
Last edit: 5 years 1 month ago by anfänger.
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
Time to create page: 0.180 seconds