Hello Guest it is April 25, 2024, 04:25:05 AM

Author Topic: Where to start?  (Read 8054 times)

0 Members and 1 Guest are viewing this topic.

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Where to start?
« on: September 10, 2012, 03:03:11 PM »
I have absolutley no understanding or experience of programming of any kind.
I have downloaded the VB script command document and have installed Screen 4 but I am at a loss as how to start.
My mammoth task of converting my Denford Triac to Mach3 has been ongoing for around 5 years and the end is in sight but I now have to tackle programming the ATC. I have posted a topic on the main forum but, whilst I appreciate the replies, I am not really following what's being said!
http://www.machsupport.com/forum/index.php/topic,22055.0.html

In hope ...Sweep

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Where to start?
« Reply #1 on: September 10, 2012, 06:27:13 PM »
There's a video on creating a toolchange macro, and the sample code is also available for download. It might get you started.
http://www.machsupport.com/videos/
Sample macro - http://www.machsupport.com/downloads/M6Start.zip
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #2 on: September 11, 2012, 03:39:44 PM »
Hi Ger21,

I have run the video a couple of times and it seems to relate more to the layout of the screen than to the operation of the functions.
My first experiment was to modify the REF ALL HOME (RAH) button on the standatd screenset to add a stream of text sent to the ATC to start the ATC dtaum function after the axis had found home.
Using Screen4 when i click on the RAH button the input box that appears notes that the "VB script function is edited within Mach3" but how do i do that?
i.e. how do i edit within Mach3 and how do I instruct the code to go to the, say, serial port as opposed to the parallel port etc?

...Sweep

Ok. Found the "edit button script" button within Mach3 which allows me to add to the existing code. Now to figure out what DoButton and DoOEMButton means
« Last Edit: September 11, 2012, 03:47:25 PM by Sweep »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #3 on: September 11, 2012, 04:01:31 PM »
There are 2 manuals you need to download.

The mach3 macro programmers manual AND the VB programmers manual.

They are located here  http://www.machsupport.com/documentation.php

With as many triacs that have been converted their MAY be an example of how it was programmed on this site.

Just a thought, (;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #4 on: September 11, 2012, 05:12:48 PM »
Thanks for that TP,
I had the VB script command reference guide but had completely missed the Programmer's reference !

...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #5 on: September 11, 2012, 07:16:18 PM »
Yep the programmers reference is the holy grail to Mach3 and support macros.

I know several people have converted the Triac to Mach3 complet with tool changer you just have to find them and ask for help with the macro that drives the ATC. Most will willing help out.

I will look to see IF there is any info floating on the Web for ya.

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #6 on: September 12, 2012, 05:36:33 PM »
Ok, having now spent 10 minutes glancing through the Holy Grail that is The programmer's Reference Guide I am now an expert ;)
...well not really as nothing happened.
Using the "Edit Button Script" command in Mach3's Operator tab menu I highlighted the REF ALL HOME button and added the following code:
SendSerial("B0000133E167R25") in a feeble attempt to send B0000133E167R25 to the serial port. Of course, nothing happened when I cycled through the code.
I have changed the baud rate in General Logic Configurations and ticked Event Friven Serial Control in Engine Configuration, though I am unsure what that does.

REF ALL HOME script now looks like this:

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

SendSerial("B0000133E167R25")

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

So what am I doing wrong?

...Sweep
 

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #7 on: September 12, 2012, 05:48:14 PM »
That was going to be the next question (;-) were you going to talk serial to the atc of rebuild the mechanism to use a stepper drive and i/os.

Did you setup the mach3 serial port to be the same as far as buad rate , bits, stop bits. It has to be exactly the same as the ATC uses or no talky.

You probably need to start with using Windows hyperterm to SEE if you can talk to the ATC.  Set up the hyperterm as to the Comport settings and then type in the comand data and see IF the atc responds to commands.

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #8 on: September 12, 2012, 06:08:26 PM »
I already have full control via Hyperterminal which works great. All the datums and tool changes are ok.
Before I stripped out the old Denford motherboard I captured all the data flow on my oscilloscope. I adjusted the baud rate but, because of the age of the machine, I had to introduce an inttercharacter delay of a few milliseconds to allow the ATC time to digest the data.
Does the code look ok?

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #9 on: September 13, 2012, 03:28:31 AM »
Just checked the Hyperterminal settings and I have a 1200 baud rate, 7 data bits, parity = none, stop bits =1, flow control = none, and a 10 millisecond character delay and it controls the ATC perfectly every time. Unfortunately since capturing the data my oscilloscope has packed in working otherwise I would see if I am getting any serial output when Sendserial from Mach3

...Sweep