Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ballistic42 on November 09, 2015, 11:01:43 PM

Title: Mach3 Output 6 and 7
Post by: ballistic42 on November 09, 2015, 11:01:43 PM
Hello all I am new to the forum.  I have a G0704 Mill converted to CNC.  I am running a  C32 board, an ESS (smooth stepper), C52 board, C3 bob, C27 for limit switches, 4 G203V drivers.  I just added a the 4th axis to start working on an ATC unit along with A power draw bar.  I have 5 solid state relays in the control box as well.  Relay 1 runs my coolant pump which is 110V, Relay 2 runs an air valve (110V) for the future ATC tool carousel air cylinder, Relay 3 runs the 110V air vavle for the Power draw bar, Relay 4 will run another air vavle (110V) for a blast of air to clean the tools in the carousel.  The 5th realay is not dedicated to any device just yet, but I am sure it will be.

How can I add output 7 LED to the Diagnostics Tab in Mach3?  I would like to see the light on that page flashing to see if it works.  I cant make output 6 light up either but not sure why.  I know the relays work because I used the coolant mist M7 to check the relays and I get power to the plugs.

Any help for this newbie would be good.

Thanks,

Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 10, 2015, 02:41:26 AM
>>>How can I add output 7 LED to the Diagnostics Tab in Mach3?

Use a screen editor... I use "Machscreen" available from the "downloads" dropdown here: http://www.kd-dietz.com/klausphp/pages/eng/machscreen/description/ms_description.html

When you start the program you will have a "MachScreen Properties" floating tab that appears on the RHS.

First select the "page" you want from the dropdown list / menu

Then little bit further down that page, next to the "add control" button select "LED" from the dropdown and then click "Add Control"

Then click somewhere on the screen where you want to add it.

Then whilst still having the LED selected / highlighted, look on the floating screen and at the bottom of the floating screen is a number of options

