Hello Guest it is April 18, 2024, 08:55:08 PM

Author Topic: Macro for inputs and outputs  (Read 7937 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro for inputs and outputs
« Reply #10 on: February 06, 2016, 04:33:11 PM »
Repeats (;-) and YES it all works HERE including the M901 Mcode.

G0 G17 G40 G49 G80 G90
G91 (Set Inc Mode)
G0 X0 Y0
F600
M98 P001 L22 (Loop 22 times)
G0 X0 Y0
G90  ( Reset Abs Mode)
M30
%
o001
G1X5
M901 ( call driller, wait for signal)
M99
%

Offline Jim G

*
  •  22 22
    • View Profile
Re: Macro for inputs and outputs
« Reply #11 on: February 07, 2016, 10:50:17 AM »
On the overall movement thing - I do not have an encoder or dro....
But If I tell it to move 120" it moves 120" measured with a tape measure. In reality it probably moves a few thousands less. Seems like every step it loses just a bit and since we are doing a lot of steps it adds up .
The Macro works if I put in a sleep that is longer than the drill cycle and I do see that it is getting the input from the end of drill cycle..

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macro for inputs and outputs
« Reply #12 on: February 07, 2016, 11:03:00 AM »
Try this:

Code: [Select]
ActivateSignal(OUTPUT1)

while isActive(INPUT1)
  sleep 10
wend

while not isActive(INPUT1)
  sleep 10
wend

DeactivateSignal(OUTPUT1)

Offline Jim G

*
  •  22 22
    • View Profile
Re: Macro for inputs and outputs
« Reply #13 on: February 07, 2016, 11:15:50 AM »
Leave in the blank lines or not?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro for inputs and outputs
« Reply #14 on: February 07, 2016, 11:30:18 AM »
OK that tells me that the logic is not working IF the sleep is controlling the wait.

When your driller signals back that it is done does the led for input1 turn ON or turn OFF ?

In config for the input signal (inpout1) is it set for active high or active low. Can you show a picture of your setup in ports pins .

Also please post exactly what you have for teh M901 script. It works fine here when I test it.  We just need to get teh logic correct on your end.

(;-) TP
« Last Edit: February 07, 2016, 11:32:00 AM by BR549 »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macro for inputs and outputs
« Reply #15 on: February 07, 2016, 12:06:12 PM »
Blank lines are completely irrelevant.

Just copy it and try it

Offline Jim G

*
  •  22 22
    • View Profile
Re: Macro for inputs and outputs
« Reply #16 on: February 07, 2016, 03:47:54 PM »
Ok - been playing with it.
When I load your macro it doesn't wait for anything... just runs !

More info in a few minutes.

Offline Jim G

*
  •  22 22
    • View Profile
Re: Macro for inputs and outputs
« Reply #17 on: February 07, 2016, 04:14:08 PM »
so how do I attach pics n videos?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro for inputs and outputs
« Reply #18 on: February 07, 2016, 04:19:18 PM »
Push the reply button then select additional options. Then use browse to point to the file you want to upload. Double check the size of your pictures (;-) keep them small if you can.

Offline Jim G

*
  •  22 22
    • View Profile
Re: Macro for inputs and outputs
« Reply #19 on: February 07, 2016, 04:26:53 PM »
they are too big.. .mmmm gotta get them smaller.. give me a minute