05-25-2016 04:00 AM
Hi guys, I am developing a project which need Labview to interface with Arduino Uno, but no matter how I modify the connection, my serial write keep malfunctioning, when I click the button 'Home', the Rx led on the Arduino is blinking which indicates it received something, but my hardware got no action at all, so guys please help me check whether my connection on the write palette is correct or not. Thanks in advance!!!
Solved! Go to Solution.
05-25-2016 06:29 AM
Are your settings such as baud rate, data bits, stop bits, parity bits correct?
I bet the problem is on the Arduino side. Without attaching that, it is going to be hard for anyone to help you.
Some things I do see is that you are configuring the VISA port and closing it on every iteration of the while loop. Those things belong outside. You should only read and write to the serial port on every iteration.
05-25-2016 06:30 AM
They are not your problem, but some general notes:
1. The outter loop and case structure are pointless. Just remove them. When you run your VI, you will be connected. This will make things easier to see (less noise).
2. Almost all code I have seen with an Arduino uses the PrintLn function, which adds a termination character (line feed) to the serial message. I highly recommend you use this, turn on the usage of the termination character in you LabVIEW code, and then get rid of the Bytes At Port. Just tell the VISA Reads to read more bytes than the longest message from your Arduino. The reads will stop when they find the Line Feed character.
3. Possibly your problem: does the Arduino expect to see a Line Feed at the end of the string it is recieving?
05-25-2016 09:44 PM
Thanks crossrulz, I removed the case structure on the write palette and it works now, Thank you vey much!!
05-26-2016 02:25 AM
But may I know why does this happen? Why I cannot put a case structure to the write palatte?