04-21-2011 09:22 AM
Hi everyone,
I want to acquire data from an oscilloscope. I have written a .vi to do it. I am using a NI 9207 and the oscilloscope is an old device A-F Oscillator Marconi Instruments.
I have configured the DAQmx setting the channel in continuous sampling with sampling rate 10000Hz and sample to read 1k.
When I run the vi using the DAQmx, the signal looks a pretty good sinusoide. When I use the same vi to acquire data from the oscilloscope the signal appears not sinusoidal but a mix of square signal. I think there are problems about sampling but the parameters used to set the DAQmx are the same.
I have attached the .vi
Anyone has an idea of what it is happening?
Thanks
Mato mato
04-27-2011 07:52 AM
Hi mato
Your acquisition loop has not got any timing in and so will be iterating as fast as it can; however there is a nondeterministic element in the loop the front panel updating in the form of the wave form chart.
I would recommend looking at the producer and consumer architecture.
This can be found in file >> new >> VI >> from template>> Frameworks >> design Patterns >> Producer / consumer Design Pattern (Data). This is a method of keeping deterministic and non deterministic code separate.
How are you interfacing the 9207 with the oscilloscope?
04-27-2011 09:13 AM
Hi Robert
Thanks for your reply. Sorry but can you explain better what is about the producer/consumer data difference?
Anyway, back to my problem, I am using a signal generator to generate a sinewave of 10 Hz.
The output from the signal generator goes to the oscilloscope to see the wave and the NI 9207. Moreover, I have connected the AI+ and the AI - from the sign. gen. to the pin 1 and 20 of the NI-cDAQ and a resistor of 1MOhm between the pin 9 (COM) and the AI - to acquire differential data.
After that, I have opened a panel test for the channel chosen for the acquisition. Setting "On demand" it looks to acquire well at low frequencies while the acquired data assume a strange shape at higher frequencies (maybe there is a aliasing problem), see figure 8. When I set "continuous sampling" I see a square wave.
Successively, I open a new task to set up the acquisition data. I put the device in High speed mode and in continuous sampling. It looks ok, see figure 9, and following well the signal generated by the external signal generator. I save this channel and then I open my VI using it. Still I have a square wave, see figure 12. 😞
What should be wrong?
I have checked if the DAQ is ok by acquiring a DC voltage from a simple battery and it looks ok moving the DAQ in all the slots of the NI-cDAQ. I also measured the volt difference between the COM of the DAQ and the ground of the signal generator and it is around +/- 3Volts. I don't know what is wrong or what I missed!!!!
04-27-2011 10:14 AM
Image12 shows that you are ignoring the answer here and using a sample rate that is not supported. Why?
04-27-2011 10:25 AM
Hi Dannis
sorry you're right... I didn't change this parameter.
matomato