ModTest Manual v2.11 - 1.1. Overview
ModTest is an automated test program that enables you to develop and run test suites for Modbus devices.
You can define Modbus commands together with their expected results, and send them to a Modbus slave. ModTest will automatically compare the actual results from the slave with the expected results, and flag any differences as test failures. The commands can be saved and then used as "test suite" for regression testing or for testing other slaves.
When you send a Modbus command to a slave, there are four possible outcomes:
The slave sends a normal response.
The slave sends an error response.
The slave sends an invalid response, i.e. one that is not correctly formatted.
The slave does not respond.
The slave should never send an invalid response, but each of the other outcomes may be the correct behaviour of the slave for the command that was sent.
A proper test procedure should not only check that the slave sends correct responses to correct commands; it should also check that it sends appropriate error responses to incorrect commands, and (on serial lines) check that it does not respond to broadcasts or commands to other slaves. ModTest makes it easy to perform such tests.
Before using ModTest you will need to configure the interface to the slave - see Setup overview.
Initially, you will probably want to use the Define Command page to define commands and send them to the slave. Once you are happy that a test is working correctly, you can save the command for later use.
All the command definitions that you have saved are listed in the Command Table. You can the Test All button in the Command Table run the complete sequence of defined commands.
You can modify a saved command using the Edit Command page.
When you have saved many commands (with their expected results), you can execute the whole sequence of commands automatically. This "test suite" can then be used for testing other slaves, or for regression testing to ensure that any modifications that you have made to the slave have not introduced any bugs.