By popular request, here are the code of the two examples we've posted before.
Let me start with the pendubot. I reused (A.K.A "stole") this code from Alex. This example does it all! It linearizes a the (obviously non-linear) model, designs a full state controller, simulate the behaviour of the controller with the non linear system and, if you happen to have a pendubot and a cRIO at hand, actually runs the controller to the real think! All you need is LabVIEW and the Control Design and Simulation module (for the design and simulation) and the Real Time and FPGA module (for the controller).
By the way, if you run the controller, you can actually see how the 3D picture does the same as the real thing!. You can download the code form NI Community
Now is my turn.
Below is the code for the Active Suspension Demo from Quanser. I know, I know.... is not as complete as Alex's, but gets the job done. It implements two control loops in parallel, one to control the "road" and one to control the "suspension" you can change both controllers on the fly as well as setpoint magnitude and frequencies