1. A computer-implemented method comprising: a computer system executing program instructions to create a statechart in response to user input, wherein creating the statechart comprises displaying a plurality of state icons on a display device in response to user input and displaying a plurality of connector elements interconnecting the state icons on the display device in response to user input, wherein the state icons represent a plurality of states and wherein the connector elements represent transitions between the states, wherein the statechart includes one or more hierarchical states, wherein each of the one or more hierarchical states includes one or more sub-states, wherein the statechart specifies first functionality; and the computer system executing program instructions to automatically generate a graphical data flow program from the statechart, wherein the graphical data flow program includes a plurality of interconnected nodes that visually indicate functionality of the graphical data flow program, wherein connections among the nodes visually indicate data flow among the nodes, wherein the graphical data flow program implements the first functionality; wherein the one or more hierarchical states include a first hierarchical state having one or more sub-states, wherein automatically generating the graphical data flow program comprises automatically generating a first block diagram and including a first sub-program node in the first block diagram, wherein the first sub-program node encapsulates a second block diagram corresponding to the one or more sub-states of the first hierarchical state.