From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem sending serial commands to arduino

Hello All

 

I know this question has been asked for millions of times, and after looking at the forum I still Can not solve my issue.

I have a very simple arduino program that receives "1" or "2" as input.

I have tested the code in aruino comm consle and other comm app and it is working fine.

Then I built a small Labview program that uses visa to send 1 or 2 to the arduino but it does not work. I get no response from the aruino code.

Can you please look at my VI and tell me what I am doing wrong?

Thanks!

 

P.S 

I have tried all of the option of cr+clf...

Gil, 

0 Kudos
Message 1 of 5
(1,057 Views)

@GilMaor wrote:

Can you please look at my VI and tell me what I am doing wrong?


No VI posted.  It would also help if you posted your Arduino code so we are certain what needs to be sent.


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 5
(1,031 Views)

Hi All

Here with attached code.

Download All
0 Kudos
Message 3 of 5
(1,028 Views)

In your VI, you are sending 1\r or 2\r, as in a literal 1or 2, backslash, r.

 

I assume you meant to send a carriage return.  You need to right click on your constants and set them to \code display.  Also set the display style to visible so it is obvious that is \code display.

 

I can't look at your Arduino code.  For some reason you attached a .rar file which requires other 3rd party software to view.  Next time attach an actual .zip file which Windows can handle natively.

 

The opening and immediate closing of the VISA port at the beginning is unnecessary.  And without much work, you can eliminate the need for the sequence structure.

0 Kudos
Message 4 of 5
(1,015 Views)

Hi,

I am sorry for the late reply.

I did solve the problem using the "End of line" constant.

Though I do not understand the difference between "End of line" and using "concentrate string" on CR and line feed.

Thanks!

Gil,

0 Kudos
Message 5 of 5
(942 Views)