Hi everyone, I dont normally post on here although I get a lot of my information from these forums.
I have a problem and just can't solve it, any help or point me in the right direction would be helpful.
I have developed an Arduino - Modbus interface everything is working and data is going up and down but I cant resolve one problem, its on the MPG. This is where I am at
I have fed a rotary encoder into an Arduino2560, the Arduino does the counting up and down and the number transfers to MACH 3 and I use Brains to put the number into MPG1 count DRO.
Its the number format that has me baffled.
If I have the MPG in velocity or step/velocity or single step mode the number at rollover goes from positive, through zero and counts down -1,-2,-3 and so on just as expected of a signed integer.
If I use multi step the number goes from positive, through zero and instead of -1 it goes to 65537 (or whatever the 16 bit number is, cant remember exactly) and my axis goes off on a massive move.
The modbus reads the number as the two's compliment and passes it to the DRO, the numbers on the brains viewer does not change, but the DRO reads differently on multi step mode.
Am I doing something basically wrong in trying to get an MPG working in this way, why does MACH3 display a different number format for the same integer.
I have tried all the possible number formats in the Arduino, nothing different happens.
If I move the MPG positive and the axis positive then zero the axis the axis will then move negative as my integer starts to go down, again when I go through zere count the number goes back to 65537, as if its an unsigned integer.
Any ideas, I'm pulling my hair out, everything on my pendant and control stations are working well, just stuck on this
thanks in anticipation
servomac