Hello Guest it is April 19, 2024, 08:52:18 AM

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

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #10 on: September 13, 2012, 11:46:20 AM »
In Mach3 you have a serial monitor you can setup.

I think what you want to use is event driven serial as it stays open and active the entire time MAch3 is active.  The others open and close the session each time it is called.  Also there is VERY little info on the serial side of Mach3.

First make SURE you have the MAch3 serial setup the same way you have hyperterm set up.

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #11 on: September 13, 2012, 03:00:05 PM »
Will do.
A strange thing happened when I edited the vbscript in Mach was that Mach3 needed a restart as everything froze. Very strange.
Managed to borrow a digital oscilloscope from work so will try and capture what is being sent.
Thanks for your help so far TP.

...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #12 on: September 13, 2012, 04:51:02 PM »
In reallity the scope will not help much (;-).

Try using the Mach3 serial monitor it should show what is going in and out of the port. I think once you get the serial port setup in mach3 it may do as you need

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #13 on: September 14, 2012, 04:01:02 PM »
Using the scope I can see the string of code being sent in Hyperterminal so have tried to replicate the same string in Mach.
I have managed to run the ATC from Mach even though the string wasn't identical; I think this is to do with the intercharacter delay.
The problem is that Mach seems to be pretty unreliable though!
I have used operator/edit button script to add code to the Ref All Home (RAH) button but when i add code SendSerial("D44") the whole of Mach 3 locks up and the "normal Condition" LED changes to "Abnormal Condition"?
I press RAH but nothing happens
If i then enter a tab menu, say "about Mach3" and then exit that menu all the dorment commands, e.g. RAH, are executed in series. So if iv'e pressed RAH three times it exwcutes it three times.

very strange ...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Where to start?
« Reply #14 on: September 15, 2012, 11:13:09 AM »
OK when it went abnormal did you click on it to get the message??

It is best to test from the editor screen. That eliminates all outside mach3 interference. When you get it working there THEN you work out the other kinks.

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: Where to start?
« Reply #15 on: September 15, 2012, 02:45:39 PM »
Yes. It mentioned something about axis not properly datumed. I got a reply on the General Forum which more or less said disregard it as it detects things that are unusual, and as I started messing with the code then this was to be expected.
Anyway, good news! Not sure how or why but the SendSerial command is now working fine so I started experimenting with a little bit of coding on the RAH switch which works well.

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

Sleep(100)
While IsMoving()
   Sleep(100)
Wend

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

SendSerial("B0000133E167R25")
Sleep 3000
SendSerial("D44")
 

The first SendSeial is to check whether air is present and the D44 datums the carousel stepper motor.
I dont think the DoOEMButton 133, 134 and 135 are used as I don't have encoders fitted so I will delete these tomorrow and see if all works well. I will also remove the 2nd Sleep command and replace it with an input from the ATC that runs D44 when the ATC relay changes over after the first procedure completes.

With my new found confidence, and with many thanks to you TP, i have started to work on my Toolchanger screen for Mach3. I have tested the basic commands and they work too. Yippee!
The next big question is whether to have my tool offsets held within Mach or my CAM program. My first thought was to have them within Mach so I could use the machine manually as well as fully automatic but i wasn't sure if the CAM will try and bring across tool offsets of, say zero, when I load the Gcode?