Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication with arduino

Hi Everyone,

Software:Labview 2013

Hardware:Arduino UNO

Problem description:

 

So try to establish the connection between Arduinoboard UNO and  Labview .It seem to send me the same response everytime i send a message.

E.g if i writeor send "hello," "hi" or "gut", then the response would be "power on".

 

Does anyone here already saw this problem?

 

you can see my VI just under the text and tell, if something is wrong.

 

Thank you for your response.

 

Kinds Regard

 

Tagni

 

 

 

0 Kudos
Message 1 of 14
(4,126 Views)

The sketch code would also be useful.  It would not be the first time people are blaming LabVIEW for an Arduino coding issue.


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
0 Kudos
Message 2 of 14
(4,109 Views)

or the basic serial IO routines will reset the Arduino each time when the run button is pressed.

The initialisation of the serial line resets the Arduino,

greetings from the Netherlands
0 Kudos
Message 3 of 14
(4,060 Views)

Hi Guys,

 

can you please suggest me a VI , which can help me to solve the problem?

0 Kudos
Message 4 of 14
(4,027 Views)

@Tagni wrote:

can you please suggest me a VI , which can help me to solve the problem?


Can you supply all of the information we already asked for?


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
0 Kudos
Message 5 of 14
(4,023 Views)

Hi ;

 

Sorry it was my mistake.

 

This is the sketch you asked:

0 Kudos
Message 6 of 14
(4,017 Views)

Based on what I am seeing, you have to send a '#' to end your transmission.  So if you send "hello#" then your Arduino will send back "hello".  Of course, your buffer it limited to 8 characters.  But what happens if you send a message longer than 8 characters?  I do not have enough experience to say what will happen to your memory when you try to write outside of the array bounds (error?  corrupt the memory?).

 

Typically, you will want to have a Line Feed (0xA, \n, LF) end your message.  Then you can use Serial.readStringUntil(\n) in your Arduino to read the entire message in a single line of code.  When sending a message back, use Serial.PrintLn.  This appends a Carriage Return and a Line Feed to the data you are sending.  Then on the LabVIEW side, you enable the termination character and just tell the VISA Read to read a large number of bytes and you will get your full message.


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
0 Kudos
Message 7 of 14
(4,010 Views)

Hi ,

 

i tried the code you shown on the picture , but it seems not to work.

 

i don´t know, if you have any VI, which is corresonding to my problem please.

0 Kudos
Message 8 of 14
(4,002 Views)

I think you need to explain exactly what you want to do. What is your end goal. For example "I want to turn on a LED on my Arduino using LabVIEW." Or "I want to send data from my sensor hooked to my Arduino to a LabVIEW chart." Depending on what you want to accomplish LINX might work better for you.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 9 of 14
(3,992 Views)

hi,

 

what you explained before, it´s true. That means, for example, if i write "hello#", then it must return "hello". This my goal

 

This progromm is to test , if the communication between my Board and Labview is working.

 

Because later, i want to something more complicate...but this one is the first step.

0 Kudos
Message 10 of 14
(3,984 Views)