Hello shami81,
There are several things that can be occuring for you to see the
behaivior you are discribing. The most basic is that the signal you are
inputting from your source has a DC offset. Assuming this is not the
case, there are several other things that it could be. If the device
is wired with the incorrect grounding setup, that could cause an
offset. The way to check this is to use our
Field Wiring and Noise Considerations for Analog Signals developer zone article to make sure everyting is hooked up correctly.
In order to make sure that the code is not a factor, the best way to
look at the signal is with Measurement and Automation Explorer. If you
open a test panel (My System»Devices and Interfaces»NI DAQmx Devices,
then right click your device) that will allow you to see exactly what
the hardware is seeing. If this still has the offset, then we know
that the issue is not with the signal analysis, but in the hardware or
the actual signal.
Many of our devices allow you to change the
input coupling as well. If your device has this functionality, then you could use AC coupling, which would remove the DC offset.
In order to help narrow down the possibilities, some more information
about your setup would be helpful. Specifically, information about the
device you are using, the driver you are programming with, how you have
your signal hooked up, which program are you using (example program or
your own code), and possibly a screen shot of your code or what you are
seeing would help greatly.
I hope this gives you a starting point, please post back with that
information if you still cannot find the source of the offset.
Neal M.
Applications Engineering National Instruments www.ni.com/support