Hello Guest it is March 19, 2024, 07:45:58 AM

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: 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.

252
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.

253
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.



254
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.

255
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.

256
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.

257
Machscreen Screen Designer / Re: Box Joint Wizard
« on: March 25, 2022, 03:19:03 AM »
ok, let's say you place a dro for example OEMDro(1250) to your screen.
then you put a transparent button over this DRO and this will excecute the VB Script.
the code for this button would be:

Code: [Select]
Sub Main
Call NumericKeyboard(1250,0,999)

End Sub


#Expand "c:\Mach3\macros\Mach3Mill\numerickeyboard" 



with this you should be able to enter a value into DRO 1250

the you place a normal button also with VBscript to do the entire move code:

Code: [Select]
  Code "G1 Z" &GetOEMDRO(1250) &" F200"
and thats it.

258
i think a good start would be to studdy some manuals:

https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf
https://www.machsupport.com/wp-content/uploads/2013/02/VBScript_Commands.pdf

a simple search in the forum for M6Start macro will bring up a lot of sample script's and a lot of
samples to copy and paste.

259
brains will not be the way you are looking for. if your Arduino wil accept ModBus you can find a lot about modbus
here on the forum. also a complete sample for modbus arduino communication is in the modbus aeria.

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

for a simple serial output you can use VBScript.

from the manual:

SendSerial
Sub SendSerial(Data As String)
This function send the String Data to the serial port specified in the Config-
>GeneralConfig serial port configuration. This provides transmit-only capability, at any
supported BAUD rate.
Arguments:
String message to be sent to configured serial device
Return Value:
None
Example:
‘ Send “Hello, world!” to serial device
SendSerial(“Hello, world!” & chr(10) & char(13))
See also:

260
VB and the development of wizards / Re: M6Start macro problem
« on: March 23, 2022, 04:45:28 AM »
just for a simple test

Code: [Select]
  Code "G53 G0 Z-50"
  While IsMoving()
  Wend
  Code "G53 G0 Z-100"
  While IsMoving()
  Wend

i have used code like this in many of my macros