Use C API in Web Application

Applications, development tools, FPGA, C, WEB
Post Reply
ZQInreal
Posts: 3
Joined: Mon Mar 20, 2023 2:28 pm

Use C API in Web Application

Post by ZQInreal » Fri May 26, 2023 1:25 pm

Hello everyone,
I am trying to read 4 slow ADC values from expansion connector. Noticed that C API rp_ApinGetValue() can do this. I followed the instruction https://redpitaya.readthedocs.io/en/lat ... .html#comc, and the results were good! However, the Makefile of the example code "analog_inputs.c" is static linked to libm.a/librp.a. And I hope to use it function in my Web Application. My web application is based on rp_lockin+PID. The makefile target is a shared library(.so). When I replace "-static" flag by "-shared" and "-fPIC", a Segmentation Error occurred. I don't know what the problem is, is it that this function can't get through the dynamic link? Or is there a way to use rp_ApinGetValue() in a web application? If not, I'd be happy to look at better ways to satisfy my requirements, such as Qt Streaming APP/ Jupyter Notebook. I hope you will give me some advice on my route. Thanks!

ZQInreal
Posts: 3
Joined: Mon Mar 20, 2023 2:28 pm

Re: Use C API in Web Application

Post by ZQInreal » Fri May 26, 2023 1:33 pm

I want to realize a feedback system by using red pitaya. The Slow ADC inputs as system input, DPIO as the system output. So I may also need to use int rp_DpinSetState() function. For now, I plan to follow the web application steps. But there are problems with the C API. In my case, would Streaming application or Jupiter be a better choice?

User avatar
redpitaya
Site Admin
Posts: 881
Joined: Wed Mar 26, 2014 7:04 pm

Re: Use C API in Web Application

Post by redpitaya » Fri Jun 02, 2023 10:09 am

It would be better to stick to using the rp_ApinGetValue() and rp_DpinSetState(). The streaming applications currently only streams data from the fast analog inputs and outputs. Jupyter Notebook has this functionality, but we plan to update it and add documentation in Q3 2023.

Here is a link with the example of reading slow analog outputs through Web Api:
https://redpitaya.readthedocs.io/en/lat ... low-inputs

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: Google [Bot] and 25 guests