LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Arduino ADC/Serial corrupting data

Solved!
Go to solution
Highlighted
Solution
Accepted by topic author tyar97
02-14-2019 07:29 AM

Re: Arduino ADC/Serial corrupting data


@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.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 11 of 13
(115 Views)

Re: Arduino ADC/Serial corrupting data

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
(104 Views)

Re: Arduino ADC/Serial corrupting data

Glad to hear you have it working!

 

0xDEAD

0 Kudos
Message 13 of 13
(95 Views)