LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acquiring and generating signals

Solved!
Go to solution

I have to find pspice software to actually draw a proper circuit ( which I do not have on this computer ), I would get to that soon. In the mean time let me try to explain what I am doing with the help of connection diagram I sent you earlier ( http://forums.ni.com/ni/attachments/ni/170/719827/1/connection%20diagram.PNG ) , The voltage generated at dev1 - ao1-gnd , is amplified and sent through the resistor, without amplifying the signal, there is a lot of noise in the signal ( please see the attached front panel pic ). So then amplified signal is passed through the resistor ( which is read at dev2 ai0 - ai8 ), and then through the magnetizing core which produces a magnetic field around it. This magnetic field induces a voltage around sensor coil which is again read at dev1 ai9 - ai1.

I am also a software engineer that is why I am having trouble understanding the nature of signal. I agree I could have used one PXI card but this is the setup I am supposed to work on without making any changes, I believe that you are right that it might a natural overshoot in the beginning and unfortunately my supervisor which is an electrical engineering Phd student is not available till monday so in the mean time I am trying to debug the issue. So I would leave it here if we are unable to understand it together till he comes back. 

 

I have one more problem to add, which is can I control the number of cycles of sine wave signal to pass through the resistor ? meaning at a given frequency I want to control the number of waves. 

 

I would like to thank you for helping me solve this problem, you are being a great help!!!

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 21 of 54
(1,730 Views)

No need to make a pspice diagram.  I was just looking for a little more detail about your wiring.  Mainly because I suspected your problem might be related to a floating ground reference.  But now I suspect this might be a "natural" overshoot, as mentioned. 

 

To help debug this issue, I would reccomend you wire up a couple more analog inputs to measure the voltage before amplifcation and compare it with the voltage after amplification.  And compare the two signals.  My guess is that you might see that the amplifier is causing this overshoot.

 

 

http://www.medicollector.com
0 Kudos
Message 22 of 54
(1,709 Views)

You are right the amplifier is causing the overshoot.I have some more problems to add I hope you would have some idea what is going wrong.

 

1. I am currently generating 500000 samples @ 200000 samples per sec and reading 1000 samples @ 2000000 samples per sec, but when I want to increase the number of samples read then it takes forever to read. Would you be able to explain why ?

2. Ideally I  want to generate 2000000 samples @ 2000000samples/sec and read 2000000 samples at the same rate, but then I get error 200019.  can you guess what is going wrong ?

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 23 of 54
(1,698 Views)

Is the card that you are getting error -200019 on the 6221? If this is true, I think that sampling at 2MS/s is out of spec for the card. See this KnowledgeBase Article. 

 

http://digital.ni.com/public.nsf/allkb/1275F44215D5C13F862579AE006CA222?OpenDocument

 

Leah

 

 

0 Kudos
Message 24 of 54
(1,686 Views)

The error is occuring on card - 6221, but when I use 2000sample/sec still I am getting the error. Please take a look at the attached block diagram.

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 25 of 54
(1,680 Views)

Look at how you call the "DAQmx Timing.vi".

 

According to your code, you are tying your bottom two AI tasks (slave tasks) to the sample clock of your AO task (master task) at the top.  This means that the bottom two tasks must execute at the same rate of the top task.  See here:

 

http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/syncsampleclock/

 

This is good, because it VERY ACCURATELEY syncs the three tasks.  Every single point is synced in time. 

 

I think instead you need to look at MASTER TIMEBASE SYNCRONIZATION or REFERENCE CLOCK SYNCRONIZATION because you want to sync at different rates.

 

In summary, you need to change your code to do that.

http://www.medicollector.com
0 Kudos
Message 26 of 54
(1,674 Views)

Now I am using same sampling rate for all the tasks, then when am I still getting error 200019 ? and I do not want to sync at different rates, I want to sample at highest possible frequency. 

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 27 of 54
(1,665 Views)

At what rate are you trying to read your analog input? For the 6221, the maximum Analog Input sample rate is 250 kS/s (aggregate). This means that this is the total amount of samples that can be read in on all the channels per second. 

 

Leah

0 Kudos
Message 28 of 54
(1,649 Views)

I am trying to write 25000 samples @ 100000 samples/secs, but I am getting only 1000 samples written per channel. Can someone help me how to achieve this. I am attaching my block diagram pic also, please take a look at it.

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 29 of 54
(1,633 Views)

Are you still using a DAQ assistant like what was pictured in some of your previous block diagrams? What was the purpose of this section of code?

 

If you are using the DAQ assistant in conjuction with the other sections of your code, the rate specified in the task configuration of the DAQ assistant could be determining the buffer size and other task parameters, which could be causing an error. 

 

On the 6221, are you sampling on more than one analog input channel? This could cause error -200019 to be thrown, because the 250kS/s is for all of the channels combined. 

 

Would it be possible for you to run one of our example programs to see if the error is being thrown when you are doing simultaneous input and output on one card? The example that I am thinking of is called Multi-Function-Synch AI-AO.vi. 

 

This example can be found under Find Examples>>Hardware Input and Output>>DAQmx>>Synchronization>>Multi-Function>>Multi-Function-Synch AI-AO.vi. 

 

Leah

0 Kudos
Message 30 of 54
(1,613 Views)