Data acquisition and store using Red Pitaya with LabView

Discussions about active development projects
gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Wed May 11, 2016 11:49 am

Hello!

I am a master student and I am using the RP in my master thesis, but I am a beginner using it and I've found some problems.
I would like to get the signal from a photodiode which receives a laser beam in LabView and store the data acquired on my computer.
I am able to get the signal using the oscilloscope available in the web browser.
The next step that i've tried was to get the same signal in Labview, for that I've downloaded the driver for Labview available in the RP webpage and I run the Putty software (my computer runs with Windows 7) to start the SCPI server.

I am using the following VI in Labview in order to watch and store the signal:

Image

First I initialize the RP and set the IP adress, after that I configure the adquisition, selecting between DEC and SRAT, and the value of the feature, following I adjust the gain voltage, to HV (I did the same in the RP changing the jumpers of the channel 1).
The next step is reading the waveform, the output data from this block is sent to the graph and stored in two different formats.
Finally I reset the adquisition and close the process.

The problems that I have found are:
- Until I start the oscilloscope in the web browser the RP doesn't send any data to the VI in LabView, and the image that I obtain in the graph is an straight line in 0, when I run the oscilloscope I am able to get the data in labview, however the RP webpage includes this note: Note: Communicating with scpi server and working with web based instruments at the same time can diminish the performance of your Red Pitaya. This is because the same resource is used for both tasks.
- If I've understood it properly, the decimation provides you the chance to change the sampling rate of the data acquisition, however, when I change the decimation to the lower ones (65536,8192) the signal is the same as using Decimation 1.
- The obtained signal changes if I run the program normal or with the highlight execution
- If the oscilloscope on the web browser stops, the signal obtained in labview it is always the same, no matter which configuration I choose.

Furthermore, I would like to know if it is possible to change the amount of acquired samples, in order to ger more than 16384.

As I said I am a beginner with that so it is possible that I have made plenty of mistakes, thus I will be so grateful with any help!!

Thank you in advance :)

Germán.
You do not have the required permissions to view the files attached to this post.

flob
Posts: 8
Joined: Wed Feb 17, 2016 10:18 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by flob » Wed May 11, 2016 2:08 pm

Hi,
You should not use RP SCPI (Labview) and Nginx (WebApp) at the same time (see github).

gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Wed May 11, 2016 2:38 pm

Hi Flob, first all of thank you for your answer,

I know that I shouldn't use both Labview and web browser at the same time but, at least in my case, if the signal is not running on the web browser, the signal that I obtain in Labview is always the same, it doesn't matter the decimation that i choose, it always show and store the same 16384 values.

