This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

sending data to a web server
#4
Hello,

I am still working on sending a data only once, after a delay. The solution so far is too ignore empty data on the server side, which allows me to ignore the data sent at the beggining of the program (the buffer that will be sent is init as empty and I wait for some cycles of analysis to be done before calculating its value).

I used the TimeRuned option in the analysis block to stop the experiment after 5s, and the network connection block is configured to send data each 4.9s.

So far so good: it works for the first run. But then I wanted to be able to hit the play button again without clearing the data (the bin icone). I decided to play with the clear="true" attribute from the <send></send> block. My idea was to clear the buffer after the data has been sent to the network, at the end of a 5s run, so that at the beggining of the next 5s run the buffer would be empty, and the connection to the network ignored by the server.

this long introduction to come to this point: when I tried to clear the data (<send id="data" type="buffer" clear="true">time</send>), it seems that the data was cleared before being send to the network: my server only receive empty data, never any actual data.

I was never able to send any data with the attribute clear set to true. Am I missing something?

I post below a minimum example displaying the problem: two data are sent to a network, one with the clear attribute set to true (timer1), the other set to false (timer2). Timer1 always arrives empty on the server, whereas timer2 arrives with a value (in this example, 2 connections are made, one at the beggining of the analyse, the other at the end, both with the same result.) Note that if you want to test this program on your server, you need to enter the correct address.

Thank you in advance for any help,

Cheers,

Fred

PS: I think I could go around this problem by detecting if the pause button has been hit and manually emptying the buffer, but I would like to understand. By the way, is there an easy way to detect if the pause button has been hit ? I can do it by measuring the time elapsed between two analyses cycles, but it is a bit cumbersome ...


Attached Files
.phyphox   test_clear_attribure.phyphox (Size: 1.06 KB / Downloads: 112)
Reply


Messages In This Thread
sending data to a web server - by fbouquet - 10-31-2022, 05:03 PM
RE: sending data to a web server - by fbouquet - 11-03-2022, 04:05 PM
RE: sending data to a web server - by fbouquet - 02-06-2023, 04:51 PM
RE: sending data to a web server - by fbouquet - 02-07-2023, 06:34 PM
RE: sending data to a web server - by fbouquet - 10-17-2023, 04:40 PM
RE: sending data to a web server - by fbouquet - 10-18-2023, 01:32 PM
RE: sending data to a web server - by fbouquet - 04-17-2024, 11:20 AM
RE: sending data to a web server - by fbouquet - 04-17-2024, 03:21 PM

Forum Jump: