Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

why i do get an offset with analog input

Solved!
Go to solution
Hi all,
          I am a new user of NI softwares(LabView & NI Data Logger, NI Signal Express) and Visual Basic 6.0 and have a little knowledge about both of them. I am working with NI-Pci 6025E card and trying to acquire an analog input. The analog input is actually a sqaure wave ranging from 0-5V and frequency is 1KHz. I hv tried many ways to acquire it but i always get an offset waveform, like the wave starts from may be 1volts and its peak is at 5.4 volts. Then it starts gettting higher and higher and stops upto 10Volts peak and its starting voltage is above 6volts. I hv tried to acquire the voltage using different examples given in LabView and Visual Basic and i have also tried the DAQ assistant but the results are the same. Please help me on this because i am stuck on it for the last one week and cant get out of it.
 
waiting for your help guys.
0 Kudos
Message 1 of 24
(16,871 Views)
Solution
Accepted by shami81

Hi,

Thanks for posting your question to the forum.  I suspect there may be an issue with grounding.  I recommend looking through the Developer Zone article, Field Wiring and Noise Considerations for Analog Signals, which describes in detail how to properly ground a signal.  

The important things to note are whether you have a floating signal source (not connected to building ground) or a grounded source and the input configuration of your measurement (differential, referenced single-ended, non-referenced single-ended).  For example, if you have a floating source and you are attempting to measure the signal in differential mode, you would need to add two resistors (between 10kohms and 100kohms) to properly ground the signal.  One resistor would connect AI+ to AI GND and the other resistor would connect AI- to AI GND.

Post back with more detail about your signal source and input configuration if you need more assistance. 



Best Regards

Hani R.
Applications Engineer
National Instruments
Message 2 of 24
(16,859 Views)

Thank you Hani for your help it really solved the problem as this solution was suggested to me by my friend and i used this but din know wheather its fine or not. Please classify that which inputs should be treated as floating and which inputs should be treated as RSE and NRSE inputs.

I am using a function generator which has a grounding signal along with original signal. I have connected 100k Ohm resistance between AI GND and AI0, AI1 inputs. Now when i acquire the input in RSE mode it gives me accurate results. But when i use differential mode i dont get it right. Whats the problem in that? Because you suggested that i should use differential mode. But i think function generator's input which provides a ground itself i should RSE input mode. What do you say about it? Please guide me if i am wrong. I will be very thankful to you for your guidence.

0 Kudos
Message 3 of 24
(16,852 Views)
Hi,

A floating signal is one that is not connected to building ground (does not provide a ground).  Since you said your function generator has a ground signal, it would be considered a grounded signal source. 

When I mentioned the example for a differential measurement in the last post, I did not intend it to be a recommendation.  You should read through the Field Wiring and Noise article for details but there are two recommended types of measurements for a grounded signal source; differential and NRSE. 

In the case of an NRSE measurement for a grounded signal source, you do not need to use bias resistors.  You would connect the output signal of your function generator to an AI channel of your DAQ card, and you would connect the ground signal of your function generator to the AISENSE input of your DAQ card. 

I hope this helps.


Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 24
(16,837 Views)
HI, thanks once again Hani,
 
I have read that paper you suggested me to read. It was really of great help. One thing i want to ask that when i use bias resistors and use differential mode using channel AI0 the connection diagram suggests me to connect the signals at AI+ and AI- which means AI0 and AI4. When i connect according to that i dont get the waveform accurately. But when i use RSE mode for my function generator signal and connect it according to the diagram i get correct signal waveform.
 
Can you tell me whats happening coz the paper you suggested tells that Differential or NRSE mode should be used with my kind of input signals. I am not getting it properly so please help a little more. One more thing i want to calculate the mean or average of the input signal. I am using the vb's Continuous Acquisition example as my base code. I want to call the SIGNAL COMPRESSION VI of LabView, is it possible to call that VI from VB6.0? Moreover I want to modify the example to acquire continuous samples as it is acquiring N samples currently.
 
Your help in this regard will be very much appreciated.
0 Kudos
Message 5 of 24
(16,833 Views)

Hi,

To measure a differential signal with the PCI-6025E, you will want to use ACH<i> and ACH<i+8>.  Therefore, if you are using AI0 for AI+, then use AI8 for AI-.  Remember that for a grounded signal source, you do not need to use bias resistors.


I could not locate the Signal Compression VI, but I did find the Sample Compression VI (Express VI) in LabVIEW.  If you have LabVIEW Application Builder you can save the express VI in a new VI and build a DLL that you can call in VB6.  Remember that you would have to configure the inputs and outputs on the connector pane of the new VI before building the DLL. 

It may be less work for you to use LabVIEW to program your application.  In LabVIEW, you can find the same continuous acquisition example that you are using by going to Help » Find Examples then selecting Hardware Input and Output » DAQmx » Analog Measurements » Voltage.  The example sets up the hardware to continuously read data and store it on the buffer.  Data of N samples will be pulled off the buffer every iteration of the While Loop. 



Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 24
(16,798 Views)

Hello All,

 

I am facing the same problem as this thread starter. I tried all the solutions prescribed above, and all the configrations available in manual, but cannnot solve the problem. 

 I am attaching the screen shot of signal acquired, when the AI were not connected with any signal. What might be the problem ????

 

My hardware

 

1) scb-68 Connection box

2)NI Pxie-6361 DAQ

3)NI Pxie-8360 controller

4)NI Pxie-1071 chasis

5) Agilent 33250A function generator.

 

I gave a signal of 2 Khz  20 mV peak to peak  across a resistor of 50 ohms. I am trying to read the signal across resistor.

 

All devices ( Pxie chasis and signal generator) are perfectly grounded

0 Kudos
Message 7 of 24
(14,398 Views)

Hello,

 

Can you elaborate a little more on how are you exactly wiring your device and what modes are you using?

 

Have a good day!

0 Kudos
Message 8 of 24
(14,383 Views)

Hello,

 

my setup was very simple. I have connected a FG( Agilent 33250), an oscilloscope and SCB-68 AI 0+ and AI 0-  terminals  parallely across a 50ohm resistor . To connect function generator and oscilloscope parallel across resistor I have used these cables(http://www.pomonaelectronics.com/pdf/3957_100.pdf). I cut the banana ends of cable and soldered across resistor. I have also connected FG chasis ground to the AI 0 ground on the SCB-68. This is how my circuit looks like.

 

Settings on FG : output frequency 5K, voltage 8 Vp-p, offset 0

 

output on the oscilloscope was perfect without noise. parameters like voltage and frequency were same as function generator. 

 

1)But while reading the daq channels , voltage readings were not perfect. I am not getting correct peak to peak value. Also voltage graph seems increasing with time. I have attached the screenshot of  it.

 

2)In the frequency spectrum of the signal gain is also very low , only -60db.

 

3) I also observed that there is 1/f noise. How to get rid of this ?

 

I am new to this DAQ.I am in confusion whether everything is Ok with the daq. so I am uploading screenshots of signal reception. I am uploading voltage time log data, voltage display graph and power spectrum graphs with and without signal connected. I have also tried in Differential, RSE, NRSE modes. 

 

Thanks 

0 Kudos
Message 9 of 24
(14,374 Views)

These are the screen shots from signal express, when there is no input to the daq. 

0 Kudos
Message 10 of 24
(14,372 Views)