586,121 active members*
3,156 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Gecko Drives > Output command for g540
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    312

    Output command for g540

    I have the g540 installed and everything works perfect (x/y/z and all 4 input switches (home/limit)
    only thing that doesnt work is the output1 and output 2

    what command am i susposed to type on mach to make the output working?

    if i want it to output 5vdc instead of my power supply 48vdc how do that or i have to install a 48vdc relay switch?

    Thanks in advance
    Dan

  2. #2
    Join Date
    Jun 2005
    Posts
    208
    Here's something that I posted on the MechMate forum that shows how I enabled the two G540 outputs. (The MechMate forum is an excellent forum for those building their own CNC routers):

    I can't believe that I was so dense when it came to writing macros to control the outputs in Mach3. (Maybe everyone but me already understands Mach3 macros and output signals, but I surely didn't.)

    When I looked at the documentation sheet for the Gecko G540, it said that OUTPUT2 was pre-assigned to DB-25, pin 1. That is not a usable output pin on the PMDX-122. All at once the proverbial light came on and I realized that I had been making Mach3 much too difficult.

    I clicked on Config -> Ports and Pins -> Output Signals and then Enabled Output #1, assigned it to Port 1 (default) and Pin Number 17. Then I clicked Active Low. Next I Enabled Output #2, assigned it to Port 1 (default) and assigned it to Pin Number 1. Then I clicked Active Low. At that point, Mach 3 was configured to handle the two Gecko G540 outputs.

    The goal was to have simple control over the outputs. I wanted to be able to turn an output on and then to be able to turn an output off by using M-codes.

    I decided to use Mach3's VBScript Editor to write the macros, so I clicked Operator -> VBScript Editor and entered this one line of code:

    ActivateSignal(OUTPUT1)

    I saved it as M801.mls

    I wrote three other macros:
    M802.mls contains one line: ActivateSignal(OUTPUT2)
    M901.mls contains one line: DeactivateSignal(OUTPUT1)
    M902.mls contains one line: DeavtivateSignal(OUTPUT2)


    So, I ended up with four macros, M801, M802, M901 and M902. I could have used any permissible number.

    - M801 turns on the G540's Output #1.

    - M802 turns on the G540's Output #2.

    - M901 turns off the G540's Output #1.

    - M902 turns off the G540's Output #2.

    All the macros were saved in the C:\Mach3\macros\Mach3Mill directory. All four macros have .mls as the suffix.

    Next, I wrote a test program and saved it as junk.tap. All that the program does is to call a subroutine 10 times to move the X-axis, turn on Output #1, wait for 2.5 seconds, turn on Output #2, wait for 2.5 seconds, turn off Output #1, wait for 2.5 seconds, turn off Output #2 and wait for 2.5 seconds. (Be sure to set G04 to ms in the General Logic Configuration screen - or you'll be waiting for 2500 seconds). As the program ran, I watched the Output LEDS on the Diagnostics screen - and it worked!

    G90

    M98 P0100 L10
    M30

    O0100
    G01 X5 F600
    G04 P50
    G00 X0
    M801
    G4 P2500
    M802
    G4 P2500
    M901
    G4 P2500
    M902
    G4 P2500
    M99

    Anyway, that's all that there is to it. Just assign the Outputs to a usable pin number, write a macro to turn on the output, ActivateSignal(OUTPUTx), write a macro to turn off the output, DeactivateSignal(OUTPUTx), and then call the macros using the appropriate M-code.

  3. #3
    Join Date
    Dec 2008
    Posts
    445
    Quote Originally Posted by DanOSB View Post
    I have the g540 installed and everything works perfect (x/y/z and all 4 input switches (home/limit)
    only thing that doesnt work is the output1 and output 2

    what command am i susposed to type on mach to make the output working?

    if i want it to output 5vdc instead of my power supply 48vdc how do that or i have to install a 48vdc relay switch?

    Thanks in advance
    Dan
    The "outputs" short one side of the switch to ground. Connect the power source positive you need to the load, and then ground to the G540. Connect the ground of the power source to ground. If you need a 5V out, you need to connect +5V to the thing you are switching, then connect the ground of the thing to the G540. Connect the 5V supply ground to the system ground.

  4. #4
    Join Date
    Dec 2004
    Posts
    312
    wow thanks for quick reply.. ill give it a try tmw morning.. hopefully ill get this working.. sounds pretty simple then..

    Cheers
    Dan

Similar Threads

  1. G540 Spindle speed output voltage problem
    By georgef8 in forum Gecko Drives
    Replies: 5
    Last Post: 09-22-2009, 04:18 PM
  2. g540
    By Scooby Doo in forum Gecko Drives
    Replies: 62
    Last Post: 05-17-2009, 07:44 PM
  3. can you... BOB to G540?
    By Fixittt in forum Gecko Drives
    Replies: 7
    Last Post: 01-28-2009, 01:37 PM
  4. G540 - WOW!
    By LaserImage in forum Gecko Drives
    Replies: 6
    Last Post: 12-04-2008, 10:30 PM
  5. Are their controllers that output ASCII command(instead of pulse)?
    By JasonCampbell in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 09-25-2007, 11:49 AM

Posting Permissions

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