01-07-2021 12:55 AM
Hello All
I am a new learner in Labview and I have a question. Thank you all in advance for helping.
I am receiving numbers from Serial Monitor in Arduino to Labview as String. And labview shows these value in Vaweform Charts.
In labview output numbers are in integer format. Thus, vaweform charts draw graphics as integer. However, I need float numbers and desiring show them in output.
How can I obtain float numbers to Labview?
You can find attached vi file.
Thank you again.
01-07-2021 01:47 AM - edited 01-07-2021 01:51 AM
Hi suzui,
@suzui wrote:
In labview output numbers are in integer format. Thus, vaweform charts draw graphics as integer.
However, I need float numbers and desiring show them in output.
How can I obtain float numbers to Labview?
Thanks for attaching a VI. And many thanks for attaching a VI with data embedded!
Well, as can be seen in that "Response" string indicator you receive just integer numbers from your Arduino.
So to obtain float numbers in LabVIEW you need to send float numbers in your Arduino!
You forgot to also attach the Arduino sketch used to send those numbers. Are you sure you are sending float values? (Can you prove that to us?)
Btw. it doesn't make sense to keep an ever growing "Response" string and convert that string again and again to numbers!
Convert to numeric data once and collect those in a shift register.
(Or don't even collect data in arrays when you just need to display them in charts with their own history buffer…)
01-07-2021 01:48 AM
Just to clarify, are you after number with decimal points?
It looks like you are only sending integers from your Arduino (Assuming the data in the response indicator is the same as what you have been receiving from the Arduino). You need to change your Arduino code to send data with decimal points.
01-07-2021 10:31 AM
Dear GerdW and Niatross
First of all, thank you for helping
Please let me put some data to explain more.
I am receiving those number from ADXL335 sensor as you see picture below. When I export the results to excel, my values are integer.
As fo Arduino, Yes I am getting float data.
Please find atttached Serial Monitor Arduino.
The codes in Arduino which I convert integer to float.
If you need some file or something, please let me know.
Thank you for your great advices and helping me!
01-07-2021 01:37 PM
01-07-2021 04:06 PM
I wouldn't be surprised if this is a decimal "comma" problem. But so far what has been presented doesn't indicate that.
The problem as it was originally presented in the original VI, which contains the raw data coming in from the Arduino, doesn't show any commas or decimal points. It is completely integer. So of course there will be integer data.
Meanwhile in the picture in message #3, something must have changed because now you do see decimal points in the raw string data.
So something was fixed.
Now if the problem still exists, whether it is in LabVIEW or Excel. I would hope that anyone living or working in a country that uses a decimal "comma" as the decimal point would already beware of the problems that commas cause. I just don't know from the latest message whether the conversion error is in LabVIEW converting what are obviously decimal points, or in Excel trying to import a data file that has decimal points.