04-04-2017 01:47 AM
Hi all,
First time post. I'm working on a project that involves transferring angle encoder values (double data type) from one MyRIO to another MyRIO. For this project, I don't want to make one MyRIO a slave of the other MyRIO, so I am using UART communication to do this. However, I am experiencing some noise in the data transfer that I believe is due to loss of data during signal transfer.
My labview code is as such:
I have a variable, ThetaOUT, of double type that I am converting to a string using the "number to exponential string" function. For reference see the attached ExampleSend.PNG file.
I am sending that data using the UART Express VI in Write mode. I have set the BaudRate to 9600, Data bits: 8, Parity: None, and Stop Bits: 1.0
On the other MyRIO (MyRIO 2) I am receiving this signal using the UART Express VI in Read All Available mode. The other settings are the same as above.
Next, on MyRIO 2, I am converting the received string to a number using "Frac/Exp String to Number" function. Please see ExampleIn.PNG.
I am getting the following noise in the received signal shown in ExampleData.PNG. The true value, "ThetaOut", is held constant at -.05235988 and sent by MyRIO 1 to MyRIO 2 over UART. As can be seen in the picture the received value on MyRIO 2, ThetaIN (in the graph Theta1), is received correctly for most samples but at various samples spikes to either 0 or some other incorrect value. The cable I am using to transfer the UART signals is an insulated cable and both MyRios are sampling at 50Hz.
Is there anything I can do to remove the loss of data in the received signal? Should I be using a higher baudrate or a different string to number conversion function?
Thank you!
Neil
04-07-2017 11:29 AM
Hello Neil,
I'm guessing you're using the breakout board that was supplied with the myRIO in order to access the UART TX and RX lines. Often times noisy signals and spikes are due to environment or wiring.
I would first double check that you're running this in an environment where there's no environmental disturbances. This includes any electrical disturbances that could be causing the noise.
Then, I would double check all the connections between the myRIOs. Make sure that the wires are secured and isolated from other signals. Additionally, I would check if the other DIO lines on the device are experiencing similar disturbance. Finally, could you try to send a different value for the ThetaOut signal to see if this occurs at other levels?
Are you running other signals into or out of the myRIO while doing this test?
Zoe B.