Hello Guest it is April 26, 2024, 05:48:00 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 - TPS

251
General Mach Discussion / Re: Touch script not working, Help?
« on: April 01, 2022, 03:27:37 AM »
your code should basicly work, but it is for imperial units, so if you are in metric all speeds and distances are to
smal. mado two simple version's one for imperial and one fpr metric

imperial:
Code: [Select]
'imperial
CurrentFeed = GetOemDRO(818) 'Get the current feed rate to return to later
CurrentAbsinc = GetOemLED(48) 'Get current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P5" 'this delay gives me time to get from computer to hold probe in place
Code "G90 G31 Z-2 F5" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002)'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, .192) 'set the Z axis DRO to whatever is set as plate thickness
sleep 200 'pause for Dro update.
Code "G1 Z1 F50" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If

metric:
Code: [Select]
'metric
CurrentFeed = GetOemDRO(818) 'Get the current feed rate to return to later
CurrentAbsinc = GetOemLED(48) 'Get current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P5" 'this delay gives me time to get from computer to hold probe in place
Code "G90 G31 Z-50 F50" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002)'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, 5) 'set the Z axis DRO to whatever is set as plate thickness
sleep 200 'pause for Dro update.
Code "G1 Z10 F500" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If

252
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 31, 2022, 12:20:55 PM »
OK if you think i did not understand the real problem, it is ok for me. i am out.

good luck anyway

253
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 31, 2022, 05:45:59 AM »
looks like i am writing Swahili ??

IF YOU WILL USE MODBUS THE DATA WILL BE COMPLETLY DIFFERENT THAN IN MY EXAMPLE

254
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 31, 2022, 04:56:39 AM »
0x1E  0x?? 0x0D where ?? is the toolnumber

based on this code for M6Start:

https://www.machsupport.com/forum/index.php?action=dlattach;topic=1658.0;attach=1174

and again that has nothing to do with Modbus Communication you mentoined to use.

255
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 31, 2022, 04:12:14 AM »
i am still not realy sure wether you what to use Modbus communication or the serial communication of the
sample i posted.

in case of the sample i posted the reveive data will look like this:

Startsign (Hex 1E) + toolnumber + CR (Hex 0D)

or

0x1E  0x?? 0x0D where ?? is the toolnumber

in case of you are using modbus, i have no experience what data would look like.

256
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 31, 2022, 02:20:27 AM »
yes sure, but you should keep in mind, that there is no chance to check the received data for validity.
i think there must be a minimum of safety check. otherwise , if you only have one single character (1-12)
the ATC will start a toolchange even if the data was caused by a electrical noise ore so.
that is one of the most important reasons why dataframes (at least modbus does the same) have been
created/established.

just a thinking.

257
VB and the development of wizards / Re: edit macro
« on: March 30, 2022, 02:09:42 AM »
Code: [Select]
Dim FileName As String
FileName = AskTextQuestion("Please enter file name:")

Open "C:\LAVORI\SCANSIONE\" &FileName &".TXT" For Output As intNum ' Open to write file.



258
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 29, 2022, 12:01:09 PM »
ok, i see you will use modbus for communication with your Arduino, than you can forget about the code sample
i posted. this will only work as a simple serial interface without modbus framing.

for modbus you have to set up modbus in Mach3 and the used In/Out registers.

259
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 29, 2022, 02:18:02 AM »
the code of the posted example:

https://www.machsupport.com/forum/index.php?action=dlattach;topic=1658.0;attach=1174

will send a small string via SendFifo() witch is an undocumented Mach3 VB script function.
this string will contain: 

StartSign (Hex 1E) + toolnumber + CR (Hex 0D)

witch "gives" the Adrduino a minimum chance to check the received data for validity.
than it will wait for a response (Hex B6) to know that Arduino has "understand" the order.

sorry but can not "assist" on Arduino side.

260
General Mach Discussion / Re: Arduino - Mach 3 - Gcode M6 T0101
« on: March 28, 2022, 12:05:15 PM »
might be interesting:

https://www.machsupport.com/forum/index.php?topic=1658.0

but the question is why using a arduino to control the ATC. IHMO there can be nothing on a ATC
what Mach3 can not control itselve via a VB Script.