Juventom,
PID control theory can be quite complicated. We do have several resources and examples that may help you with your project.
Build a PID controller with your computer video
http://zone.ni.com/wv/app/doc/p/id/wv-1945
PID Control Theory
http://zone.ni.com/devzone/cda/tut/p/id/3782
Getting Started PID and Compact RIO
http://zone.ni.com/devzone/cda/tut/p/id/11197
The final example has to do with a compact rio but you could swap out the io variables for your daq task reads and writes and use it the same way. Please read through these and let me know if these are helpful to you.
Kyle Hartley
Senior Embedded Software Engineer