I am trying to receive data from Arduino Nano V3.0 CH340 through Bluetooth using VISA com port. I am able to get a signal for the first 30seconds but it cuts off after that. Also, I am able to get a clean sine wave using a sine wave generator.
I am running it at 9600 baud rate and 8 data bits. I am using LabVIEW 2017.
I have attached my prototype file here.
Maybe you can delete some stuff that is not relevant, and post just the part that gives the problem (unless you've found it yourself by doing that).
We can't run this code, and we'll never be able to find a bug in all your code.
Also, you could let us know what exactly happens when it "cuts off". Is the communication lost (test with probe), is plot data not as expected, etc. Does LabVIEW crash, or even BSOD? It's not obvious.
I have removed the irrelevant stuff. When running it, I could only get a stable and lasting signal if the time delay was kept at 5ms and below. If I were to increase the time delay, the signal last for only 30 seconds. Then, it cuts off. I could not receive any signal after that (not even noise).
Is there any way I can increase the time delay yet getting a stable and lasting signal?
Are you sure the problem is in the receiver side?
The Arduino sends data. It pushes data onto the serial stack. If it's not read, or not read fast enough, it might very well choke and stop working.
Every cycle you read one 'line'. The serial connection is configured with end termination characters. You might try to read all data (e.g. until bytes at port is 0).
Another problem is that once the serial read gives any error, the error will never be cleared. The error is an input for the next cycle, since it's in a shift register. A shift register just seems wrong in this situation. A probe on the error wire, or an indicator, could tell you if this is happening.
Note that when the serial read times out, or gives another error, a sample is still added to the data.