How-to
Configuring S7-300 PROFIBUS control for an MM420 drive
Short answer
Hardware configuration alone moves no drive data. An S7-300 reads and writes an MM420's cyclic PROFIBUS area with SFC14 and SFC15 whenever the consistent area is too large for direct access, maps every control-word and status-word bit to the configured telegram, and switches the drive's command and setpoint sources to the fieldbus before the first enable. Judge drive readiness from the status word, not from a completed bus transfer.
On this page
- PROFIdrive is a telegram layout, not an algorithm
- Configure the consistent area first
- Write the cyclic exchange with SFC14 and SFC15
- Map the control word and status word to the telegram
- Point the command and setpoint sources at the bus before the first enable
- Judge bus health separately from drive readiness
- Worked example: access method for a 4-byte MM420 telegram at address 20
- Decisions to carry forward
- Questions asked
Hardware configuration alone never moves a speed reference to an MM420. The PROFIBUS telegram the S7-300 exchanges with the drive carries a control word, a speed setpoint, a status word and an actual value, and your program has to move those words itself: read and write the configured cyclic area with SFC14 DPRD_DAT and SFC15 DPWR_DAT whenever the consistent area is too large for a direct access, map every control-word and status-word bit to the telegram you selected, and switch the drive's command and setpoint sources to the fieldbus before the first enable. PROFIdrive is the telegram layout behind those words, not an algorithm block you can pull out of the configuration. The steps below run from the consistency setting in the hardware configuration to a motor that starts on a bus command and stops predictably.
PROFIdrive is a telegram layout, not an algorithm #
The PROFIdrive profile defines how drive commands and feedback are represented inside a fieldbus telegram; it does not add code to your project. Everything it gives you is visible in the hardware configuration: the telegram you select for the MM420's PROFIBUS option module arranges an optional PKW parameter channel — the section that can read or write any drive parameter over the bus — plus the PZD process data, where the control word and speed setpoint travel toward the drive and the status word and actual value travel back. There is no PROFIdrive function to extract; the PLC side is the two system calls that move the area, plus your own bit logic that builds the control word and judges the status word. Size the receive and transmit buffers to the selected telegram exactly, and keep the input and output layouts separate even when their lengths match.
Configure the consistent area first #
Insert the drive as a DP slave with the module row that matches the installed option module, and set consistency over the entire area, not word by word — the Siemens consistent-data documentation names exactly this setting as the configuration error behind failed transfers. Then write down the logical start address and length of the input and output areas; the SFC calls need both.
The access rule is documented and has a hard threshold: consistent slave data of more than 4 bytes must move through SFC14 DPRD_DAT and SFC15 DPWR_DAT, because only a system call copies the whole area as one unit; at 4 bytes or fewer, plain load and transfer instructions on the peripheral bytes are allowed. On the latest S7-300 CPU generation, one such call moves up to 128 bytes consistently, so a drive telegram never comes near the ceiling. The mechanics of the two calls are the same at any legal length, and how SFC14 and SFC15 handle consistent PROFIBUS data is worth a read if this is your first DP slave.
Also note what the configured module address means: the SFCs address the module inside the CPU's process image, and a configured address that lands outside the process image leaves a station that is detected but reading no I/O data — the same failure class behind Fix an S7-300 PROFIBUS gateway detected but reading no I/O data.
Write the cyclic exchange with SFC14 and SFC15 #
These two calls are the whole data path. Run them every scan in your cyclic program, and build the enable logic on top of them.
- Allocate a receive and a transmit buffer as byte arrays sized to the configured input and output lengths, and keep them separate. A walk-through of a 16-byte consistent transfer with SFC14 and SFC15 shows the buffer and record plumbing step by step if you want a worked pattern.
- Call SFC14 DPRD_DAT every scan with LADDR set to the configured logical input start address and RECORD pointing at the receive buffer. Store the return value.
- Compose the transmit buffer from your own command state: control word in the first PZD word, speed setpoint in the second, in the order the selected telegram defines.
- Call SFC15 DPWR_DAT with LADDR set to the configured logical output start address and RECORD pointing at the transmit buffer. Store the return value.
- Treat any nonzero return value as invalid data: stop building on the receive buffer, and never keep re-sending stale status as if it were fresh feedback.
- Never pass the PROFIBUS station address as LADDR. The calls address the module in the process image, not the slave on the wire — substituting the station number is an addressing error, not a drive fault.
A completed call proves the CPU accepted the transfer. It does not prove the drive accepted the enable or that the motor will run; that judgement comes from the status word.
Map the control word and status word to the telegram #
On the MM420, the first PZD word toward the drive is the control word and the first word back is the status word; each bit has a fixed meaning and the drive reacts to the pattern, not to a magic total. The bits that matter for commissioning: bit 0 is the ON command (clearing it ramps the drive down — OFF1), bit 1 is OFF2, whose removal coasts the motor, bit 2 is OFF3, the quick stop, bit 3 enables the output pulses, bit 7 acknowledges a fault, and bit 10 hands control to the bus — until it is set, the drive ignores your commands. The status word mirrors this: bit 0 ready to switch on, bit 1 ready to run, bit 2 running, bit 3 fault active, bit 6 switch-on inhibit, bit 7 warning active.
The standard sequence: write 16#047E (bus control, pulses enabled, no ON), wait until the status word reports ready, then write 16#047F to set ON. Clearing bit 0 back to 16#047E ramps the motor down; 16#0000 removes everything. The setpoint rides in the second PZD word, normalized so that 16#4000 means 100 percent of the drive's reference frequency — 16#2000 is half speed. Gate each transition on the returned status, never on the value you just sent.
One safety note belongs here: commission the enable sequence with the load uncoupled or the machine guarded, because the first 16#047F that reaches a correctly wired drive will start the motor.
Point the command and setpoint sources at the bus before the first enable #
A bus connection in perfect health still does not control a drive whose command source is set to the terminals. In the MM420's parameter list, find the command-source selection — the parameter that decides where ON, OFF and direction commands come from — and the setpoint-source selection — the one that decides where the speed reference comes from — and set both to the fieldbus/COM link. Both are editable at the keypad or through the PKW channel once the bus is up. If you would rather work through a PC commissioning tool over the same bus, that path is its own setup; Connecting STARTER to a PROFIBUS drive through an S7-300 covers it. The decision is binary: both sources on the bus, or the drive keeps obeying its terminals while your control word does nothing.
Judge bus health separately from drive readiness #
Two clocks run at once: the bus cycle and the drive's state machine. A clean return value with an all-zero status word is normal before handover, and a set fault bit with clean bus transfers is a drive problem, not a network one. Sporadic nonzero return values point at the bus side — termination at the true segment ends, shielding, connector strain — and the same fault pattern is walked through for intermittent PROFIBUS dropouts on an S7-400 network. Also decide the drive's reaction to a lost bus deliberately: choose a controlled ramp rather than a coast unless a coast is safe for your load, and make the PLC put its outputs into a defined stop state whenever the SFC return values go bad.
Worked example: access method for a 4-byte MM420 telegram at address 20 #
Inputs, each with its origin:
- Telegram: two PZD words each way — control word and speed setpoint out, status word and actual value back. This is the drive's smallest cyclic telegram, selected in the hardware configuration.
- Addresses: the output area starts at QW20 and the input area at IW20, as configured in the hardware configuration of the project; the byte lengths follow from the telegram.
- Rule (documented for DP consistent data): more than 4 bytes per area requires SFC14 and SFC15; 4 bytes or fewer may also be accessed with plain load and transfer instructions.
- Ceiling: 128 bytes per SFC call on the latest S7-300 CPU generation, relevant only if the SFCs are used.
The rule in words: compare the byte length of each configured area against the 4-byte threshold; above it, the SFC pair is mandatory; at or below it, direct peripheral access is legal.
Arithmetic: output bytes = 2 words × 2 bytes per word = 4 bytes; input bytes = 4 bytes the same way. Threshold test: is 4 more than 4? No — the SFC requirement does not trigger, so direct peripheral access through PQW20/PQW22 and PIW20/PIW22 is legal at this size. If you use the SFCs anyway: 4 ≤ 128, comfortably inside the per-call ceiling.
Result: at exactly 4 bytes, both access methods are legal.
Decision: the moment the telegram grows past the 4-byte threshold — by adding the PKW parameter channel or a larger process-data selection — SFC14 DPRD_DAT and SFC15 DPWR_DAT become mandatory. Use the SFC pair from the first line of code: one call sends the control word and setpoint as a single consistent unit toward the drive, and the same code survives a bigger telegram without a rewrite.
Decisions to carry forward #
- Set consistency over the entire module area; the word-by-word setting is the documented configuration error behind failed transfers.
- Move cyclic data with SFC14 and SFC15 — mandatory above the 4-byte threshold, and the cleanest choice below it.
- Build the control word bit by bit against the selected telegram, wait for the ready state in the status word, then set the ON bit; never enable on a value the drive has not confirmed.
- Switch both the command and the setpoint sources to the fieldbus before the first enable; otherwise a healthy bus coexists with a terminal-controlled drive.
- Gate every state change on the returned status word, and treat a nonzero SFC return value as invalid feedback, never as a reason to keep the last values.
Questions asked
Can I use MOVE instructions instead of SFC14 and SFC15?
Yes, while the configured consistent area stays at 4 bytes or fewer per direction, which covers the two-word telegram. Above that, only a system call copies the area as one unit, so DPRD_DAT and DPWR_DAT are mandatory. Two separate peripheral writes can also be split by a bus cycle, letting the drive see a new control word with the old setpoint; one SFC15 call removes that seam.
What does the LADDR input of SFC14 and SFC15 take?
The logical start address of the configured module area in the process image, entered as an even byte address — 20 for an output area beginning at QW20. It is never the PROFIBUS station address set on the drive or in hardware configuration. A wrong value does not touch the drive: the call returns a transfer error and leaves the record buffer unchanged, which is why the return value needs checking on every scan.
How much consistent data can one SFC call move on an S7-300?
On the latest S7-300 CPU generation, one SFC14 or SFC15 call moves up to 128 bytes consistently. Earlier S7-300 generations allow less per call. Every MM420 telegram, including one with the parameter channel and the largest process-data selection, sits far below the ceiling, so the limit only matters if you reuse the pattern on bigger slave data areas.
What setpoint word runs the motor at half its reference frequency?
The MM420 fieldbus setpoint is normalized: 16#4000 equals 100 percent of the drive's reference frequency. Half speed is 16#4000 divided by two, which is 16#2000 — with a reference frequency of 50 Hz, that commands 25 Hz. The actual value returned in the receive telegram uses the same normalization, so a returned 16#4000 also means 100 percent.