Hello Guest it is April 16, 2024, 06:43:39 AM

Author Topic: Would love some more Info on Script Editor in MACH3  (Read 7148 times)

0 Members and 1 Guest are viewing this topic.

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Would love some more Info on Script Editor in MACH3
« on: April 12, 2007, 12:31:17 PM »
Hello All  :), I have been doing a fair bit of script editing for buttons etc within Mach lately and have encountered some frustrating issues. I m wondering if I am doing something stupid or wether it is a bug. I have found that when Editing a Button Script sometimes it doesnt "Save" Even though I have saved it. This seems to be especially true if I edit a Script when It has tried to run but has a compile error and Mach has opened the window for me to look at the script. In Fact it NEVER saves the scripts in this instance, I allways have to exit that screen goto the menu and select edit button script. Also is there anyway to find out where the compile error or syntax error is within the script? Is there another tool better suited to editing the button scripts? I Love Mach 3 and I really dont want to sound un-appreciative of everyones efforts but if this is how you all create screens and the associated scripts I am amazed you all are not crazy..... Anyways, any information on how everyone else creates button scripts and macros would be great!, also any tips on testing scripts, I have a tool hieght setting scripts that seems to have developed a nasty case of running the Tool into the probe really hard after the first touch which it does very nicely...... but I have found stepping through the script on my system can lead to some unpredictable happening which are even worse..... so ROCK <------> HARDPLACE Not sure how to approach the debugging.....

Thanks in advance

Mike
Re: Would love some more Info on Script Editor in MACH3
« Reply #1 on: April 12, 2007, 01:32:00 PM »
You can only edit the script IF you open the script with the "Edit Button Script" under operator.

sorry about that
Brian

Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Would love some more Info on Script Editor in MACH3
« Reply #2 on: April 12, 2007, 02:23:07 PM »
Brian, Any reason why the scripts dont save sometimes?
Re: Would love some more Info on Script Editor in MACH3
« Reply #3 on: April 12, 2007, 02:33:37 PM »
Are you saving the screen set?

it is under View -> Save Current Layout do this after you make a change and it will save to your screen set
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Would love some more Info on Script Editor in MACH3
« Reply #4 on: April 12, 2007, 02:43:49 PM »
gotcha.... thanks, Maybe that will help.
I Have been saving the Script.. But Iguess it is Buried in the screen Set and thus does not get saved... unless you save the screen set.
M

Offline Scott

*
  •  139 139
    • View Profile
Re: Would love some more Info on Script Editor in MACH3
« Reply #5 on: April 12, 2007, 11:58:21 PM »
I've had this same 'not saving' problem for quite some time also.  As far as I've been able to tell, if you step into or run through the script and then stop and make some changes and then save, it doesn't really save (having some error may trigger it too).  I've often closed the script and reopened it by "Edit Button Script" and the changes have not been saved.

I've gotten into the habit of doing a "Select All" and "Copy" before closing the editor and then open the button script again to check it.  If it wasn't saved, then I select all again and paste, then save again before attempting any further changes.
« Last Edit: April 13, 2007, 12:02:04 AM by Scott »
Scott
Re: Would love some more Info on Script Editor in MACH3
« Reply #6 on: April 13, 2007, 10:33:02 AM »
Okay, Looks like I need to play with it and see if I have that problem... It was bad but after Art redid the VB hooks in Mach3 it has been working very well for me...
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Would love some more Info on Script Editor in MACH3
« Reply #7 on: April 13, 2007, 11:37:04 AM »
Scott, good tip, I too have begun to "backup" my Button Scripts to an external file which I can Edit. Brian Let us know what you find out, I have a great deal of scripting to create and debug for this machine and every little bit will help ;)
Mike
Re: Would love some more Info on Script Editor in MACH3
« Reply #8 on: April 14, 2007, 01:56:23 PM »
I have also had troubles with the editor. When you get an error and VB opens the edit box it seems to be called 'hiddenscript' if you edit there and save it it does not put that code back into the button script. Always simply take note of the error, then close that box and re-open the edit with the menu item to edit button script.

Note also that you should do the 'Save current screen layout' after every edit. Vb has a maddening habit of crashing Mach after several minutes editing VB code. I have had this happen many times while working on wizards, I suspect it some kind of memory leak problem, but it seems if you use the edit button script enough times in one session it will eventually crash.

I always select, copy, then paste my code into a text file. That also helps create a documentation file you can print.

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Would love some more Info on Script Editor in MACH3
« Reply #9 on: April 14, 2007, 02:30:54 PM »
All very useful info, thanks Ron. Dosumentation is important for this project as I imagine we will be supporting this machine for some time to come....
M