[Home]Mword

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

This page is for examples of using M words.

1. M66 Digital Input Control

Example Code
(your code here)
M66 P0 L3 Q10
o100 if [#5399 EQ -1]
    (MSG, Arc Timeout)
    G0 Z0.5
    X0 Y0
    M2 (stop processing here)
o100
(processing continues here if variable 5399 is not equal to minus 1)
right, you need another M65 to write the command
M66 is only for reading
M66 will get the current value
it works like this: interp starts reading a new program, and sending commands to task 
which starts executing them (actually sending them to motion and io)
after a while interp will be quite far ahead than the current execution..
when interp finds an M66 it stops interpreting the program, and waits for the execution to reach M66
once it reached, the M66 command is sent to task, which sends it to motion, etc
and you'll get the "current" value of the HAL pin

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited November 17, 2008 10:17 am by BigJohnT (diff)
Search:
Published under a Creative Commons License