LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino ADC/Serial corrupting data

Solved!
Go to solution
Solution
Accepted by tyar97

@tyar97 wrote:

I am trying to set the protocol but I am stuck.


Did you implement the protocol on the Arduino?  You should have something similar to this:

 

byte sum = byte(val[0] >> 8) + byte(val[0]) + byte(val[1] >> 8) + byte(val[1]);
Serial.write(0x2); //Send sync byte
Serial.write(val[0] >> 8);
Serial.write(val[0]);
Serial.write(val[1] >> 8);
Serial.write(val[1]);
Serial.write(sum);

NOTE: I am not had the luxury of playing around with an Arduino, so fix any syntax errors I have introduced.

 

Then on the LabVIEW side, you do something similar to this:

Note: Notice that there are no waits in this VI.  The rate of data coming into the port will determine the loop rate.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 11 of 13
(509 Views)

Yes, my code is very similar and works fine.

Finally, it seems it works perfect!!

 

Thank you very much and I really appreciate what you did!

 

 


 

0 Kudos
Message 12 of 13
(498 Views)

Glad to hear you have it working!

 

0xDEAD

0 Kudos
Message 13 of 13
(489 Views)