App with 4 Signal Channels

Applications, development tools, FPGA, C, WEB
Post Reply
GeorgB613
Posts: 13
Joined: Tue Mar 24, 2015 10:00 am
Location: Graz, Austria

App with 4 Signal Channels

Post by GeorgB613 » Mon Sep 04, 2017 10:32 am

Hi everyone,

First of all I have to mention that I am still using the very first Ecosystem. (I don't know if that's relevant at all for the nginx server I address here).

I used to edit the standard oscilloscope app to accomodate that to my needs. Up to now it worked very fine for me but now I need 4 signal channels instead of the default 2.
I do know how to adapt my Firmware to get memory for four channels but then I fail when the data is transferred via nginx.
Obviously it's not sufficient to update the rp_osc_get_signal() in main.c
(Beside all relevant initialisations of the rp_osc_signal) I just extended the aforementioned function to this:

Code: Select all

/*----------------------------------------------------------------------------------*/
int rp_osc_get_signals(float ***signals, int *sig_idx)
{
    float **s = *signals;
    pthread_mutex_lock(&rp_osc_sig_mutex);
    if(rp_osc_signals_dirty == 0) {
        *sig_idx = rp_osc_sig_last_idx;
        pthread_mutex_unlock(&rp_osc_sig_mutex);
        return -1;
    }

    memcpy(&s[0][0], &rp_osc_signals[0][0], sizeof(float)*SIGNAL_LENGTH);
    memcpy(&s[1][0], &rp_osc_signals[1][0], sizeof(float)*SIGNAL_LENGTH);
    memcpy(&s[2][0], &rp_osc_signals[2][0], sizeof(float)*SIGNAL_LENGTH);
    memcpy(&s[3][0], &rp_osc_signals[3][0], sizeof(float)*SIGNAL_LENGTH);

    *sig_idx = rp_osc_sig_last_idx;

    rp_osc_signals_dirty = 0;
    pthread_mutex_unlock(&rp_osc_sig_mutex);
    return 0;
}
Is the nginx server only designed to tranfer 2 channels?
What is it that I forget here?

Hope you guys can help. And thanx in advance.
Georg

JamesW
Posts: 12
Joined: Mon May 30, 2016 6:40 am

Re: App with 4 Signal Channels

Post by JamesW » Mon Sep 04, 2017 3:46 pm

Hi,
I see three possibilities.

1) You can make your signal half size length. Then it is possible to use 4 signals.
2) To keep the same length, it is necessary change memory allocation and change hard coded constants in https://github.com/RedPitaya/RedPitaya/ ... data_cmd.c a recompile. It probably break compatibility with others apps.
3) Use WebSocket interface - for future this is the best way, but you will need rewrite your app and web interface.

GeorgB613
Posts: 13
Joined: Tue Mar 24, 2015 10:00 am
Location: Graz, Austria

Re: App with 4 Signal Channels

Post by GeorgB613 » Wed Sep 06, 2017 12:43 pm

Thanx for your suggestions.

As halfen the signal size length is no sufficient option for me, I will have to touch the nginx files.
However, I don't know what I have to consider here and how to compile alltogether and which compile file is needed where.

On my SD-card, I found a file called "nginx" in the sbin directory. Is it that one I have to recompile?
Is there a guide available or could you give me some hints?

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 20 guests