I ran diagnostics and everything passes. The Test Panel seems to work fine. The example program counts up when grounded.
I think I figured it out. The default is differential mode, setting RSE mode seems to solve the problem.
Sorry for my late response, I had vacation.
You should have a look at the DAQmx help where the different terminal configuration modes are described.
There you also find which mode to use for what signal source (groundend, floating).