Hi,
I need some help from people with greater knowledge of Modbus. I have had sucess reading data from the controller using function 3, READING HOLDING REGISTRIES but have not been able to write to the controller using function 6, SET SINGLE REGISTRY. When I try and write a value, I get back 'exceptional error'.
I send:
01 03 00 9B 00 01 F5 E5
And get back
01 03 02 08 00 BF 84
Which tells me that the parameter 155 Battery Current limit is 0800 so 2048 which divided by the scale 40.96 gives me 50% which agrees with what the manufacture supplied BACDoor software tells me.
I try and write a new value such as 100% which is 4096 so 1000.
I send
01 06 00 9B 10 00 F5 E5
I get back
01 86 01 83 A0
Which is an exceptional response with 01 being an illegal function.
The documentation http://www.accelerated-systems.com/KB/?p=552 says that I should be able to read and write this parameter. The BACDoor software permits me to modify the parameter.
Why does directly sending the command not work? Does the BACDoor software go 'Simon says' before sending a 'write' command?
Background:
The BAC 2000 controller http://www.ebikes.ca/shop/electric-bicycle-parts/controllers/c-bac2000.html from Grin Technologies is very flexible and seems to be doing everything I want well. I am running it sensorless with an Astro 3220 motor. It is an FOC controller and cousin to Grin Technologies excellent Phaserunner controllers.
Both controllers use Modbus over a simple serial connection to communicate. I am trying to leveraging that ability to set up an Arduino board to read information and adjust the controller on the fly. Grin Technologies already offers the CA3 http://www.ebikes.ca/product-info/cycle-analyst-3.html which will satisfy most people's needs but for electrathon racing, I need more control.
Any suggestion?
I need some help from people with greater knowledge of Modbus. I have had sucess reading data from the controller using function 3, READING HOLDING REGISTRIES but have not been able to write to the controller using function 6, SET SINGLE REGISTRY. When I try and write a value, I get back 'exceptional error'.
I send:
01 03 00 9B 00 01 F5 E5
And get back
01 03 02 08 00 BF 84
Which tells me that the parameter 155 Battery Current limit is 0800 so 2048 which divided by the scale 40.96 gives me 50% which agrees with what the manufacture supplied BACDoor software tells me.
I try and write a new value such as 100% which is 4096 so 1000.
I send
01 06 00 9B 10 00 F5 E5
I get back
01 86 01 83 A0
Which is an exceptional response with 01 being an illegal function.
The documentation http://www.accelerated-systems.com/KB/?p=552 says that I should be able to read and write this parameter. The BACDoor software permits me to modify the parameter.
Why does directly sending the command not work? Does the BACDoor software go 'Simon says' before sending a 'write' command?
Background:
The BAC 2000 controller http://www.ebikes.ca/shop/electric-bicycle-parts/controllers/c-bac2000.html from Grin Technologies is very flexible and seems to be doing everything I want well. I am running it sensorless with an Astro 3220 motor. It is an FOC controller and cousin to Grin Technologies excellent Phaserunner controllers.
Both controllers use Modbus over a simple serial connection to communicate. I am trying to leveraging that ability to set up an Arduino board to read information and adjust the controller on the fly. Grin Technologies already offers the CA3 http://www.ebikes.ca/product-info/cycle-analyst-3.html which will satisfy most people's needs but for electrathon racing, I need more control.
Any suggestion?