Troubleshooting
Why modbus_comm_Load Done stays false on an S7-1200 G2
Short answer
A false Done on modbus_comm_Load is not yet a fault: the call may never have run, or its Error and STATUS lasted one scan and vanished before you watched them. Capture both in tags set right after the call, confirm the CM1241 firmware is V2.1 or later, and decode the stored STATUS against the instruction's error list. The decoded value, not the serial settings, names the fix.
On this page
Done staying false on modbus_comm_Load is a symptom, not the fault. Three conditions produce it: the call never executed, it is still active, or it failed and its Error and STATUS outputs disappeared one scan later, before your watch table refreshed. Work them in that order. Capture the outputs in tags first, check the communication module firmware second, and change serial parameters last. One controlled attempt with capture in place tells you which of the three you have and names the fix.
What a false Done actually means #
modbus_comm_Load configures the serial port for Modbus RTU and has to execute once, before the first Modbus_Master or Modbus_Slave call on that port. Until it reports Done, no transaction on that port starts, so everything downstream stalls behind this one output. The three conditions need different fixes:
- The call never executed: the rung in front of it stayed false, so no attempt was made and nothing can report.
- The call is still active: it reports Busy and Done arrives later; hold that attempt instead of retriggering it.
- The call failed: it reported Error and a STATUS value for exactly one scan, and online monitoring missed it.
Start by assuming the third until capture proves otherwise. The knowledge-base page on a modbus_comm_Load Done output stuck false in TIA Portal walks these same three conditions from the tool's side.
Capture Error and STATUS in the same scan #
Error exists only during the scan in which the call failed. Assume a measured scan time of 10 ms and a watch-table refresh of 500 ms. One failure scan occupies 10 ms of every 500 ms: 10 / 500 = 0.02, so a given refresh catches it about 2 percent of the time — roughly once in 50 refreshes. Watching live is not evidence; storing is.
Add three tags next to the call, with names that are examples: commLoadErrorSeen of type Bool with the initial value FALSE, commLoadStatusStored of type Bool with the initial value FALSE, and commLoadStatus of type Word with the initial value 16#0000. Place the capture immediately after the call so it reads that call's outputs:
IF modbus_comm_Load.Error THEN
commLoadErrorSeen := TRUE;
IF NOT commLoadStatusStored THEN
commLoadStatus := modbus_comm_Load.STATUS; // first failure only
commLoadStatusStored := TRUE;
END_IF;
END_IF;
Clear all three tags immediately before each controlled attempt, so a stored value cannot be a leftover from an earlier failure. Then trigger one attempt, let the scan cycle run, and read the tags: Error seen with a value stored means a real, decodable failure; no Error and no Busy means the call never ran.
Check the module firmware before any serial parameter #
With a CM1241, the instruction is only usable from module firmware version V2.1, so read the module's installed version online before anything else. If it is lower, update the module using the vendor's documented firmware update procedure and re-run the attempt; below that version the call fails no matter which baud rate or parity you set, which is why firmware comes first and serial settings last.
Also read the CPU's installed firmware online and compare it with the supported-firmware table for your engineering version: an S7-1200 G2 delivered on early firmware is a documented mismatch, fixed by the same vendor update path. Confirm that the call references the port of the module actually installed, and that only one program path calls modbus_comm_Load on that port — a second initialization path competes with the first and can hold the port busy so Done never arrives.
Decode the captured STATUS #
The meaning of the value lives in the error list of the instruction itself, matched to the revision in your project; the code is the one shown under STATUS in the Static section of the instance data. As examples from the Modbus instruction error lists: 16#8180 is an invalid value at the MB_DB parameter, 16#8186 is an invalid slave station address, and 16#8187 is an invalid value at the holding register parameter. A module-side code such as 16#81AA points at the port hardware and firmware rather than at a parameter, and the page on resolving status 16#81AA in modbus_comm_Load takes that branch apart.
A worked decode: your tags hold commLoadStatus equal to 16#8180 after one controlled attempt. That code names the MB_DB parameter, so the connection input on your Modbus_Master or Modbus_Slave instance points at the wrong instance DB. Point it at the data block of the instruction that uses this loaded port, clear the three tags, trigger one new attempt, and Done goes true. If the new attempt stores a different code, decode that one instead of stacking changes.
The decision for each case #
- No Error stored and Busy never seen: the call never executed. Fix the rung or execution condition in front of the call, clear the tags, and re-run one attempt.
- Error stored with a parameter code such as 16#8180: correct exactly the parameter the error list names, then re-test once.
- Error stored with a module-side code such as 16#81AA, or a CM1241 below the required firmware: update the module firmware by the documented procedure, then re-test.
- Done true once but transactions fail: initialization is solved, so capture the Modbus_Master STATUS the same way, in tags set right after its call — the page on why MB_MASTER on an S7-1200 returns an error status but no data covers that fault — and then check the polling load on the port, which the page on why Modbus RTU drive polling on one serial port is slow explains.
Questions asked
Do I call modbus_comm_Load every scan?
Call it once, before the first Modbus_Master or Modbus_Slave call on that port. It sets the working parameters of the interface, and a repeated call reconfigures a port that is already running, which holds the instruction active and can look like a Done that never arrives. If you need different serial parameters, change the call's inputs and trigger one new attempt, with the diagnostic tags cleared first.
Where can I see the STATUS value if I did not capture it in a tag?
The failed call shows its code under STATUS in the Static section of the instance data block while you are online, but only for the scan in which the call failed, so a watch table usually misses it. The meaning of each code is in the help page for the instruction itself, matched to the instruction revision your project uses.
What firmware does the CM1241 need for modbus_comm_Load?
The instruction works with a CM1241 only from module firmware version V2.1. Read the module's installed version online; if it is lower, update it with the vendor's documented firmware update procedure and re-run one controlled initialization attempt. Below that version the call reports an error no matter what baud rate, parity or address you set, which is why the firmware check comes before any serial parameter.
Done went true but Modbus_Master returns an error status with no data. Is that the same fault?
No. Initialization has succeeded, so the port and its configuration are proven and the failure is in the transaction. Capture the Modbus_Master STATUS the same way, in tags set right after its call, and decode it against that instruction's own list. Typical causes are a slave address or register range the device does not answer, and a polling load that exceeds what one serial port can cycle.