IMDTouchKnowledge BaseShop main store

How-to

Reading Modbus discrete input 10001 in a Vijeo HMI

HMI and touchscreens Published 5 min read

Short answer

Yes, you can read it: 10001 is the first Modbus discrete input, and %M10001 points at internal coil 10001 instead. Uncheck IEC61131 Syntax on the Modbus/TCP driver and enter 100001 in the 1x family, which equals %I1; copy the input to a %M bit only if the driver cannot reach the input table.

On this page
  1. What 10001 actually identifies
  2. Driver settings that expose the 1x family
  3. Reading input 10001 step by step
  4. Worked example: the alarm on input 10001 under Modbus/TCP
  5. When the input table stays out of reach
  6. Symptom and next check
  7. Questions asked

Yes, you can read that input, and remapping the PLC program is the last resort, not the first move. 10001 is not a memory slot: in Modbus reference notation it is the first discrete input of the 1x table, served by function code 02. %M10001 asks for internal coil 10001 of the 0x table, so it never follows the terminal. The fix on the Modbus/TCP driver in Vijeo Designer is to leave IEC61131 Syntax unchecked, keep Unit ID at 255 with low word first and low byte first, and build the alarm variable as 100001, the six-digit form of %I1. Copy the input to a %M bit only if the driver you must use exposes no input class at all.

What 10001 actually identifies #

Modbus reference numbers carry their table in the leading digit: 0x covers coils 00001 to 09999, 1x discrete inputs 10001 to 19999, 3x input registers 30001 to 39999 and 4x holding registers 40001 to 49999. Function code 02 serves that 1x table, reading 1 to 2000 contiguous discrete inputs per request. Discrete inputs are single-bit, read-only points carrying contact states, alarms and switch positions.

Family Five-digit range Six-digit form IEC form Data class
0x coils 00001 to 09999 000001 %M1 internal bit
1x discrete inputs 10001 to 19999 100001 %I1 read-only bit
3x input registers 30001 to 39999 300001 %IW1 input word
4x holding registers 40001 to 49999 400001 %MW1 internal word

%M10001 therefore resolves to coil 10001 of the 0x class, a table the physical input never touches, and %IW selects a 3x input word, which cannot hold a one-bit alarm at all. A config error on %I or %IW under a Modbus-reference driver is the editor rejecting the syntax before any request leaves the HMI. It is not evidence that the input is unreachable.

Driver settings that expose the 1x family #

One checkbox decides which notation you type. With IEC61131 Syntax unchecked, the variable editor offers the 0x, 1x, 3x and 4x families; checked, it offers %I, %IW, %M and %MW instead. The documented Modbus/TCP setup:

Setting Value What it controls
IEC61131 Syntax unchecked shows the 0x, 1x, 3x, 4x reference families in the editor
Unit ID 255 destination identifier the connection expects
Word order low word first assembly of multi-word values
Byte order low byte first byte order inside each register

Word and byte order decide how multi-word values are assembled, which is why displaying a PLC real value over Modbus turns to nonsense when they are wrong, but they never move a bit between tables, so leave them alone while fixing a Boolean alarm. Serial projects follow the same variable path; adding a Modbus RTU driver and external variables in Vijeo Designer differs mainly in the transport.

One offset to respect: if the zero-based controller option is checked, every reference is off by one, and the 984 controller counts from one.

Reading input 10001 step by step #

  1. Open the target's equipment configuration in Vijeo Designer and confirm the Modbus/TCP driver is selected.
  2. Clear IEC61131 Syntax and confirm the variable editor now offers the 0x, 1x, 3x and 4x families.
  3. Set Unit ID to 255, word order to low word first and byte order to low byte first.
  4. Create a Boolean variable in the 1x family and enter 100001. If the editor asks for a point number with the family chosen separately, that number is 1.
  5. Prove the indexing: force the intended input and one adjacent input in PLC monitoring, and watch that the neighbor does not move your variable.
  6. Put the variable on a test display with driver diagnostics visible, and wait for clean reads that track both states of the input.
  7. Assign the verified variable to the alarm without touching its polarity or acknowledgment settings, and prove the active and inactive conditions separately before the machine returns to service. A silent alarm on a running machine is a machine with no warning.

Worked example: the alarm on input 10001 under Modbus/TCP #

Inputs, each from the conversion at hand: the legacy alarm references 10001; the controller is a 984, which counts reference numbers from one and wire addresses from zero; the driver is Modbus/TCP with IEC61131 Syntax unchecked and Unit ID 255.

The rule in words: the leading digit names the table, the remaining digits are the point counted from one, and the address on the wire is the point number minus one.

