Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: WINDHAM on July 29, 2009, 12:44:18 PM
-
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?
-
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.
-
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
-
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