script to display a status message on active input LED


Results 1 to 5 of 5

Thread: script to display a status message on active input LED

  1. #1
    Member SWATH's Avatar
    Join Date
    Aug 2010
    Location
    USA
    Posts
    599
    Downloads
    0
    Uploads
    0

    Default script to display a status message on active input LED

    I would like to create a script where where if input1, input2, or input3 LED is active then it displays a message in the status bar that says "X Servo Drive Fault", "Y Servo Drive Fault", "Z Servo Drive Fault".

    I've tried a few ways that didn't work because I have no real idea how to do it.

    Here is an example of my .m1s file. There have been many variations to no effect.

    If GetUserLED(21)=1 then
    Message "X Servo Drive Fault"
    End If
    If GetUserLED(22)=1 then
    Message "Y Servo Drive Fault"
    End If
    If GetUserLED(23)=1 then
    Message "Z Servo Drive Fault"
    End If

    How would you guys write that to get it to work. BTW I'm not even sure if those LEDs descriptions are correct, but when I highlight them in machscreen editor they have OEM code 0 and instead say user defined: 21. etc.

    Thanks!

    Similar Threads:
    warmachinellc.com


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: script to display a status message on active input LED

    Try this. Name it Macropump.m1s, and enable the Macropump in General Config. Then Restart Mach3.





    If GetOEMLED(821) then
    Message "X Servo Drive Fault"
    End If
    If GetOEMLED(822) then
    Message "Y Servo Drive Fault"
    End If
    If GetOEMLED(823) then
    Message "Z Servo Drive Fault"
    End If

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Member SWATH's Avatar
    Join Date
    Aug 2010
    Location
    USA
    Posts
    599
    Downloads
    0
    Uploads
    0

    Default Re: script to display a status message on active input LED

    Quote Originally Posted by ger21 View Post
    Try this. Name it Macropump.m1s, and enable the Macropump in General Config. Then Restart Mach3.





    If GetOEMLED(821) then
    Message "X Servo Drive Fault"
    End If
    If GetOEMLED(822) then
    Message "Y Servo Drive Fault"
    End If
    If GetOEMLED(823) then
    Message "Z Servo Drive Fault"
    End If
    Thanks Gerry! That worked! Also why again do we call it macropump? Can I not name it servodrivefault.m1s or whatever? The only thing now is that the message displays for about 5 sec before disappearing. Is there anyway to prevent this and make it stay up as long as the LED is active?

    Attached Thumbnails Attached Thumbnails script to display a status message on active input LED-inputleds-jpg  
    warmachinellc.com


  4. #4
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: script to display a status message on active input LED

    Also why again do we call it macropump?
    Because the Macropump.m1s file is the only macro that will run continuously in Mach3.

    I'm guessing that Mach3 is sending it's own messages after the fault, which is bumping this one out of the window?

    You could have it open a Messagebox, which will stay up until you close it.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  5. #5
    Member SWATH's Avatar
    Join Date
    Aug 2010
    Location
    USA
    Posts
    599
    Downloads
    0
    Uploads
    0

    Default Re: script to display a status message on active input LED

    Quote Originally Posted by ger21 View Post
    Because the Macropump.m1s file is the only macro that will run continuously in Mach3.

    I'm guessing that Mach3 is sending it's own messages after the fault, which is bumping this one out of the window?

    You could have it open a Messagebox, which will stay up until you close it.
    Thanks! The message box is probably unnecessary. If I press reset when the drive is still faulted and after the message goes away it pops back up. I just wanted to have an idea of what's causing the e-stop.

    warmachinellc.com


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

script to display a status message on active input LED

script to display a status message on active input LED