I have followed the instructions that you attached on your answer, but I have obtained the same result :(

Any ideas about how I could fix it?

Thank you in advance one more time!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Data acquisition and store using Red Pitaya with LabView

Post by Nils Roos » Wed May 11, 2016 4:56 pm

Hi,

the scpi-server - which provides the functions for Labview - works only in single trigger mode, meaning that after a trigger event it will record at most one buffer full of samples (16384) and then stop recording. All read commands will deliver data from that buffer.

If you want to record new samples you have to arm the trigger again (ACQ:START + ACQ:TRIG) and wait for a new trigger event.

When you have the oscilloscope app running in auto trigger mode, the sample buffer will be refreshed automatically at certain intervalls. That is the reason why you see a different behaviour in Labview with the app running.
All in a day's work for Bicycle Repair Man

gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Thu May 12, 2016 11:11 am

Tranks for your answer Nils Roos!

I have included the trigger configuration in Labview and now it is running without running the oscilloscope in the web browser, however I still have a problem:

I have connected a function generator to the RP input (CH1) and I am making some trials changing the frecuency of the signal, the problem that I have found is that I just get the proper signal if I use the Highlight running in LabView, by this way the signal looks like the right one, but if I disabled the Highlight mode, it appears some peaks in the signal.

I don't know if someone else has the same problem, but I don't know yet what causes it, any ideas?

Thank you once again!

gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Thu Jun 09, 2016 11:48 am

Hello all one more time!

I am still working with RedPitaya and Labview, until now I have achieved that the program acquire the data from two channels and graph both signals, however I get some new doubts and problems, I hope you could help me with them.

I would like to know if there is any delay during the data acquisition when both input channels are connected, they are running at the same time or they have some kind of delay, I am asking that cause when I run the program with the Highlights activated, it shows that one part of the program runs earlier than the other, so I would be so grateful if someone could explain me how the buffer of the RP works with two input channels.

Furthermore, I have a problem when I acquire the data and I graph it, the signal should be a perfect sine wave with a frequenzy of 80 KHz, however some kind of discontinuity occurs:
- If I connect the same signal to both inputs, it happens at the same time in both channels.
- If I connect a different signal, the same happens.

I cant find the error that makes it happen, so I would be so grateful if someone could help me with these problems.

Thank you in advance

Germán
You do not have the required permissions to view the files attached to this post.

gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Thu Jun 09, 2016 3:54 pm

Hello once again!

I am still trying to know what is the problem that I have asked on the previous questions, but I have found a temporary solution, if I include a delay of 8000 samples, the discontinuity goes out of the graph, but anyway, if someone could explain me why I get this error I will be so grateful!

Thank you in advance.

Germán

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Data acquisition and store using Red Pitaya with LabView

Post by Nils Roos » Thu Jun 09, 2016 5:58 pm

Hi Germán,

what is the "Input" / "Input 2" setting that is connected to the read-blocks ?
I have no idea how the Red Pitaya Labview drivers work, but it may be that by dictating an offset to the read functions you are requesting a certain section of the buffer instead of the trigger-aligned data.
A better analysis of the situation would be possible if you could capture the scpi commands that Labview sends to the Red Pitaya. The scpi-server uses unencrypted traffic on port 5000 by default.
I would like to know if there is any delay during the data acquisition when both input channels are connected, they are running at the same time or they have some kind of delay, I am asking that cause when I run the program with the Highlights activated, it shows that one part of the program runs earlier than the other, so I would be so grateful if someone could explain me how the buffer of the RP works with two input channels.
Recording into the buffers happens for both channels simultaneously, but you can only write settings for or read from the buffer of one channel at a time. That's the reason you see sequential execution for some settings and reading of data.
All in a day's work for Bicycle Repair Man

gerotero
Posts: 6
Joined: Mon Apr 25, 2016 10:35 am

Re: Data acquisition and store using Red Pitaya with LabView

Post by gerotero » Wed Jul 06, 2016 11:26 am

Hello once again!

First of all I would like to thank Nils Roos for all the help.

I have found a new problem, I am working with linear polarizers and I am trying to acquire the data of a source light that goes through the linear polarizer and reach a photodiode.

The problem appears when, in a defined rotation of the linear polarizer, some part of the signal that I get is contained between + and - 1 volts, but some other part is higher than this value. If I choose the Gain Voltage LV, there is a part of the signal that is not represented on the graph, and that acquires during a certain period of time a constant value of 1, however, if I choose the Gain Voltage HV in Labview, the measured values change, and there is no value higher than +1V.

Do you know if there is any offset value included on the Red Pitaya between LV and HV gain settings? (I also change the Jumpers in the red pitaya according the chosen Gain voltage setting.

Thanks one more time for your time and help

Yours sincerely

Germán

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Data acquisition and store using Red Pitaya with LabView

Post by Nils Roos » Thu Jul 07, 2016 3:06 pm

Hi Germán,

you're welcome, let's see if I can help some more. There are indeed two sets of calibration values, one for LV and one for HV gain setting. You can examine them by executing "dd count=1 if=/sys/bus/i2c/devices/0-0050/eeprom of=/tmp/cal" in the RP console and then opening the cal file in a hex-editor. The contents are interpreted like:
0-7: version information
8-11: HV front end full scale voltage, channel A
12-15: HV front end full scale voltage, channel B
16-19: LV front end full scale voltage, channel A
20-23: LV front end full scale voltage, channel B
24-27: LV front end DC offset, channel A
28-31: LV front end DC offset, channel B
32-35: Back end full scale voltage, channel A
36-39: Back end full scale voltage, channel B
40-43: Back end DC offset, channel A
44-47: Back end DC offset, channel B
48-51: magic value 0xAABBCCDD if high gain offsets in 52-59 are valid
52-55: HV front end DC offset, channel A
56-59: HV front end DC offset, channel B

If the magic value is not present, the LV front end DC offsets are also applied for HV. By the way, the calib tool does not read nor change the HV front end DC offsets and magic value - that's why I listed all this.

Regarding your problem, if you could capture the communication between LabView and the RP during your experiment, it would be much easier to find out why you are getting unexpected results.
All in a day's work for Bicycle Repair Man

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 3 guests