41
General Mach Discussion / Re: Modbus spindle control questions...
« on: November 07, 2011, 07:12:42 AM »
Hopefully someone can chime in and help with our Brain logic.
Modbus - I verified with an external program that I can send the following commands and the VFD acts as expected.
Register 40271 = 1 'VFD Runs in Forward
Register 40271 = 3 'VFD Runs in Reverse
Register 40271 = 0 'VFD Stops
In Mach, Modbus Serial Config -> Test the above also works.
I configured the Modbus Serial Plug In properly because in the VB Editor I can do the following and they all work...
SetModOutput (0,1) 'Forward
SetModOutput (0,3) 'Reverse
SetModOutput (0,0) 'Stop
How I'm trying to do the Brain that is eating my lunch is.....
Spindle CW ON -> Formula (f)Output = 1 -> Modbus/Address 0, Output,Serial Plugin, Cfg 0
Spindle CCW ON -> Formula (f)Output = 3 -> Modbus/Address 0, Output,Serial Plugin, Cfg 0
The above allows the spindle to run in forward. Reverse does not work, and turning off the spindle does not work.
I also tried writing to an individual bit, but I read that was broken in brains.
Spindle CW ON -> No Op -> Modbus/Address 0, Output, Bit Only, Bit 0,Serial Plugin, Cfg 0
Spindle CW ON -> No Op -> Modbus/Address 0, Output, Bit Only, Bit 1,Serial Plugin, Cfg 0
The above allows forward and stop, however Reverse just stops the spindle.
So it appears my logic using formulas does not work as I intended. I know most of the hard stuff is done and I'm just having a hard time figuring out how to write the brain where it behaves properly.
Any help would be so much appreciated.
Richard
Modbus - I verified with an external program that I can send the following commands and the VFD acts as expected.
Register 40271 = 1 'VFD Runs in Forward
Register 40271 = 3 'VFD Runs in Reverse
Register 40271 = 0 'VFD Stops
In Mach, Modbus Serial Config -> Test the above also works.
I configured the Modbus Serial Plug In properly because in the VB Editor I can do the following and they all work...
SetModOutput (0,1) 'Forward
SetModOutput (0,3) 'Reverse
SetModOutput (0,0) 'Stop
How I'm trying to do the Brain that is eating my lunch is.....
Spindle CW ON -> Formula (f)Output = 1 -> Modbus/Address 0, Output,Serial Plugin, Cfg 0
Spindle CCW ON -> Formula (f)Output = 3 -> Modbus/Address 0, Output,Serial Plugin, Cfg 0
The above allows the spindle to run in forward. Reverse does not work, and turning off the spindle does not work.
I also tried writing to an individual bit, but I read that was broken in brains.
Spindle CW ON -> No Op -> Modbus/Address 0, Output, Bit Only, Bit 0,Serial Plugin, Cfg 0
Spindle CW ON -> No Op -> Modbus/Address 0, Output, Bit Only, Bit 1,Serial Plugin, Cfg 0
The above allows forward and stop, however Reverse just stops the spindle.
So it appears my logic using formulas does not work as I intended. I know most of the hard stuff is done and I'm just having a hard time figuring out how to write the brain where it behaves properly.
Any help would be so much appreciated.
Richard