Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Assinkmar on October 19, 2007, 05:09:18 PM

Title: VB Scrpt output
Post by: Assinkmar on October 19, 2007, 05:09:18 PM
Hi, I am from the Netherlands.

I like to make a little VB script, but I am a newbie.

Most I have doing with VB script is working, but I can't set an output.

With the command:   ActivateSignal(OUTPUT4) and DeActivateSignal(OUTPUT4) the leds in the DiagnosticScreen works fine.

But I can't find  the command for setting an outputpin, for example output#4, this for activating a relais?

Is there anybody for help?

With kindly regards

Riny Assink
Title: Re: VB Scrpt output
Post by: poppabear on October 19, 2007, 09:36:29 PM
goto config, then ports and pins, then output signals, then set your port and pin for output4 there.

scott
Title: Re: VB Scrpt output
Post by: Assinkmar on October 20, 2007, 05:41:23 AM
Hi Scott,

Thanks, I did it and  it works fine.

Ik have much to learn, but it's greate to do it. For me also the language is not easy.


Greeting from the Netherlands.


Riny Assink
Title: Re: VB Scrpt output
Post by: Heian on February 02, 2008, 09:40:48 PM
Im trying to new M codes, I set M11 to ActivateSignal(OUTPUT2), M12 to DeActivateSignal(OUTPUT2) but when I type in M11 in MDI  I dont get a signal light on output 2, Output 2 in turned on in Ports and Pins, What am I Doing Wrong, M3 activates output 1, M5 deactivates output1, This is set up in Mach from the start. And is Working Fine. I need M11, M12, M21,M22, M31,M32, M41,M42, M51,M52, M61,M62,M71,M72,M81,M82, Along With a Few Others to activate a @ zone Vac System .Each M codes needs to drop a head on our Router And the Second M code Picks it up EX. M11 Head 1 Down, M21 Head 1 Up.
Title: Re: VB Scrpt output
Post by: poppabear on February 03, 2008, 09:34:30 AM
The Mcode range your speaking of, are already taken in Mach, even if you open M11 in the VB scripter and replace the code that comes with that nativly with mach with your stuff, it will not work, dont know why but that is the way it is.

If you will start all your custom M codes in a higher ranges, I.e. M800, M801, M802, M803, etc. you will find that your actvate and deactivate Mcodes will run just fine..........

Scott
Title: Re: VB Scrpt output
Post by: Heian on February 03, 2008, 02:11:54 PM
Yes, I found that out, I  changed the M11 to What i needed and i dident work, I tryed to add M06 Vac On , M07 Vac Off That Did not Work, Im Stuck With M111 head 1 down, M112 Head 1 Up, M211,M212 ECT. The problem i Have is that all the g code for the past 15 years has the M codes i posted before, and i dont want to have to change  all those programs. Or my post in MasterCam.  If Anybody knows how i can overcome this Please let me know.  We are converting a 8 head Heian router from a Fanuc 11 Control to Mach 3 

John
Title: Re: VB Scrpt output
Post by: Heian on February 03, 2008, 02:16:02 PM
I forgot to ask there is a M code List in Mach, If i cant use the m codes i need, can i edit the list so my operator will be able to see the new M Codes. Thanks  JP
Title: Re: VB Scrpt output
Post by: poppabear on February 03, 2008, 03:00:00 PM
JP,

     Well your other choice if you want to keep those Mcodes is to open up the Old Gcode file in a text editor and do a "Find and Replace" I.e. M11 replace wth M800, it will go through and replace all instances.

Brian my have to chime in on How (and which ons), of the M codes are "Locked" into mach a certain way. I have found that certain ones like your M11, only the kinda stuff that is already in M11 will work, other stuff will not.

Sorry I couldn't help you more on this one, but you may be stuck unless you want to do some find and replace work. The issue here is within Mach itself, and only Brian and do anything about that.

Scott
Title: Re: VB Scrpt output
Post by: Chaoticone on February 03, 2008, 03:29:42 PM
Do you mean this list? If so, you can create your own image amd import it to your bitmaps folder then edit your screen with screen 4 to show your personal list.

Brett
Title: Re: VB Scrpt output
Post by: Ron Ginger on February 05, 2008, 06:58:32 PM
Something strange here. If you look at any of the macros that come with Mach, like M11, There is lots of Vb functions in there. Many people often edit M6Start or M6End for tool change stuff. So why cant you have an M12, or whatever you want below 100?

Is it simply a convention that users ought to stay out of the below 100 codes so they dont get trampled by some new future  Mach addition?
Title: Re: VB Scrpt output
Post by: Chaoticone on February 05, 2008, 07:30:54 PM
Quote
Is it simply a convention that users ought to stay out of the below 100 codes so they dont get trampled by some new future  Mach addition?

I think this is right Ron.

Brett
Title: Re: VB Scrpt output
Post by: poppabear on February 05, 2008, 08:35:24 PM
Ron,

    I have seen this odd thing for a long time now, I just thought it was some internal thing with Mach and that was that!!!
Only M6Start and End was editable, I noticed that you can do macros below 100 as long as it doesnt overwrite one that comes with mach that would be that same number.

Perhaps Brian could chime in, and clairify.

Scott
Title: Re: VB Scrpt output
Post by: Heian on February 05, 2008, 09:50:47 PM
Well  we had to make 14 new m codes, M111 select and drop router 1, and M112 Router up, M211 Sel and Drop reouter 2, M212 Router up,  On Head 6 I still could not use M611 Mach Would not take it, We used M6111, And M612 Head up, This Is Very odd after using the M codes in the fanuc 11M System, Dont get me wrong, We love the flexibility that mach is giving us over our old system, But we would like to keep our old M Codes if we could, We have 3800 programs that were written over the past 15 years and we still use many of these parts today, I have to get MasterCam to write a new post For this Machine , Our vaccum Table was controlled with a M06 On , M07 Off, Now Its M911 On M912 Off, The M06 would not work with Mach.  Oh I Overwrote the M11 that came with Mach, Do i have to put it Back So i dont have future problems,  Can any one answer Why we cant Change the Macros that came in Mach, And where is M03 Mapped to output 1,

Thanks Heian, JP
Title: Re: VB Scrpt output
Post by: poppabear on February 05, 2008, 10:37:13 PM
m03 is mapped on the ports and pins, under spindle you will see you can use outputs 1-6 for cw, ccw, flood and mist, NOTE, if you want to have the functions run on mach through the G code you will hve to keep the above in the 1-6 output range. Remember to turn on, enable, your outputs in portpins for outputs.

The functions in mach, dont have a clue but it is just that way, until Brian changes it............

the old m code that came native, if you screwed them up, AND you do need them as they are, just reinstall Mach and it should fix it, (you may have to delete the ones that are jacked up first prior to reinstall).

3800 codes............wow, youve been a buzy bee.........  Perhaps you can find a Programming Geek that could do some kind of Auto find and replace functions in where you could list the old codes and then have a second colum with the new code to replace them with.........

There is a guy who wrote a Mach3 post for Master8, 9, X       I think one of his post is in the post processors section, If you need custom PP's for Master CAM, he will do them for a small fee.  I think his Website was Novalabs.(something). Perhaps someone here can supply that address for sure.

scott
Title: Re: VB Scrpt output
Post by: Chaoticone on February 05, 2008, 10:52:18 PM
Brian confirmed Ron's suspicion, stay out of the below 100 Macros.

Brett
Title: Re: VB Scrpt output
Post by: poppabear on February 06, 2008, 08:57:32 AM
except for M6