> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.codeandcompile.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Drive Control Word Builder (PROFIdrive STW1 / ZSW1)

> Build PROFIdrive STW1 control words like 047E and 047F, decode ZSW1 status words, and scale the speed setpoint for SINAMICS and other PROFIdrive drives.

PROFIdrive drives, such as Siemens SINAMICS, are controlled with a 16-bit **control word (STW1)** and report back with a 16-bit **status word (ZSW1)**. With standard telegram 1, the PLC sends STW1 plus a speed setpoint and receives ZSW1 plus the actual speed.

## Why 047E and then 047F

A PROFIdrive drive follows a state machine. It only starts when it sees **ON (bit 0) rise from 0 to 1** while OFF2, OFF3 and the enable bits are already set:

1. Send `16#047E`. Bits 1–6 and bit 10 are set and ON is 0, so the drive goes to **Ready to switch on**.
2. Send `16#047F`. Bit 0 goes to 1, and the drive switches on and runs at the speed setpoint.

If the drive has a fault, set bit 7 (**Acknowledge fault**, for example `16#04FE`) and then go back to `16#047E`. If you send `16#047F` straight after power-up, many drives stay in **Switching on inhibited** because they never saw ON go from 0 to 1.

## Speed setpoint scaling

The speed setpoint in telegram 1 is a signed 16-bit value where `16#4000` (16384) means **100 % of the reference speed**. On SINAMICS drives the reference speed is parameter `p2000`. Negative values turn the motor the other way.

> [!NOTE]
>
> Bits 0–7 and 10 of STW1, and bits 0–10 of ZSW1, are defined by the PROFIdrive profile. The remaining bits are manufacturer-specific. The SINAMICS meanings shown in the tool are the common defaults, so always check your drive's manual and the telegram you configured.

## Related

> [card] [Bit and number converter](https://wiki.codeandcompile.com/tools/bit-converter.md)
>
> Toggle bits and convert between decimal, hex, binary and BCD.

> [card] [Get my courses – 20% off](https://wiki.codeandcompile.com/who-am-i/get-my-courses-20-off.md)
>
> Learn PLC programming and drives step by step. Use code **WIKI** for 20% off.


## Related topics

- [Free Engineering Tools](https://wiki.codeandcompile.com/tools/index.md)
- [Bit and Number Converter](https://wiki.codeandcompile.com/tools/bit-converter.md)
- [Code and Compile Wiki](https://wiki.codeandcompile.com/index.md)
- [Code and Compile PRO: Learning Paths](https://wiki.codeandcompile.com/resources/yearly-subscription-guideline.md)
- [Modbus RTU Frame Builder and CRC-16 Calculator](https://wiki.codeandcompile.com/tools/modbus-rtu-frame-builder.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.