The arithmetic:

  • 10001 − 10000 = 1, so the alarm watches point 1 of the 1x table, the first discrete input.
  • 1 − 1 = 0, so the function code 02 request carries wire address 0; reference numbers start at 1, wire addresses at 0.
  • 100000 + 1 = 100001, the six-digit form the cross-reference equates to %I1.
  • The wrong door, for contrast: %M10001 is coil 10001 of the 0x class, six-digit 010001, an internal bit that matches the input only if the program copies it there.
  • One bit per read sits comfortably inside the 1 to 2000 inputs that function code 02 serves.

Result: the 1x variable follows the physical input live. Decision: enter 100001 and leave the PLC program untouched; copy the input to a %M bit only when the 1x read fails against the live controller, or when the alarm must reflect processed logic rather than the raw terminal.

When the input table stays out of reach #

Some HMI and SCADA products read memory only and expose no physical I/O class under any driver; the config error then never clears. The remap is four short steps:

  1. Locate the physical input in PLC monitoring and confirm it responds under a controlled test.
  2. Pick a %M bit that the cross-reference proves unused, not one that merely looks free.
  3. Assign the input state to that bit every scan.
  4. Point the alarm variable at the 0x coil class, prove both states online, then attach the alarm.

The split between physical I/O and memory is the same line that answers why an HMI toggle switch cannot write a physical PLC input: they are different tables, and only the program can stand between them.

Symptom and next check #

  • Config error on %I or %IW: the driver speaks Modbus references. Clear IEC61131 Syntax or type the reference form.
  • Address accepted, reads fail: connection diagnostics first, then Unit ID, then the controller's table access.
  • Reads succeed but a neighbor input moves the variable: indexing. The zero-based option is shifting every reference by one.
  • Variable correct, alarm still wrong: polarity or acknowledgment settings, not addressing.

Questions asked

What table does Modbus address 10001 belong to?

10001 is the first entry of the 1x discrete-input table, which spans 10001 to 19999 and is read with function code 02. Discrete inputs are single-bit, read-only points that carry contact states, alarms and switch positions, so an HMI can display them but never write to them. The leading 1 names the table for humans; it is not a memory location.

What does %M10001 actually read?

It reads internal memory. In the cross-reference between six-digit Modbus references and IEC addresses, %M1 equals 000001, so %M10001 resolves to internal coil 10001 in the 0x class, a different table that only matches the input if your program happens to copy it there. Changing the number or padding it with zeros never moves an address between classes.

What is Unit ID 255 for?

It is the destination identifier the driver places on each request. Some controllers and gateways expect 255; a gateway can also use a different Unit ID to select one of several downstream devices. Set it to the value the connection requires, not to fix a bit-level addressing problem, because it never changes which table an address lands in.

How do I confirm the one-based offset is right?

Watch the temporary variable in the HMI while you force the intended input and one adjacent input in PLC monitoring. With the 984 family one-based convention, the correct reference follows the intended input; if the neighbor toggles your variable instead, the driver is applying a zero-based interpretation and every reference is shifted by one.

When is copying the input to a %M bit the better choice?

When the driver you must use exposes no discrete-input class at all, or when the alarm should reflect processed logic rather than the raw terminal state. The copy gives you a single HMI-facing bit you control, at the cost of one rung of PLC logic and an update that follows the PLC scan.

Keep reading

  • How-to

    Adding a Modbus RTU Driver and External Variables in Vijeo Designer

    Add one Modbus RTU equipment driver on the HMI serial port, set the baud, parity and stop bits every slave shares, and give each device a unique slave address. Then create one external variable per value, pointing it at that device and its documented register with the matching data type. Mismatched serial settings or duplicate addresses show up as read timeouts, so commission one device at a time.

    HMI and touchscreens

  • Troubleshooting

    Why HMI Indicators Stay Off Over Modbus RTU Polling

    Indicators on internal tags animate from HMI memory with no serial traffic; an indicator bound to a PLC tag needs a completed Modbus RTU read of the right address in the right data area. Confirm the PLC bit changes, then read the request and response, then fix the address at one known point.

    HMI and touchscreens

  • Troubleshooting

    Displaying a PLC Real Value Over Modbus on an HMI

    An INTEGER display that reads the register proves the link, station and address, so a blank REAL display is a 32-bit mapping fault. Declare the HMI variable as a 32-bit float on the register pair (40064/40065), set the device double-word order to Low Word First to match the PLC, and give the numeric field six integer digits for 628402.0.

    HMI and touchscreens

How to get Vijeo Designer Basic 1.1 from the official source