Page 2 of 3

Re: custom macro help

Posted: Wed Jun 13, 2018 10:16 pm
by martyscncgarage
antpdrake wrote: Wed Jun 13, 2018 6:55 pm so i change the wizard to "NC" and now diagnostic input 8 light goes green when tripping the switch but Z is not stopping when it trips in the program..

any more ideas?? :idea: :oops:
Can you try this:
M106 /Z P50008 F300 ;Move to Z+ until input 8 CLOSES
M105 /Z P-50008 F50 ;Move to Z- until input 8 OPENS
M26 /Z ;Set Z0

I tested it on my mill for you and it worked for me.

Marty

Re: custom macro help

Posted: Thu Jun 14, 2018 9:09 am
by Centroid_Tech
The logic that I have written works as I just tested it. The only difference is that I did not have the # symbol when defining the input after the P designator.

Re: custom macro help

Posted: Thu Jun 14, 2018 10:31 am
by martyscncgarage
antpdrake wrote: Wed Jun 13, 2018 6:55 pm so i change the wizard to "NC" and now diagnostic input 8 light goes green when tripping the switch but Z is not stopping when it trips in the program..

any more ideas?? :idea: :oops:
My macro example shows and was tested using a normally open switch
You say you are using a normally closed switch. So Centroid_Tech's macro should work for you.

Its important to know which kind of switch you have. If you have a normally closed switch and you have the input setup in the Wizard for NC, then your diagnostic LED for that input should be GREEN not tripped. Then red when tripped.

Do let us know which works for you. You might slow the feed rates way down for testing, and manually trip the switch with a stick or something.
Marty

Re: custom macro help

Posted: Fri Jun 15, 2018 10:38 pm
by antpdrake
ok guys thats working! thanks!

my next issue is :lol: that i have the plasma switch connected to oc4 (spin forward) and the com connection next to it but that circuit seems to be on or closed constantly meaning the plasma is on all the time.. (im talking with no programs running just with machine sitting idle)

is there a way to change this or should i have it connected differently, (on leadshine connections)

cheers

Re: custom macro help

Posted: Fri Jun 15, 2018 10:47 pm
by martyscncgarage
Firstly, explain what you did to fix your macro.
Secondly did you look at the diagnostic screen and is output 4 green or red?
Outputs are the second line right under the inputs.

Did you program or leave output 4 to spin fwd in the Wizard?
Are there any other selections in the Wizard output drop down like torch on? (I'm away from home so I can't check)

Marty

Re: custom macro help

Posted: Sun Jun 17, 2018 10:38 pm
by antpdrake
i used your code Marty in my macro and it worked and changed the input to normally open. (it is a NO switch)

so in the wizard output 4 is set to spin fwd, no options for torch on.

output 4 light in diagnostics is red at idle

im using m3 in the code file to turn the torch on

cheers

Re: custom macro help

Posted: Mon Jun 18, 2018 12:10 am
by martyscncgarage
Thank you for brining closure to this one.
Have to give credit to Scott Pratt for helping me with a similar macro. Glad Mario and I could get you headed in the right direction.
Do post a picture or video of your machine running when you can.
Marty

Re: custom macro help (Resolved)

Posted: Mon Jun 18, 2018 1:07 am
by antpdrake
yeah no worries will do,

any ideas on the next part making output 4 normally open?

Re: custom macro help (Resolved)

Posted: Mon Jun 18, 2018 9:21 am
by martyscncgarage
antpdrake wrote: Mon Jun 18, 2018 1:07 am yeah no worries will do,

any ideas on the next part making output 4 normally open?
My mistake, there is no option for torch on in the Wizard. Seems as though M3 (SpinFWD) is correct.

Your question is a little vague. BUT what you might need to do is add NPN relay to that output with dry contacts. Then use the dry contact to control your what you need. It is important to note that the outputs SINK or take the signal to ground. In otherwords, take the 24VDC relay FEED it +24VDC, then the other side of the relay (-) connect to the desired Acorn output.
I like these:
6 Channel 24VDC Relay Board PLC DIN Rail Mounting NPN http://r.ebay.com/wC5iTf
6Ch 24VDC NPN relay.jpg
Here is a video I did on the board.
https://youtu.be/tc8MYGzEFAY

Re: custom macro help (Resolved)

Posted: Mon Jun 18, 2018 6:51 pm
by antpdrake
all good thanks for that!

just put a relay in running off output 4 like you say,
the plasma must be too sensitive or something and there was enough connection there to make it fire up...

thanks for all your help!