Explainer
Why a PROFIBUS input word cannot stay retentive on an S7-1200
Short answer
No: the PROFIBUS input words on the S7-1200 are refreshed by the bus on every cyclic transfer, so they cannot be retentive. The mapping is right — QW2 on the S7-1200 arrives as IW2 on the S7-300 and QW2 on the S7-300 arrives as IW2 on the S7-1200 — so write to the output area, keep restart-persistent values in a retentive tag or data block, and accept received words only while communication is valid.

On this page
Your direction reading is right, and your retention plan cannot be made to work — not because the configuration is wrong, but because a PROFIBUS input word on the S7-1200 is refreshed by the bus on every cyclic transfer, so there is nothing for retention to hold. Write transmitted values to the output area and read received values from the input area, exactly as your QW2 and IW2 pairing does. Keep anything that must survive a restart in retentive internal memory — a tag the CPU retains or a variable in a retentive data block — and copy a received word into that storage only while cyclic exchange is running. The sections below confirm the mapping, explain the mechanism that makes the input image non-retentive by design, trace one word through the exchange byte by byte, and end with the storage decision for each case.
The mapping between the two stations is correct #
With the CM 1242-5 as the DP slave and the S7-300 as the master reading the module's GSD description, the two stations view the same exchange from opposite sides. On the S7-1200 you transmit through the 32-byte output area Q1..Q32 and receive through the 32-byte input area I1..I32; on the S7-300 the same areas are configured reversed, so it transmits through its Q1..Q32 and receives through its I1..I32. The correspondence you observed holds: QW2 on the S7-1200 lands at IW2 on the S7-300, and QW2 on the S7-300 lands at IW2 on the S7-1200. The correction is in the verb, not the address: an application write always targets the local output word, because the next cyclic transfer replaces whatever the program places in an input word. Writing IW2 on either CPU therefore has no lasting effect.
The slave side of this pairing follows the same setup pattern as in S7-1200 CM 1242-5 DP slave to an S7-400 PROFIBUS master, and the areas you defined are the ones detailed in What I-Slave transfer areas an S7-1200 CM 1242-5 slave must publish.
Why a cyclic input word cannot be retentive #
Cyclic data exchange, the operating mode PROFIBUS DP defines in IEC 61158, is a continuous, repeating trade: each bus cycle the master delivers its output block to the slave and reads the slave's input block back. Input and output are per-station views of the same two blocks, so the CM 1242-5 rebuilds the S7-1200's input image on every transfer. That makes IW2 a live window onto the S7-300's QW2, owned by the bus rather than by your program.
A word the bus owns cannot also belong to retentive memory. Between two cycles IW2 already holds exactly what the peer last sent, and the next transfer overwrites it, so a manual write to an input word survives at most until the next process-image update. Retentive memory on the S7-1200 is a different object: internal memory configured to keep its content through a power cycle and the restart that follows, and it applies to internal tags and data-block variables, never to the process image. That is why the tag editor offered you no Retain checkbox — the candidates for retention are internal memory locations, and a bus-owned input address is not one of them.
Worked example: the word A5C3 sent from QW2 on the S7-1200 to IW2 on the S7-300 #
The inputs and where each comes from #
Three inputs. The transfer areas come from this pairing's configuration: 32 bytes in each direction, Q1..Q32 out and I1..I32 in on the S7-1200, mirrored reversed on the S7-300. The word placement follows from the value sitting at byte offset 2, so it occupies offsets 2 and 3. The test value is A5C3 in hexadecimal, an example value chosen for this test; its decimal equivalent is computed below.
The rule in words #
A word placed at byte offset 2 occupies offsets 2 and 3, high byte at the lower offset, and both CPUs read the pair in that order, so the word value crosses the bus unchanged: what one CPU holds in its output area at offsets 2 and 3, the other finds in its input area at the same offsets after the next cyclic transfer. The path from a DP byte offset to a local input address is the one described in How PROFIBUS DP byte offsets become S7-1200 input addresses.
The arithmetic #
Write A5C3 into QW2 on the S7-1200: byte offset 2 then carries A5 and byte offset 3 carries C3. In decimal, A5 is 165 and C3 is 195, so the word reads 165×256 + 195 = 42,240 + 195 = 42,435; the hexadecimal expansion agrees: 10×4096 + 5×256 + 12×16 + 3 = 40960 + 1280 + 192 + 3. On the next cyclic transfer the S7-300 reads 42,435 at its IW2.
The result and the decision #
Now cycle power on the S7-1200. The input image restarts at 0, and IW2 stays at 0 until the S7-300 transmits again and cyclic exchange resumes — no part of the input area carried the word through the outage. The retentive copy does: if the program had moved 42,435 into a data-block variable with retention enabled before the power cut, that variable reads 42,435 again at startup. Decision: a value that must be readable after a restart belongs in the retentive copy, never in IW2; IW2 is read only as live data while the bus is exchanging.
Where the retentive copy lives #
Two documented places hold a restart-persistent value on the S7-1200: an internal tag inside the CPU's retentive memory, and a variable in a global data block. Depending on the block's access setting, you define the retentive state either for individual tags or for all tags of the data block, so a standard-access block lets you persist exactly the variables that need it. If the PLC tag editor offers no Retain selection for a tag, the tag lies outside the retentive memory the CPU provides; move the value into a data block and mark the variable there. That absence is not a communication fault, and no GSD or bus parameter changes it. For keeping data-block values intact across downloads and restarts, see Preserve actual values in S7-1200 and S7-1500 data blocks.
Accept a received value only while the bus is live #
Startup needs an explicit rule because two memories hold values at that moment: the retentive copy holds the last accepted value, and IW2 holds 0 until the S7-300 transmits again. Decide which one may drive the application. Copy IW2 into the retentive variable only while cyclic exchange is running and the operating state permits a new value, and give each output word one owner — a single network or block writes QW2, so startup logic and cyclic logic cannot overwrite each other.
Keep persistent settings such as setpoints separate from momentary commands such as pulses, and gate the restore: a retentive copy must never bring back a start, a motion, or a permissive on its own — the machine's operating state has to allow it before a stored value reaches an output.
The decision for each case #
For a word you transmit, write the local output word: QW2 on the S7-1200 for the S7-300 to read at IW2, QW2 on the S7-300 for the S7-1200 to read at IW2, and never write an input word. For a word that must survive a restart, keep a retentive tag or a retentive data-block variable and refresh it from the input word behind the communication-valid gate. For a word that is only live status, read the input word every scan and let the bus own it — non-retentive is the correct condition there, not a defect to fix.
Questions asked
Why is there no Retain checkbox for a tag in the PLC tags editor on the S7-1200?
Retention is offered only for tags inside the retentive memory the CPU provides, and an input or output address is a bus-owned process-image location, so it never appears with that selection. Keep the received value in an internal tag or a global data block variable that is marked retentive, and treat the missing checkbox as confirmation of bus ownership rather than a fault.
What does IW2 show on the S7-1200 while the PROFIBUS link is down?
The communication processor stops refreshing the input image, so the word holds the last bytes that arrived; after a CPU restart the input image comes back at 0 and stays there until the S7-300 transmits again. In both cases the word carries no validity information, so check the communication status in the logic before a value from IW2 is accepted.
Does the S7-300 side need the same retention handling?
Yes. Its input words are refreshed every bus cycle from the slave's output block, so they are bus-owned exactly like the S7-1200 side. Keep restart-persistent values in that CPU's retentive memory as well, and gate acceptance the same way; the only difference is direction, since each station reads at the input offset what the peer writes at the matching output offset.
Is the 32-byte transfer area size a PROFIBUS requirement?
No. The 32-byte areas are the sizes configured for this pairing on both stations; the transfer length is part of the configuration, and the working rule is that both stations agree on each direction's length and offsets. Keep every word inside the agreed area and give each byte one producer, or word values will overlap and read as garbage.

