In the M6Start macro you can use the vbcript function GetSelectedTool() and save it in a userdro.
setuserdro(2001)=getselectedtool()
In the arduino sketch 40 regs are already assigned while we are using just two of them regs[0] and regs[1] for reading analog inputs on pins A0 and A1. These regs are passed on to Mach3 brain as input-holding.
Now you'll have to define new config as output-holding and assign an address of 10 and number of registers 1. In the brain you add the new rung with userdro as the input and the modbus output register as the terminal.
The value of userdro(2001) will reflect in the arduino as regs[10].
I hope you got some hold of this confusing technique.
Zafar
Hi Zafar,
Thank you for the quick reply.
The new fields that I add assume needs to be Output holding?
I have never made a userDRO before, I will watch a couple of youtube videos that might enlighten me.
I know how to make a brain based on your tutorial but have no idea what functions to use for this?
the m6start macro I could do. How do I change the arduino sketch to receive the inputs and can this still be done using the USB or do i need a RS232 to USB converter and use serial 1,2 or 3 on the arduino? I am completely lost.