Hello Guest it is April 18, 2024, 07:05:45 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - WINDHAM

Pages: 1
1
This seems to be simple for others, but for me it took forever to figure out:

You can create a button with screen 4   double click the button and tell it you are assigning VB to it.   Then in order to assign said VB you have to go back into mach 3, bring in your new screen then under the operator drop down, there  is a vb script editor to actually write the code.   

Why you cant write it in Screen 4 is beyond me, but finally I figured that part out.   

Other than that I think knowledge of the language is all you need.

Good luck

2
VB and the development of wizards / How to stop garbage collection?
« 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?

3
General Mach Discussion / Re: mach 3 and the serial port
« on: July 29, 2009, 11:29:34 AM »
Step 1: Find the file mscomm32.ocx and put it in your windows\system32 directory
Step 2: Register it with the operating system using "regsvr32.exe mscomm32.ocx" at the command line
Step 3: Use the following code to open COM1 and send a 'b' character to the port

  Set MSComm1 = CreateObject("MSCOMMLib.MSComm")
  MSComm1.commport = 1
  MSComm1.settings = "57600,N,8,1"
  MSComm1.InputLen = 1024
  MSComm1.RThreshold = 0

  MSComm1.PortOpen = True
  MSComm1.Output = "b"

Unfortunately, if this code is run via a button, the port opens and automatic garbage collection appears to close the port after the script is complete.  This requires repetitive opening of the port, which can upset devices which watch control codes on the line. I'm currently looking for a workaround for this problem.

Pages: 1