Need Help! Mach 3 output indicators


Results 1 to 10 of 10

Thread: Mach 3 output indicators

  1. #1
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Mach 3 output indicators

    I'm thinking of adding external start/stop/pause buttons to my system by using three input pins and associated OEM codes (which are 1000, 1001 and 1003 I believe). So that should be straightforward.

    Is there any way of controlling an output based on these? The purpose of these would be to have the buttons illuminate to show the current machine status. This is going to be a better option than using external electronics, which might not be a realistic representation of the current software status...

    I'm thinking some kind of macro attached to the on-screen buttons (is that possible??) to switch one of the outputs (there are 6 available). And if this is possible, would the OEM trigger be equivalent to using the onscreen button, i.e. also would launch the associated macro?

    One further question which is vaguely related- what is the purpose of having 6 possible 'enable' outputs? I'm struggling to see how/why Mach 3 would control these individually. I believe these (all of these?) change state when the software is in e-stop mode?

    In all the above, I'm referring to using parallel ports (I have two) rather than a dedicated motion control board. I know that the motion control boards have more comprehensive support for what I'm looking to implement.

    Forgive me for not looking around the Mach forums, the search engine is down....

    Thanks!

    Similar Threads:


  2. #2
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    Well I think I'm getting somewhere with this - it looks like I can configure an input pin to send OEM code 301, which I can use to launch a Macro I define? The Macro would be able to press the 'cycle start' button through code, plus activate an output for the indicator.

    In General Config->initilialisation I would run a Macro (saved as M700, say) which sets the macro associated with OEM code 301 as follows:

    SetTriggerMacro(M701)

    Macro M701 would contain the commands I want to run.

    What I can't figure out is if there's a way of having more than one user-defined macro accessible from the input pins - since I'd need a separate macro fo the 'Cycle Start', 'Feed Hold' and 'Stop' buttons. Or do I need to link the same macro to multiple pins, then check which pin called it from the VB Code?

    Last edited by Richster; 12-19-2018 at 08:49 AM.


  3. #3
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34541
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    What I would do is use the macropump macro to monitor your button presses, and then activate the appropriate OEM button.

    A simpler method for the outputs is to use a Brain, and have the Brain activate outputs when the corresponding Mach3 LED is active. But you could have the macropump do this as well.

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

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

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


  4. #4
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    Thanks, so macropump is like a software loop which is running constantly, checking the input pins periodically?

    And that gives me another idea.... to increase the number of input buttons, I could use a 'binary' approach and decode in software? Same on the output signals.....

    So with 3 inputs, say, 7 buttons as follows. 4 inputs would allow 15

    Button 1 =001
    Button 2 = 010
    Button 3 = 011
    Button 4 = 100
    Button 5 = 101
    Button 6 = 110
    Button 7 = 111

    The same approach could be used to decode indicators on the output...

    Is my plan flawed, or could this work?



  5. #5
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34541
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    It's a Mach3 macro that runs 10 times/second. Just name it macropump.m1s, and enable it in General Config.

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

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

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


  6. #6
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    Thanks so much Gerry - does my idea of binary 'encode' and 'decode' on the inputs and outputs have wheels? I think it could work for the inputs (since only one is pressed at a time), The outputs is more complex since multiple indicators need to be lit at the same time....

    (I edited my previous post slightly)

    Last edited by Richster; 12-19-2018 at 09:36 AM.


  7. #7
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34541
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    Not sure how you'd implement that? Much simpler to buy a controller like a UC300ETH, that has 5 ports of I/O.

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

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

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


  8. #8
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    Okay I got this working, thought I'd document in case anyone else is looking to do similar. So my scenario is 3 input pins (start / hold/ stop). So that's three inputs, there only need to be two outputs for button illumination since 'stop' will always be the inverse of 'start' (can be done with electronics rather than using up a pin....

    For the inputs, these are used on 'OEM Trig #' inputs, which are then mapped to the OEM commands under config->system hotkeys. The codes are 1000, 1001 and 1003 for start, feedhold, stop.

    The LED OEM code for 'start' is 804, and it's 805 for 'hold'

    Assuming that the two 'illuminate' signals are interfaced to outputs 3 and 4, then the code in macropump.m1s is as follows. Also 'macropump' needs to be enabled in 'general config'. The file goes in the 'macros' folder for the currently active profile, e.g. c:\mach 3\mill\marcos

    '----Start button
    If GetOEMLED(804) Then
    ActivateSignal(OUTPUT3)
    Else
    DeactivateSigal(OUTPUT3)
    End If

    '----Feed hold button
    If GetOEMLED(805) Then
    ActivateSignal(OUTPUT4)
    Else
    DeactivateSigal(OUTPUT4)
    End If

    Hope that helps!



  9. #9
    Member
    Join Date
    Aug 2016
    Location
    United States
    Posts
    181
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Richster View Post
    Okay I got this working, thought I'd document in case anyone else is looking to do similar. So my scenario is 3 input pins (start / hold/ stop). So that's three inputs, there only need to be two outputs for button illumination since 'stop' will always be the inverse of 'start' (can be done with electronics rather than using up a pin....

    For the inputs, these are used on 'OEM Trig #' inputs, which are then mapped to the OEM commands under config->system hotkeys. The codes are 1000, 1001 and 1003 for start, feedhold, stop.

    The LED OEM code for 'start' is 804, and it's 805 for 'hold'

    Assuming that the two 'illuminate' signals are interfaced to outputs 3 and 4, then the code in macropump.m1s is as follows. Also 'macropump' needs to be enabled in 'general config'. The file goes in the 'macros' folder for the currently active profile, e.g. c:\mach 3\mill\marcos

    '----Start button
    If GetOEMLED(804) Then
    ActivateSignal(OUTPUT3)
    Else
    DeactivateSigal(OUTPUT3)
    End If

    '----Feed hold button
    If GetOEMLED(805) Then
    ActivateSignal(OUTPUT4)
    Else
    DeactivateSigal(OUTPUT4)
    End If

    Hope that helps!
    Hey I have made a button to turn on out 4 and one to turn off out 4. I think I can get a macro to do that ..
    Anyone know how to do this .
    Would be appreciated...

    Sent from my XT1635-01 using Tapatalk



  10. #10
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    You could call the same macro (301), check the state of the output and toggle it? So if it's on, turn it off and vice-versa. I think you could call the same macro from two separate buttons if you wanted. Or just use one button and have it toggle the output. If you had an illuminated button (or sepatate indicator), you could wire this to the same output, to show the current state.

    Just some thoughts.....



  11. #11
    Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    161
    Downloads
    0
    Uploads
    0

    Default Re: Mach 3 output indicators

    An update on this.....

    I have a fairly comprehensive control panel which looks like this
    Mach 3 output indicators-mappings-jpg
    I have two parallel cards, I have annotated with the ports and pins which are used. All buttons are illuminated, though the X,Y,Z and Spindle buttons don't interface directly with Mach 3, however they are switched by the 'enable' signal from Mach3 which also controls the reset button illumination.
    Note the 'cycle run' and 'cycle' stop share the same pin since they are inverted versions of each other.

    I was pulling my hair out trying to make the signals work correctly using a MacroPump function then finally figures out the source of the problem. What highlighted it for me is on starting Mach3 the 'flood' and 'spindle cw' LEDs would be flashing on screen, but I couldn't figure out why.... There was all sorts of other weirdness going on, plus sometimes the spindle wouldn't stop at the end of a cycle.

    The culprit is the 'spindle settings' where there are pins set for Relay outputs for spindle control and flood/mist. These must all be assigned a number between 1 and 6. Even when they are deactivated using the checkbox, setting the outputs via VBSCRIPT overrides this. So if SPINDLE CW is set to OUTPUT 4, then even if the checkbox is not enabled, calling ActivateSignal(OUTPUT4) makes the spindle LED flash.

    Since I have a VFD controlled by a plugin, my solution was to set all the output channels for all functions to 6. Output 6 was originally connected to PORT2, PIN1, it's used by by 'Tool Change' LED button. So I simply disabled OUTPUT6 (so it doesn't do anything) and assigned OUTPUT8 to PORT2,PIN1. So effectively I have a dummy output to get around this problem.

    All my indicators now light up as they should, this is done using the following VB functions in the macro, wrapped up in IF statements

    GetOemLED(code) - to check the status of an onscreen LED
    IsOutputActive(OUTPUTx) - where x is an output number, checks whether an output pin is on or off
    ActivateSignal(OUTPUTx) - turns on output x
    DeActivateSignal(OUTPUTx) - turns off output x

    Hope that helps someone, it was driving me nuts for days!



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

Mach 3 output indicators

Mach 3 output indicators

Mach 3 output indicators