Then where is says "function" click on the bit of text next to it (probably says"reset" and scroll down to "OEM Output 6 Active LED"  [they are alphabetical]

You can then move, scale etc the LED... you can also change the LED's colour change state / blink status by adjusting the properties in the floating tab.


>>> I cant make output 6 light up either but not sure why.
Have you assigned the pin under ports and pins?....   how are you turning output 6 on and off.... are you using an "M" code... you may need to create a script...
In Mach3.... go to the "operator" menu.... select "VB Editor".

Then add the following text....

ActivateSignal(OUTPUT6)

Save the file as say "M1061.m1s"

Then create another macro... and add the following text ....

DeactivateSignal(OUTPUT6)

Save the file as say "M1060.m1s" 

[the "theory behind the numbering is .... greater than 1000 m codes are custom / user codes... the "6" is for output 6 and the "1" or "0" indicates if you want the port "on" or "off"]

......
useful manual here (DROs and LED refs are at the rear):
http://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

And another one with the full command set of Cypress (not just Mach3 specific items):
http://www.machsupport.com/wp-content/uploads/2013/02/VBScript_Commands.pdf

Rob
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 10, 2015, 08:53:09 AM
Rob Thanks a lot!  I will check do what you have suggested.  You gave a me a very clear suggestion which I can understand.  I will give it a shot and see how it goes.
Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 10, 2015, 09:00:23 AM
No problem,

...forgot to add...

You will need to add the m codes to your gcode to toggle the outputs when you want them.

Note all mcodes except m10/m11 will cause a slight hesitation in the machine because of the way Mach recites scripts.


What is the machine for?

If you go to the midi screen you can type in the mcodes and test they work as intended (once you've set it all up)

Rob
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 10, 2015, 09:46:18 AM
Rob thanks for the info.  I am new to all this so going to take me a few tries to get this down.  The machine is going to be used to make parts for my jet ski, Parts for upgrading the G0704, and fior what ever else crosses my mind.  I will give all the new stuff you have given me a try and see what I come up with. 

Thanks,

Jeff
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 10, 2015, 10:37:15 AM
Rob, how do i make a LED output 7?  I dont see that in the drop down menu as an option.  I am wanting to add output LED 7 to the Diagnostics page 5 in Mach.
Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 10, 2015, 05:27:14 PM
.... I have tried this and it did not work for me.... but you may be able to get it to work....

You can either use "brains" or a "macropump".....

Basically create two more macros (M1070 and M1071) same as the others but change the outputs from 6 to 7.

So you can toggle output 7 with an M code.

Then in the screen editor .... create an LED.... but where it says "standard code" .... change it to "1070" ..... this will then look for "UserLED(1070)"

Now you have a choice... brains or macropump....

If using brains.... attached is a Brains file....


Note .... I could not get my macropump to work (hence my code may be wrong).. or you could just use the brains file (note you will have to enable the brain to get it to run...).

Rob
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 10, 2015, 06:31:30 PM
Rob I got the relays working by making output 7 and 8 as a Macro.  For some reason I cannot make the red LED flash on the screen like I can 1, 2 ,and 3.  I also for some reason cannot make OUPUT6 work at all.  Says Output6 is Mcode 79.  So not sure how to make ouput6 work.  I used the VBscript like you said adn worked but not for 6.  Output7 I used a reserve 32 i believe.
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 11, 2015, 01:49:47 AM
Rob,  I got the Diagnostics screen to say output 7 and output 8 and both relays that I wanted to work.   I type  M1071 in the midi and relay 7 turns on.  M1070 and the relay turns off, works the same way for relay 8.  I was not able to make OUTPUT 6 work at all.  I am not sure why it would not let me assign something to it.  I tried everything I could to make it work.  Oh well I just skipped it and made OUTPUT 7 and 8.

Thanks for your help!  Your instructions were very clear and concise.  I still would like the LED to flash but for some reason they don't lite up when the output is active.  I will have to figure that out.
Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 11, 2015, 02:26:13 AM
I don't know why output 6 will not work. 

I dont know where you got M79 = output6 or "reserve 32 = output7".... sorry I don't understand that.

But at least in the end you got output 7 & 8 to work as M1070/M1071 & M1080/M1081.

In order to get an LED to display you will need to create a UserLED... there are no predefined LED's assigned to output 7 or 8.

The easiest way is to create a "brain".

In Mach3, go to "Operator" (top line), then go to "Brain Editor..."

It will popup asking for a name... choose anything like "OP78LED"

A Blank screen will appear....

On the top line you will see a black "+", click on that....

Select "Outputs"....

On the dropdown select "Output 7", then click "Ok"....

Then click on the screen where a box appeared saying "Output 7" ..... it will go Green.

Then click the black "+" again...

Then click "ok" .....

Then click on the screen where the box appeared saying "No Operation - Signal Pass".....

Then click on the Green Upside Down "T" (on the top line.... next to the + and - )....

Then click "UserLED's" .....

When the popup arrives .... select the checkbox that says "Use Led Number" .... and type in "1070" in the text box ....... then click "Ok"

You have now created an UserLED with the number 1070...

Repeat the process by clicking on the Green "+" and add and select "Outputs" ..... [and start again from above where it says "outputs" ..... call this LED "1080" when you get to the bottom]


... save changes and exit "Brain Editor...."

Rob




Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 11, 2015, 02:31:25 AM
In Mach3 .... go to "Operator"... then "Brain control...

First click on "Reload all Brains" .... as your new LED brain will not appear....

Once you see your new brain "OP78LED"..... click on it..... and select the check box that says "enable".....

Then select "reload brain"..... then click on the "Ok" at the bottom of the page......

then restart Mach3.....


You now have a loaded and working brain....

Rob
Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 11, 2015, 02:38:28 AM
Now start MachScreen.....

...... on the Right Hand Side floating toolbar that appears .... click on the "page" dropdown and select the screen you want the LED to appear on.....

..... then click on the dropdown next to the word "control" and select "LED".....

Add the LED to the screen (same way as you did last time).....

This time click on the LED object on the screen..... but when it is selected.....

Where the options say "standard code"   (below where you added the LED function last tie with the OEM / STD LED's).....

and type in "1070".... and hit the Enter Key....

(you have now assigned the User LED code 1070 (output 7) to the LED....

If you want it to be red.... change the colour to red (the options are below the "standard code box" where you entered "1070"....  If you want it to blink.... do the same and select "yes".


Then go and create UserLED 1080... the same way....

save and exit....

Restart Mach.... and your screen should now be displaying the Output LED's ...... if you type in the M codes.... they SHOULD change state.....

Rob
Title: Re: Mach3 Output 6 and 7
Post by: ballistic42 on November 11, 2015, 01:21:05 PM
Rob, I did what you said and had a little hickup in the middle but I re-read what you said and it worked out GREAT and I learned a lot!!!  I wanted the OUTPUT LEDS for 7 and 8 to come on and flash when they were active ex. 1071 1081 and then go out when I typed Mcode 1070 1080.  I had to invert the signal to do so, works awesome.  Really pretty trick how this stuff works.  I am in the process of having some machine work done on my mill.  I had my G0704 Z column machined and HIWIN heavy duty linear rails and bearing blocks attached to it and squared to the world.  The base is at a local machine shop here in KC being ground to square the bottom on the base to the top and the side where the Z column mounts.  When I put it all back together, I should not need any shims when I TRAM everything again.  I had the machine running before but when using G83 cycle the gibbs would jump around and I was breaking drill bits.  That is when I decided to take it apart and do the Linear rail conversion.  I am having a metal fab shop build me an enclosure that will have a V pan in the bottom of it with a screen to filter the big metal shavings then the finer ones will go through the filter prior to going into the coolant tank to be recycled up again.  The reason for the extra relays in my control box are for a Powered Drawbar and an ATC.  I have pretty much all the electronics done for it now except for wiring up a few more limit switches for the FABCO Pancake air cylinder and the ATC air cylinder.  

Thanks for helping me figure that out.  I have to read up on how to make a macro for the tool changer.  I am pretty much copying Tormachs design with a few mods.  I am estimating having about $900.00 To build both the PBD and the ATC combined.

Jeff
Title: Re: Mach3 Output 6 and 7
Post by: robertspark on November 11, 2015, 02:08:18 PM
Jeff, congratualtions, glad you got it working the way you wanted...

at least now you've had a taste for macros, brains and the screen designer so you're able to customise it as you wish

I have to admit once you start fiddling and learning how it all works it can become addictive as there is nothing that you cannot with a little thought do.... there are a few limitations make no mistake (speed of the m-codes ..[depends upon what you want to do ])  and script / brains exicution loop.

Good luck with your build.... sorry I've not had a need for a tool changer (yet!)...

The main thing is to just read and understand the manuals when compiling macros

.... brains is a little different and you just need to have a play as brains is just logics where as the macros can do a more (conditional statements etc).

Sorry forgot you may have needed to flip the output in brains.... but at least you've got everything the way you wanted.... you can now experiment with a custom screenset maybe some buttons for running macros or key board commands etc etc.

Any questions I'm sure someone will be about to help.

Rob