I am looking to modify the Modbus example module in order to communicate using a slightly different protocol. I downloaded the example from GitHub, and re-factored some of the classes to a new name for this new driver. Then I built it using mvn package, and installed it on my ignition gateway to see my progress. Later I tried using a test modbus server, which ignition would connect to, but not poll. I used ngrep to watch the communication from ignition to the modbus server, and ignition was connecting, but not sending anything out at all. Before I installed the driver that was built with Maven, the test modbus server worked well. I have ignition version 7.9.10.
Then I downloaded a fresh copy from GitHub, used mvn package to build it, and re-installed it. Then added a new device with this driver to connect to my test server, and had the same result. The tags in ignition go from Quality Disconnected, to Quality Unknown when the driver connects to my server, but it will not read the tags (have null values). Has anyone else been able to use the modbus driver from GitHub with version 7.9.10?
Another issue I have, is I am very new to Java, and I cannot find where the start/end delimeters are added to the modbus packet when it is sent out. I traced the packet generation as follows: AbstractModbusDriver defines ReadFactory/WriteFactory, which I’m guessing are used in the AbstractIODelegatingDriver. The factory will use different classes depending on the function code. Then it looks like AbstractModbusRequest will generate the packet using ModbusTCPTransport (if that’s what is selected). Then that will get the header from MBAPLayer, which get’s it from MBAPHeaderWriter in the structs package.
According to the modbus specficiation, the packet should start with a : (3A), and end with a \r\n (0D0A). It looks like when the driver receives a packet, the driver will look for these in the ModbusAddressLexer. Does anyone know where they are added to the outgoing packet? Is there any chance there will be more documentation for the functions that are extended from, such as the AbstractDriverModuleHook, or AbstractIODelegatingDriver? Thanks.