Modsak Manual v3.15 - 5.1.1. Standard commands

Download manual: PDF HTML

5.1.1. Standard commands

The Standard commands in the Command Type drop-down list provide a low-level interface for sending Modbus commands to a slave.

These standard command pages make no use of any register definitions you may have entered, nor do they use or affect the register display area. All transferred values are displayed in the page itself.

The following fields are common to several of the pages:

  • Slave ID. The Slave ID is what is called the "slave address" in the original Modbus specification, and is called the "unit identifier" in the Modbus/TCP specification. It should be in the range 0 to 255.

    A zero slave identifier is used in write requests as a broadcast identifier (each slave that receives the message should store the values supplied in the request, but should not normally send a response). The serial specification limits the range of slave identifiers to 0 to 247, for no apparent reason. The Modbus/TCP implementation guide suggests that Modbus/TCP slaves that can be uniquely identified by their IP address should use slave identifier 255.

    You may enter a slave identifier that is different from the slave identifier configured in General settings. In particular, you may enter 0 for the slave identifier in order to send broadcast messages.

  • Address. Address of the first register to be transferred, in the range 0 to 65535. You should enter message addresses into these pages - the Address mapping settings are not used.

    The manuals for many Modbus devices adopt the confusing convention of adding an offset to Modbus addresses to indicate the type of variable:

    Variable type Offset
    Coil 1
    Discrete Input 10001 or 100001
    Input Register 30001 or 300001
    Holding Register 40001 or 400001

    The manuals for some Modbus devices simply add an offset of 1 to all addresses, so that, for example, "Holding Register 123" would have an address of 122.

    Modsak requires actual Modbus addresses (as sent in Modbus messages), so you may have to subtract the appropriate offset from the addresses in device manuals.

  • Count. Enter the number of values to be transferred - for example, if you want to transfer five 32-bit floating-point values you should enter 5. Note that this count may be different from the number of registers and may also be different from the count that is actually sent in the Modbus message (the settings for 32/64-bit Value Settings are used to convert the count if necessary).

  • Type. The type (signed integer, unsigned integer, or floating-point) and size (1, 8, 16, 32 or 64 bit) of the value(s) to be transferred. You would normally use Int 16 or Uint 16 for holding registers and input registers, and Discrete (i.e. 1-bit integer) for coils and discrete inputs - the other sizes are non-standard.

  • Radix. The radix to be used to display the value(s). The radix only affects the display of unsigned integer values; floating-point and signed integer values are always displayed in decimal.

For most commands, the other fields that need to entered should be obvious if you read the appropriate description in the current Modbus specification. The following sections describe the few cases that may not be obvious.