Jump to content
Sign in to follow this  
Majo

Send string from LabVIEW to ARDUINO via serial port

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Well, I tried to open serial port outside of the loop, but the result was the same. 

OK, I will look at Continuous Serial Write and Read and I will see if there something which I can use. 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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..

 

Share this post


Link to post
Share on other sites

@ 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 

Share this post


Link to post
Share on other sites

During debugging stage you can use RS232 terminal tool to send receive data

For example

http://docklight.de/

That is nice one since it has binary/HEX/ascii view and you can make predefined strings for sending. Also supports easy scripting..

Share this post


Link to post
Share on other sites

Join the conversation

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

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

Sign in to follow this  

  • Similar Content

    • By David Akinpelu
      I am implementing a TCP connection between MyRio(client) and Python(server). The goal is to send data from the server to the client, perform some calculations, and send the result to the server. I need to keep changing the data being sent to the client. I noticed the first data works fine and the result returned to the server, but the client could not read subsequent data. I debugged and was able to detect that the error is coming from the first read function is the "Reading values subvi"  but I don't know how to correct it. How do I go about it?
      I have attached the files below.
      Reading Unknown Bytes from TCP.vi Second_client.vi SimpleServer.py
    • By Deon
      The Threshold Hysteresis VI allows an input (for example, a sensor) to drift out of an inner limit without generating an invalid flag, but if it drifts outside an outer limit it then becomes invalid. For the reverse, when the input crosses back into the outer limit it remains invalid until the value falls inside the inner limit.
      For simplicity, only one input parameter is provided for both the inner & outer limits, and is negated for the lower limit, as generally tolerance limits are equidistant from the nominal.
    • By Deon
      View File Threshold Hysteresis v1.0 LV8.6.1
      The Threshold Hysteresis VI allows an input (for example, a sensor) to drift out of an inner limit without generating an invalid flag, but if it drifts outside an outer limit it then becomes invalid. For the reverse, when the input crosses back into the outer limit it remains invalid until the value falls inside the inner limit.
      For simplicity, only one input parameter is provided for both the inner & outer limits, and is negated for the lower limit, as generally tolerance limits are equidistant from the nominal.
      Submitter Deon Submitted 11/10/2014 Category General LabVIEW Version License Type  
    • By jossie
      Hello I am quite new to labview and I have some questions regarding labview. We have came up with a simulation build in labview as shown in the folder. However, we will be making use of Myrio to connect current and voltage sensors to send the data to labview when labview is running. We are currently having difficulties trying to search if it is possible to send the wave files and the popout messages ( messagebox.vi and Player2Wins.vi) to NI Dashboard for Labview in Ipad by using myrio. Is it possible for myrio to store wave files and the additional VIs and sending these to NI Dashboard for Labview? 
       
      Otherwise, it is possible for Labview to send the entire program.vi, messagebox.vi and Player2Wins.vi to cloud and people are able to see the GUI in program.vi remotely? ( We have found information like Labview web services etc. We hope that people are able to view our GUI and press the " Press start" button as well as closing the popout messages in a website not from our local network). 
       
      I sincerely apologize if what I am asking does not make sense to people who are reading this. I hope that someone will help me with this as it is very difficult for me to do and I need some guidance from people who are familiar with these. Thanks for taking your time to read and your reply. 
      Simulation_Build_(3).zip Pop-up_Message.vi Player2Wins.vi
    • By edupezz
      Hello, i created a new tips repository in:
      https://edupez.com/
      English and Portuguese
×
×
  • Create New...

Important Information

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