ModSlaveSim help v3.07 - D. Troubleshooting

Download manual: HTML

D. Troubleshooting

D.1.1. ModSlaveSim Error: 'Inconsistent size for Coil/Discrete input'

For this you may need to refer to Map Addresses or Mapping coils/discrete inputs overlaid with holding/input registers.
  • Only 1 size of register ( e.g. 16-bit, 32-bit) is allowed within the address range defined for Coils and Discrete Inputs (see Map Addresses on SettingsEdit Settings... ). To get this error you may be adding a register that is in the range defined for coils/discrete inputs and has a different size to other registers in that range. Alternatively, you may be defining an address range for coils/discrete inputs that includes registers defined with different sizes.

  • If the address ranges overlap with input or holding Registers, then registers in the overlapped part are also restricted to one size.

  • If your slave device uses coils/discrete Inputs, ensure all are defined in ModSlaveSim with a consistent size (e.g. all int16). If your slave device does not use coils/discrete Inputs, set the number of addresses for coils and discrete inputs to 0 (Disc: No or Coil : No in Map Addresses on SettingsEdit Settings...).

D.1.2. ModSlaveSim Error: 'Address XXX is not in any address range'

For this you may need to refer to Map Addresses or Mapping coils/discrete inputs overlaid with holding/input registers.
  • The register address is not within the address range defined for holding or input registers, discrete inputs or coils (see settings in Map Addresses on SettingsEdit Settings... ). Check that you have correctly entered the address range, especially where your slave device uses a non-zero base address, or overlays coils/discrete inputs with holding/input registers.

D.1.3. ModSlaveSim Error: 'Registers XXX and XXX overlap'

  • Addresses must be unique. This error can occur when you add a register or modify the setting for Word Registers (in the Set 32/64-bit Values panel on SettingsEdit Settings... ). (see Set 32/64-bit Values).

D.1.4. Wrong value is displayed when written to by the master

  • Ensure the Type (e.g. int16) is the same as the master.

  • Check/Uncheck Little Endian ( in Set 32/64-bit Values on SettingsEdit Settings... ) to make it consistent with the master (see Set 32/64-bit Values).

  • Check/Uncheck Word Registers ( in Set 32/64-bit Values on SettingsEdit Settings... ) to make it consistent with the master (see Set 32/64-bit Values)

D.1.5. Coils: The value appears not to have been written or has been written to the wrong byte

  • Check/Uncheck C/D Swap (in Map Addresses on SettingsEdit Settings... ) to make the order of bytes of a 16-bit register consistent with the master (see Map Addresses).

D.1.6. Coils/Discrete Inputs: byte values are in reverse order in 16-bit words.

  • Check/Uncheck C/D Swap (in Map Addresses on SettingsEdit Settings... ) to reverse the order of bytes of a 16-bit register and make it consistent with the master (see Map Addresses).

D.1.7. The 16-bit words of 32 or 64-bit values are in reverse order

  • Check/Uncheck Little Endian ( in Set 32/64-bit Values on SettingsEdit Settings... ) to reverse the order and make it consistent with the master (see Set 32/64-bit Values).

D.1.8. Master receives: 'Illegal data address' error from ModSlaveSim

  • Start logging to get more information to help with the following points (see Logging).

  • Ensure that ModSlaveSim has a register defined at the correct address for the master request (see Map Addresses or Mapping coils/discrete inputs overlaid with holding/input registers).

  • Ensure that the address of the ModSlaveSim register is within the range defined ( check Map Addresses in SettingsEdit Settings...) for the Modbus type of the master command. For example, ensure it is in the coil range for a 'Read Coils' command (see Map Addresses).

  • Ensure that you press the Apply button after entering your address mapping settings (in the Map Addresses panel of SettingsEdit Settings... ).

  • If the master command is for more than one register, ensure that there are enough ModSlaveSim registers defined (check the slave register display area). If the master command is for coils/discrete inputs and they are overlaid, you might want to look at Mapping coils/discrete inputs overlaid with holding/input registers.

  • If the master command is for more than one register, ensure that the ModSlaveSim register addresses are consecutive on the slave register display area of the main dialog. However, if you are using 32/64-bit values and Word Registers is checked, then not all consecutive addresses are displayed (see Set 32/64-bit Values) Mapping coils/discrete inputs overlaid with holding/input registers if using overlaidCoils/Discrete Inputs).

  • Ensure that the Write checkbox for the register is checked (see the register display area of the main dialog) if a write command is sent from the master (see Slave Registers - DIsplay and Editing ).

D.1.9. Master receives: 'Illegal data value' error from ModSlaveSim

  • Start logging to get more information to help with the following points (see Logging).

  • Ensure that the Type of the defined register is consistent with the master (see Slave Registers - DIsplay and Editing ).

  • Check/Uncheck Word Count ( in Set 32/64-bit Values of SettingsEdit Settings... ) to make it consistent with the master (see Set 32/64-bit Values).

D.1.10. ModSlaveSim Error: 'Socket Connection Error'

Check your settings on the Edit Interface panel of SettingsEdit Settings...:

  • Ensure that the Port is not in use by any other server.

  • If ModSlaveSim is run under a Unix operating system by an ordinary user (not super-user) then the Port needs to be above 1023 and the Modbus master should be configured to use that port.

  • The address of the Host can be 'localhost' if the slave and master are on the same machine, or can be left empty to accept connections via any network interface. Otherwise check with your System Administrator for the address of your machine and modify if necessary.

D.1.11. No response from ModSlaveSim to master request over socket connection

  • Ensure Packet type is TCP (on Edit Interface of SettingsEdit Settings... ).

  • Ensure the Slave Id is consistent with the master.

  • Start logging to get more information to help with the following points (see Logging).

D.1.12. No response from ModSlaveSim to master request over serial connection

  • Ensure the Slave Id is consistent with the master.

  • Ensure a cable is connecting master and slave interfaces.

  • Start logging to get more information to help with the following points (see Logging).

Check your settings on the Edit Interface panel of SettingsEdit Settings...:

  • If master and slave are on same machine, ensure the ports are different.

  • Ensure Packet type is RTU or ASCII and is consistent with the master.

  • Ensure each of Speed, Parity, Data bits, Stop bits, RTS control is consistent with the master.

  • Ensure cable is appropriately wired if using RTS control: Flow control.

  • Ensure no other software is using the same port.

D.1.13. ModSlaveSim Error: 'Low on memory'

  • Try increasing the memory allocation by providing the -Xmx option when you run the program, for example :


                 -Xmx80m

    specifies a maximum memory allocation size of 80 megabytes. So the full command is:


                 java -Xmx80m -jar  programname.jar

    If you get a low memory error it tells you the current size, so you will need to increase memory above that size.