Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 05:33:38 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  How to stop garbage collection?
Pages: 1   Go Down
Print
Author Topic: How to stop garbage collection?  (Read 917 times)
0 Members and 2 Guests are viewing this topic.
WINDHAM
Active Member

Offline Offline

Posts: 3


View Profile
« on: July 29, 2009, 11:44:18 AM »

Is there any way to preserve objects / variables in separate scripts contained within mach3 buttons after termination of the script? 

I've created an mscomm object in a button script to open a serial port, but it kills the object when the script terminates, requiring repetitive recreation of this object and repetitive opening/closing of the port as a result.

What is the typical method for sharing or preserving variable/object information between independant scripts?  Is it possible?
Logged
Ron Ginger
V4 Screen Contributor

Offline Offline

Posts: 568



View Profile WWW
« Reply #1 on: July 29, 2009, 04:53:54 PM »

Not possible. Each instance of a button is a one time, run and delete.

Ive spent several hours leaning on Brian to fix that. He is sympathetic to the issue, but he seems to find other things to keep him busy. Maybe someday he will get to this.
Logged
vmax549
Guest
« Reply #2 on: July 30, 2009, 10:05:13 AM »

Could you load the needed code to support the port into the macro pump, then preserve VARS into the Gcode Vars where you have access from all over???

Just a thought, (;-) TP
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #3 on: July 30, 2009, 10:38:53 AM »

Perhaps you could build your com object as a standalone object (or thread?) Active X or what ever, then in a Plugin you can access that object, and from your buttons you can send various "NotifyPlugins()" codes to do different things to/from your object from the plugin depending on how bad you really want something like that.

scott
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!