Machsupport Forum
Third party software and hardware support forums. => Modbus => Topic started by: markyparky on January 03, 2022, 07:24:48 AM
-
Hello all, may I ask other members experineced in MODBUS if it's possible to read spindle speed set via S command by Arduino via modbus? I am building a custom VFD controller and 0-10V is not a way here. All I need to do is to read the speed that is set in Mach3 either manually or in gcode so I can interpret the information further.
Thanks in advance!
-
*** Oops! I missed the part about you using Mach3 but the idea is the same ***
You mean write to the Arduino hosted holding register? Arduino's can't read but Mach4 ModBus plugin can write the value to the Arduino.
All I know is Mach4 and Lua. Which is nothing more than the following;
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "MBUS/hr0")
mc.mcRegSetValue(hreg, spindleSpeed)
You would have to look up the call to get the spindle speed but writing to a ModBus holding register is as simple as writing to any other register in Mach4.
Hope that helps.