The paper presents a compositional design method for embedded state machines, using reconfigurable software components such as state machine and modal function blocks (SMFBs/MFBs). The method adopts separation of concerns, where the SMFB realizes the reactive (control flow) aspect of system behaviour, in separation from the transformational (data flow) aspect. The latter is delegated to modal function blocks, whereby the SMFB is used to indicate the current state to modal function blocks that perform the required signal transformations within the corresponding states/modes of operation. The composition of state machine and modal function block operates as a periodic event-driven state machine combining the expressive power of conventional event-driven state machines with a periodic execution pattern amenable to schedulability analysis. The SMFB has been implemented using a Binary Decision Diagram (BDD)-based State Logic Controller design pattern, resulting in a reconfigurable component that can be used with modal function blocks to engineer state machines for a broad range of sequential and hybrid control applications.