Hi all Mach3 brain and modbus experts.
I am pulling my hair out of frustration... I can't control my VFD from Mach3 via modbus using brains. The problem is a fairly simple issue and hopefully it is easily solvable but for some reason I don't know/understand how. I have a Bosch Rexroth EFC5610 inverter which I would like to start/stop and set the RPM on via modbus. Nothing fancy, not even reverse running, so it supposed to be easy.
Some background of what is working:
I have no problems controlling the VFD using the "Test modbus" function in modbus configuration window. I can stop and start the VFD and send the frequency so the modbus communication is working just like I want and as described in the VFD manual.
I have also defined two configurations and set up the modbus addresses 32512 (7F00 hex) in cfg 0 and 32513 (7F01 hex) in cfg 1.
I have also managed to create a brn file for sending the frequency to the VFD, and that part is working well. Whenever I change the RPM in Mach3 or send the G-code S the brain is calculating the frequency and sends it to the VFD, the panel display changes and if I start the spindle via the control panel it spins up to that speed. In other words, the brain is working and Mach3 is communicating with the VFD, sending data trough cfg 1 to modbus data address 32513 (7F01 hex). This proves that the modbus communication is working even through the Mach3 brain.
The actual problem I need your help for.
What is NOT working is the spindle on/off control. The reason is that this VFD demands the data value 129 dec (81 hex), and 136 dec (88 hex) to stop the spindle to be sent to the modbus addresses 32512 (7F00 hex). So this makes a simple on/off control pretty complicated because I have no idea how to convert 0 to 136 (dec) and 1 to 129 (dec) and output only one value through one single termination with modbus output to the VFD, depending on Mach3 Output1 condition. I can define one of the two (stop or start) and if I define Output 1 to on and Output 2 to off then it works but I would prefer only using one Mach3 Output for the task.
I include a schematic drawing to illustrate what I would like to do, but if you have a proposal for another solution, you are welcome. I am all ears and open for any possible solution as long as modbus can be used.
Attachment 330880
Thank you for any constructive comments.