Lathe Collet User Mcode

More
7 years 3 months ago #139898 by Erikcnc
Hi all,

After successfully add rpm displaying in Gmoccapy, i am continuing the build of my Emco Lathe machine.
I was away from honeymoon and now i got some time again to work on the lathe.

At the moment i am struggling to get it to work.

In the INI file i got
Code:
USER_M_PATH = (*specific map where my M-codes scripts are)

The executable files
--M101--
Code:
#!/bin/bash # opens the collet closer halcmd setp or2.1.in1 false sleep 0.5 exit 0

--M102--
Code:
#!/bin/bash # close the collet closer halcmd setp or2.1.in1 true sleep 0.5 exit 0

I even tried a m-code scripts like this for both
Code:
#!/bin/bash # close the collet closer halcmd sets user_m101m102code 0 sleep 0.5 exit 0

In my Hal File
Code:
# --- M101 and M102 signal --- loadrt or2 count=2 addf or2.1 servo-thread net collet-closer-pedal hm2_7i76e.0.7i76.0.0.input-16 => or2.1.in0 net user_m101m102code => or2.1.in1 net collet-open-close or2.1.out => hm2_7i76e.0.7i76.0.0.output-15

What am i doing wrong here?

Please Log in to join the conversation.

More
7 years 3 months ago #139904 by BigJohnT
Replied by BigJohnT on topic Lathe Collet User Mcode
We need to know what you expected, what you got and any exact error messages.

JT

Please Log in to join the conversation.

More
7 years 3 months ago #139912 by Erikcnc
Replied by Erikcnc on topic Lathe Collet User Mcode

BigJohnT wrote: We need to know what you expected, what you got and any exact error messages.

JT


I got no error message when executing the M-codes in MDI. While i am doing that, i watch output pin 15 in halshow.

So far, nothing is happening.

Please Log in to join the conversation.

More
7 years 3 months ago #139920 by BigJohnT
Replied by BigJohnT on topic Lathe Collet User Mcode
I just tested your M101 and M102 and they turn off and on or2.1.in1 and or2.1.out turns on and off as expected.

linuxcnc.org/docs/2.7/html/config/ini-co...ml#_rs274ngc_section

USER_M_PATH = myfuncs:/tmp/mcodes:experimentalmcodes - Specifies a list of colon (:) separated directories for user defined functions. Directories are specified relative to the current directory for the ini file or as absolute paths. The list must contain no intervening whitespace.

A search is made for each possible user defined function, typically (M100-M199). The search order is:
1. [DISPLAY]PROGRAM_PREFIX (if specified)
2. If [DISPLAY]PROGRAM_PREFIX is not specified, search the default location: nc_files
3. Then search each directory in the list [RS274NGC]USER_M_PATH

The first executable M1xx found in the search is used for each M1xx.

Do you have a M101 and M102 in the nc_files directory?

JT

Please Log in to join the conversation.

More
7 years 3 months ago #139924 by Erikcnc
Replied by Erikcnc on topic Lathe Collet User Mcode
In my ini file i got underneath [RS274NGC] the line USER_M_PATH with the direction to => /home/emco/linuxcnc/configs/EMCOTURN220/M-codes/

In the folder M-codes i got the two files that got the name M101 and M102.

Both are selected as executable file.

So why wouldn't hm2_7i76e.0.7i76.0.0.output-15 be triggerd? (in halshow it stays dark red)

Please Log in to join the conversation.

More
7 years 3 months ago #139931 by BigJohnT
Replied by BigJohnT on topic Lathe Collet User Mcode
I have to guess that net user_m101m102code => or2.1.in1 is blocking the setp or2.1.in1.

If you run LinuxCNC from a terminal you will see this error

<commandline>:0: pin 'or2.1.in1' is connected to a signal

When in doubt run from a terminal so you can see all the errors.

JT

Please Log in to join the conversation.

More
7 years 3 months ago #140079 by Erikcnc
Replied by Erikcnc on topic Lathe Collet User Mcode
Thanks!!

i am not sure what really cause the problem, but it works perfectly now!
I made the m code scripts again, but changed the True and False to a 1 and 0.
I will share my files soon for those who would like to use it for something similar.

Please Log in to join the conversation.

Time to create page: 4.142 seconds
Powered by Kunena Forum