Machsupport Forum

Mach Discussion => Brains Development => Topic started by: magnetron on August 27, 2019, 03:19:50 PM

Title: is there a way to access puls counts of axes from within brains
Post by: magnetron on August 27, 2019, 03:19:50 PM
hello dear forum,

I want access the pulse counts of XYZ axes from within brains in MACH3

what are the relative names of the variables of pulse counts of each axes ?

for example the 10 successive pulse counts of X axes every 1/10 second
( assuming MACH3 updates 10 successive puls counts every 1/ 10 sec )

I want send this pulse counts to MODBUS TCP for own made motion card
to drive step motors 

thank you
Title: Re: is there a way to access puls counts of axes from within brains
Post by: joeaverage on August 28, 2019, 05:53:07 AM
Hi,
Mach does not work that way.

Mach3 (or Mach4) interprets Gcode and plans a trajectory. That trajectory is communicated to the motion controller
as a series of P(osition)V(elocity) over T(ime) data packets in 1 millisecond times slices.
The time slices are stacked up in a buffer, up to 250 millsecond or so long.

The motion controller, and for this purpose Machs parallel port driver is a motion controller, converts those time slices
into pulses. Mach at no time has variables that have pulse data, that is the job of the motion controller.
You do not have access to the motion controller data. In addition MODBUS is a serial communication protocol
and any sense of simultaneous pulses is lost, aside from the fact that MODBUS is way WAY WAY too slow
to communicate pulse timing.

If you wish to make your own motion controller you will need to use USB or Ethernet to get the PVT data packets and then
have your own motion control processor work out the pulse timing and generate the pulses. Its a very big undertaking.

All development of Mach3 ceased six years ago and it seems pointless to invest the sort of effort that would be required
for a software which is in its 'sunset years'. Mach4 is current and developing. If you were prepared to sign a N(on) D(isclosure)
A(greement) with NFS you could get sufficient information about Machs internal operation and the format of its PVT data
and make your own controller. Still a huge undertaking.

Is there a particular reason you want to make your own controller rather than use an off-the-shelf unit from any one of
a dozen or more different companies?

Craig
Title: Re: is there a way to access puls counts of axes from within brains
Post by: magnetron on September 01, 2019, 06:17:40 PM
first of all I wont use MODBUS RTU
I want use MODBUS TCP
second I want make my own controller in order to earn money
I dont want to write my own MODBUS TCP stack
I want use the one of MACH3
thats why I am asking if it is posible to access
step pulses from within Brains
it will make my development job easy
without necessary to write a plugin for my own board
Title: Re: is there a way to access puls counts of axes from within brains
Post by: joeaverage on September 01, 2019, 09:03:49 PM
Hi,

Quote
I want use the one of MACH3
thats why I am asking if it is posible to access
step pulses from within Brains

No, it is not possible.

Quote
first of all I wont use MODBUS RTU
I want use MODBUS TCP

RTU/TCP matters not, Modbus is serial and therefore cannot transmit pulses simeltaneously.

Quote
second I want make my own controller in order to earn money

If you wish to make money then Mach4 is going to be future....Mach3 is slowly fading away.

Craig