592,217 active members*
5,401 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2022
    Posts
    6

    Edit M7 + M8 Scripts

    Hello,

    maybe someone can help me with my problem.

    I want to edit the M7 and M8 Scripts.

    When I push the button for Mist or Flood it should turn the Output once on and turn it after 1 sec off. My mist controller only accept momentary switches.

    e.g. M7 should turn on Output 8 for one second and turn it afterward off

    The Intervall option in the settings doesn't work, it allways turn on and off the Output

    best regards
    Patrick

  2. #2
    Join Date
    Oct 2022
    Posts
    6

    Re: Edit M7 + M8 Scripts

    i came a bit further

    M62 P8 Q1
    M04 P0.5
    M62 P8 Q0

    but it don't update the state of mist or flood.
    I found that the state of mist or flood is read only. is there any way to update the state?

  3. #3
    Join Date
    Mar 2017
    Posts
    1371

    Re: Edit M7 + M8 Scripts

    Please enable the "Uses M-code" option under File/Settings/User Interface -> Commands/Coolant Options
    This way any user script gcode for M7/M8 will be considered.

  4. #4
    Join Date
    Oct 2022
    Posts
    6

    Re: Edit M7 + M8 Scripts

    Use M-Code is already enabled.
    But cause of turning the output on and off is does not update the Button, so it looks always as off

  5. #5
    Join Date
    Mar 2017
    Posts
    1371

    Re: Edit M7 + M8 Scripts

    You also need to add a M gcode commands to activate the coolant modal state

  6. #6
    Join Date
    Oct 2022
    Posts
    6

    Re: Edit M7 + M8 Scripts

    which M Code can I use? i didn't find anything to update the modal state.

    I found under Outputs an State Mist (RW) with _mist (R), but i don't find anyway to update or set the value.

  7. #7
    Join Date
    Mar 2017
    Posts
    1371

    Re: Edit M7 + M8 Scripts

    Inside your script like this:
    Code:
    M62 P8 Q1
    M04 P0.5
    M62 P8 Q0
    M7
    M7 gcode inside M7 script will cause status change.

  8. #8
    Join Date
    Oct 2022
    Posts
    6

    Re: Edit M7 + M8 Scripts

    Thank you, you helped me to find a solution.

    here is my solution for M7 if someone need it:

    Code:
    o<Mist>if[#<_Mist_on> EQ 0]
    	M62 P8 Q1
    	M7
    	G04 P1
    	M62 P8 Q0
    	(status, M7 Air on)
    o<Mist>else
    	M62 P8 Q1
    	G04 P1
    	M62 P8 Q0
    	M17
    	(status, M17 Air off)
    o<Mist>endif
    Also added the same code to M17 for turn off.

  9. #9
    Join Date
    Mar 2017
    Posts
    1371

    Re: Edit M7 + M8 Scripts

    You can use M17 P0 and M17 P1 to prevent accidental toggle that simple M7 can cause.
    https://cnc.zone/gcode/mcodes/mcode-m17

Similar Threads

  1. Okuma post edit or CAM edit?
    By dfearnow in forum Okuma
    Replies: 2
    Last Post: 12-30-2015, 11:47 PM
  2. Need help with scripts
    By joewaterjet in forum BobCad-Cam
    Replies: 1
    Last Post: 03-13-2012, 05:24 AM
  3. ncplot scripts
    By patcareyis in forum NCPlot G-Code editor / backplotter
    Replies: 0
    Last Post: 08-15-2010, 10:56 PM
  4. Scripts
    By tjones in forum Tutorials
    Replies: 0
    Last Post: 01-25-2006, 07:06 PM
  5. vb scripts
    By HuFlungDung in forum Mastercam
    Replies: 2
    Last Post: 07-08-2003, 05:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •