ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
05-08-2013 07:14 PM
Hello,
I'm having a problem with sending some values from Labview to Arduino.
Arduino read ASCII code instead of the value, so I convert it in Arduino and display the value in Labview.
It's doing fine for 3digit input. But not with 2digit or 1digit.
For 2digit value,i nstead of just sending 99, Labview send 990 to Arduino. For 1digit, it send 900 instead of just 9.
05-09-2013 04:06 AM
Have you tried just using LIFA (LabVIEW Interfce for Arduino) for which this section is named? It might make life easier once you set it up.
Otherwise, this should work:
void loop()
{
if(Serial.available()>0)
{
value = Serial.read();
}
setLed(0,value);
delay(500);
}
and
05-09-2013 10:13 PM
Hello Nathan,
I've tried your suggestion, but the output comeout wrong,
It supposed to be linear from 255 to 0.
Please help me.
05-09-2013 10:34 PM
I've also tried to use the old Arduino code, the output is Linear, but still wrong.
05-10-2013 12:02 AM
The way that you have your code implemented in LabVIEW, you will never get the correct output from the Arduino. Having said this, the image you have named as Untitled.jpg is what I would expect to see (or something similar). It is because you are reading single bytes in LabVIEW when you are trying to send multiple byte representing one number from Arduino.
Does the LED act correctly with my code?
05-10-2013 01:25 AM
It works as it displayed in LabView.
I've tried it again, and for the first loop, the output is inconsistent, then the second loop is less incosistent, in the third loop, the output finally right.
But when I've tried it again, it won't come out right till the 4th loop.
Then, what should I do?
05-10-2013 12:22 PM
You are pulling random bytes from the serial stream when you try to read from the Arduino inot LabVIEW. This is why you are seeing random behavior.
I don't really understand why you are sending back the exact same information that you just sent to the Arduino. If you could explain your actual end goal for the project instead of your intermmediate goals then we might be able to better understand what you are doing.
05-12-2013 02:37 PM
Actually, I'm trying to send the data from Labview to digital potentiometer.
I connect the digital potentiometer with Photovoltaic Cell, the actual data that i need is the voltage in that circuit when the resistance is changed.
But I found out later that the Arduino didn't read the value right, so the digital potentiometer didn't work like what i expected to be. But the data voltage which appeared in Labview is the same as what i measured using Multimeter,
So without using photovoltaic, i tried to read the output directly from digital potentiometer and it shown as it is now.
That's when I conclude that Labview didn't send the data llike I what expected it to be.