Processing of a signal coming of a module NodeMCU ESP8266 using LabView.

I'm using a module NodeMCU ESP8266 to do a analog read of a signal that have components from to 40 Hz of a signal of electroencephalogram to a job of scientific research of university. Was with a problem of cut of signal that I got to resolve adding a delay in the code. Thus, the module is programmed to serve as access point, where my computer (client) access using a TC/IP protocol. Thus, when a client access my module, the same send the data that will receive for my computer. I do a program on LabView to receive the data and show the same on graph, but I need to apply some digital filters in this software and to evaluate the frequency spectrum of this signal. I will put here both my code in arduino and the .VI to you understand best. I can use a UDP protocol, but I could not to program my module to use this protocol.

The way I managed to reduce the sampling rate isn't the best, but I could not find it other way that I could, for example, change the prescaler that change the sampling rate of this module. I will post a figure of a signal showing the LabView graph before I put the delay in arduino code. With the delay the waveform is without this cut in sine, that is, show a normal sine waveform.

For what I researched with some teachers, the sampling rate was very tall, thus, if any data package wasn't send correctly the module wasn't have enough time to resend the package and receive the new data to a new data package. Thus began give to some mistakes and cut the graph signal.

Now, the problem is to apply some digital signals in this software and evaluate spectrum frequency of this signal. For what I understand of LabView software, to do this tasks the signal need to have a sampling rate fixed. Thus, I got a little routine to I see if at least the sampling rate of module waveform was constant and I see that already there wasn't. I saw readings of time in between 160 us and 180 us between a sample and other without the delay of 4 ms that already in the code. I think in sending of data may occur some variation, and even in LabView some variation in this values, I hope I'm mistaken.

To try to resolve this problem I tried to use some LabView blocks that could help me in the resolution of this problem and was three: Build Waveform, Align and Resample Express VI, Resample Waveforms (single shot). My idea was to rebuild my waveform with a sampling rate pre-fixed for me. But I think that still do not know to use this tools correctly. I tried of many forms and unfortunately I didn't sucess.

The link to download my program .VI and arduino program is:

https://drive.google.com/drive/folders/1_FItfUE8IW52u7Ec4WdggadKnMH7QR5O?usp=sharing

Can anyone help me solve this problem?