M66

More
18 Jan 2014 02:03 #42931 by billykid
M66 was created by billykid
hi
I'm trying to use the M66 for the signal arcok a small plasma that I am building.
I'm using this: net arc_ok motion.digital-in-00 <= parport.0.pin11-in
with the line P0 L4 M66 Q5 is ok but after 5 seconds without signal movement begins the same.
I tried M66 P0 L0 but it never works, maybe you can use only the options L3 or L4?
thanks in advance
Mauro

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 05:17 - 18 Jan 2014 05:19 #42936 by Rick G
Replied by Rick G on topic M66
Hello,

You need to determine what it will do if there is no output, try something like...
M66 P0 L3 Q5 (wait up to 5 seconds for digital input 0 to turn on)
O105 IF [ #5399 ne 1]
M5
 (debug, No arc transfer)
   o106 return   
 O105 ENDIF

Otherwise it waits then after the waits continues the code.
The result of the M66 is the variable #5399.

Rick G
Last edit: 18 Jan 2014 05:19 by Rick G.

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 05:22 #42937 by andypugh
Replied by andypugh on topic M66

with the line P0 L4 M66 Q5 is ok but after 5 seconds without signal movement begins the same.

That is because you have a timeout of 5 seconds.

If you want to end the programme if the timeout happens then maybe this will work

P0 L4 M66 Q5
O100 IF [#5399 LT 0]
(MSG, Timeout!)
M2
O100 ENDIF

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 05:31 #42939 by billykid
Replied by billykid on topic M66
thanks Rick
I think I will leave it M66 P0 L4 Q20 for example .. time long enough to stop.
I tried it with a button and it works fine
regards
Mauro

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 05:35 #42940 by billykid
Replied by billykid on topic M66
Thanks Andy !
you convinced me to try
regards
Mauro

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 14:25 #42959 by Rick G
Replied by Rick G on topic M66
Glad you got it sorted out.

Rick G

Please Log in or Create an account to join the conversation.

More
18 Jan 2014 20:57 #42970 by Rick G
Replied by Rick G on topic M66
Andy,

Example g codes should be consistent with good g code practices.

For example...
linuxcnc.org/docs/html/gcode/m-code.html#sec:M66-Input-Control

M66 Example Lines

M66 P0 L3 Q5 (wait up to 5 seconds for digital input 0 to turn on)

Is a proper easy to read example.

P0 L4 M66 Q5

Certainly could be considered the slightest bit ambiguous, and possibly confuse the issue.

Rick G

Please Log in or Create an account to join the conversation.

More
19 Jan 2014 04:03 #42986 by billykid
Replied by billykid on topic M66
Thank you, your example works fine.
I just do not get it to work with a separate sub.
for example, "call o100" in the program gcode
then in the sub:

o100 sub
M66 P0 L3 Q5
if [# 5399 LT 0]
(MSG, fail)
endif
o100 EndSub

give error:
parameter name that starts with F unknown

Please Log in or Create an account to join the conversation.

More
19 Jan 2014 04:09 #42987 by andypugh
Replied by andypugh on topic M66
You need O-numbers for the IF too.
o100 sub
M66 P0 L3 Q5
O20 if [# 5399 LT 0]
(MSG, fail)
O20 endif
o100 EndSub
The following user(s) said Thank You: billykid

Please Log in or Create an account to join the conversation.

More
19 Jan 2014 04:34 #42991 by billykid
Replied by billykid on topic M66
All ok thanks !!

Please Log in or Create an account to join the conversation.

Time to create page: 0.112 seconds
Powered by Kunena Forum