Jump to content

Send string from LabVIEW to ARDUINO via serial port


Majo

Recommended Posts

Hello, 

I need a little help. 

I want to send from LabVIEW to Arduino via serial port the string for example "ABC" and so on. 

The problem is that when I send the string from LabVIEW .......the Arduino do nothing. Sometimes shows some kind of sign.

When I send the string via Visual Studio it works perfectly.

Is there someone who can help me.

 

I attached picture of vi and Arduino code

 

Thank you very much.   

 

 

post-38707-0-42358300-1414700507.jpg

Arduino code.txt

Edited by Majo
  • Like 1
Link to comment

Wow, okay well you are opening that serial port over and over again as fast as Windows will allow.  Now luckily the resource will be locked and you will generate an error the second time that loop runs.  Unfortunately you aren't looking at the error, and the error isn't stopping your loop so you won't know there is an error until you stop it your self.

 

Go to the Help >> Find Examples and search for Serial.  In newer versions of LabVIEW the example is called Continuous Serial Write and Read. Older ones had a similar example but it has been re-written.  This should perform basic serial I/O and assuming it works, you can takes pieces out and make your own application with it.

Link to comment

Aside from moving your serial configuration VI outside the while loop, you may want to also add a delay to the loop as well. You may be pounding it with data faster than it can handle them (maybe, I've never had the opportunitiy to play with Arduino).

 

Additionally, how is your Arduino set up to handle termination characters?  I didn't see anything in the Arduino code specifying anything other than the baud rate.  By default, the serial config VI enables a termination character using a line-feed.  I don't know what VB serial configuration defaults are.

Link to comment
  • 1 year later...
On 10/31/2014 at 1:58 AM, Majo said:

Hello, 

I need a little help. 

I want to send from LabVIEW to Arduino via serial port the string for example "ABC" and so on. 

The problem is that when I send the string from LabVIEW .......the Arduino do nothing. Sometimes shows some kind of sign.

When I send the string via Visual Studio it works perfectly.

Is there someone who can help me.

 

I attached picture of vi and Arduino code

 

Thank you very much.   

 

 

Labview.JPG

Arduino code.txt

i want exactly opposite to this.. i want to send any abc string to labview serially.. could any one provide codes..

 

Link to comment

@ arduino code u provided in attachment... i tried to compile in arduino ide but its showing error msg like this

Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\310257021\Documents\Arduino\readtry\readtry.ino:5:30: fatal error: Adafruit_ILI9341.h: No such file or directory

 #include <Adafruit_ILI9341.h>

                              ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 

 

 

 

how could i remove this??

i also want to receive serial data from com port 

Link to comment
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.