LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with "Print LCD" and "Analog Read"

Hi all, it's my first post !! I'm new to LabVIEW and Arduino.

I'm in this situation:

I recieve a voltage between 0 and 5 V in an analog input of the Arduino and I want to read this value and print it in a LCD display. It's only a small part of my project. The problem is that  when I put the SubVI's "Analog Read" and "Print LCD" ( both from the Arduino's Toolkit) in the Block Diagram the Analog Read doesn't read properly (it reads impossible values as 60 Volts). However, after some invastigation, I have discovered that without the block "Print LCD" the Analog Read works perfectly ! I don't understand what's happening because in my Block Diagram there are a lot of SubVI's from Arduino's Toolkit ("Clear LCD","Digital Write","Cursor"etc.) and the Analog Read works great, the only problem is when I put "LCD print". I have to say that when I put both icons in the diagram, "Print LCD"  works good, the problem it's only in the Analog Read. It seems that the "Print LCD" changes something and then the Analog Read couldn't calculate the voltage properly. LabVIEW doesn't show me any error message.

I think that is a problem of communication. I have been investigating inside the SubVI's but I don't have enough knowledge to solve the problem.

I have to say that all the experiments I have done with LabVIEW + Arduino have worked perfectly without any problem.

I use USB to communicate with my Arduino UNO.

I would be grateful if someone could give me some advice.

Thank you in advance !!!

0 Kudos
Message 1 of 14
(12,412 Views)

Hey Jorxs,

Are you using the single sample analog input or the continuous sample analog input? You cannot use the continuous sampling mode at the same time as using other Arduino commands.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 14
(5,540 Views)

Thank you for your response Kevin. I am using the single sample analog input.

However, I've just solved the problem !!! After seeing that the current bytes at port were increasing with the "Print LCD" in the While Loop, I put a Visa Clear inside, and the problem has disappeared. It seemed a problem related to the flush buffer. Everything runs OK now. Thanks again !!

0 Kudos
Message 3 of 14
(5,540 Views)

hey Jorxs,

I'm experiencing same problem, can you please be more specific about the solution. Maybe post a screenshot.

Thank you very much!

0 Kudos
Message 4 of 14
(5,540 Views)

Hi Naaf, I solved the problem including a VISA Clear after the Print LCD block. I post a screenshot of this part to make it clear. It's a very specific problem and maybe there are other ways to fix it.

visa clear.jpg

0 Kudos
Message 5 of 14
(5,540 Views)

Hii Jorxs, where to you get the "VISA resource"? As I can't find it in my palette.. please help me, I have same problem as you too but not able to solve it.

0 Kudos
Message 6 of 14
(5,540 Views)

"VISA resource" in his picture above is not a VI, it's an element of the Arduion Resource cluster that contains the VISA resource that the Arduino is using (e.g. "COM3").  This could be why you are getting strage values from your analog pin.

0 Kudos
Message 7 of 14
(5,540 Views)

Still, how can I get it, I don't find it anywhere... could you post how to get the "VISA resource" before the CLR?

0 Kudos
Message 8 of 14
(5,540 Views)

I fixed it using the bundle and unbundle functions.

0 Kudos
Message 9 of 14
(5,540 Views)

Hello,

I have the same problem is you had. I tried with Visa celar, but it doesn't help. "Analog Read" and

"Digital Input Read" still doesn't work right.

I used Unbundle and Bundle before and after VISA CLR. Do you have any idea what else could be wrong?

I'm using Labview 12 and Arduino Mega 2560.

Please help ASAP,

Thank you a lot.

LCD_print_problem.jpg

0 Kudos
Message 10 of 14
(5,540 Views)